diff --git a/server/home-user-auth/internal/handler/userstatusconfighandler.go b/server/home-user-auth/internal/handler/userstatusconfighandler.go index 47bdd347..e29ae441 100644 --- a/server/home-user-auth/internal/handler/userstatusconfighandler.go +++ b/server/home-user-auth/internal/handler/userstatusconfighandler.go @@ -14,7 +14,7 @@ import ( func UserStatusConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - var req types.RequestBasicInfoForm + var req types.Request if err := httpx.Parse(r, &req); err != nil { httpx.OkJsonCtx(r.Context(), w, &types.Response{ Code: 510, diff --git a/server/home-user-auth/internal/logic/userstatusconfiglogic.go b/server/home-user-auth/internal/logic/userstatusconfiglogic.go index 6515100b..432e290a 100644 --- a/server/home-user-auth/internal/logic/userstatusconfiglogic.go +++ b/server/home-user-auth/internal/logic/userstatusconfiglogic.go @@ -24,10 +24,76 @@ func NewUserStatusConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *UserStatusConfigLogic) UserStatusConfig(req *types.RequestBasicInfoForm) (resp *types.Response) { +func (l *UserStatusConfigLogic) UserStatusConfig(req *types.Request) (resp *types.Response) { // 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data) - return resp.SetStatus(basic.CodeOK) + data := &types.DataStatusConfig{ + SearchList: []types.KeyName{ + {Key: -1, Name: "All"}, + {Key: -1, Name: "All"}, + {Key: 1, Name: "Order Has Been Placed"}, + {Key: 2, Name: "In Production"}, + {Key: 3, Name: "Shipped"}, + {Key: 4, Name: "Inventory"}, + {Key: 8, Name: "Ready for Shipment"}, + {Key: 5, Name: "Completed"}, + // {"key": 6, "name": "Refund Under Review"}, + {Key: 7, Name: "Transaction Closed"}, + }, + OrderStatus: []types.KeyNameButton{ + {Key: 1, Name: "Order Has Been Placed", Button: []string{"download_invoice", "cancel", "again", "toPay"}}, + {Key: 2, Name: "In Production", Button: []string{"download_invoice", "again", "toPay"}}, + {Key: 3, Name: "Shipped", Button: []string{"download_invoice", "again", "view_logistics"}}, + {Key: 5, Name: "Completed", Button: []string{"download_invoice", "again", "view_logistics", "delete"}}, + + {Key: 7, Name: "Transaction Closed", Button: []string{"again", "delete"}}, + }, + + InventoryStatus: []types.KeyNameButton{ + {Key: 1, Name: "Order Has Been Placed", Button: []string{"download_invoice", "cancel", "again", "toPay"}}, + {Key: 2, Name: "In Production", Button: []string{"download_invoice", "again", "toPay"}}, + {Key: 4, Name: "Inventory", Button: []string{"download_invoice", "again", "go_cloud", "toPay"}}, + {Key: 8, Name: "Ready for Shipment", Button: []string{"download_invoice", "again", "go_cloud", "delete"}}, + + {Key: 7, Name: "Transaction Closed", Button: []string{"again", "delete"}}, + }, + + Time: []types.KeyName{ + {Key: 0, Name: "All"}, + {Key: 1, Name: "within a month"}, + {Key: 2, Name: "within a quarter"}, + {Key: 3, Name: "Within half a year"}, + {Key: 4, Name: "Within a year"}, + }, + + RefundReason: []types.KeyName{ + {Key: 1, Name: "I don't want it anymore"}, + {Key: 2, Name: "no reason"}, + {Key: 3, Name: "other"}, + }, + OrderLogisticsStatus: []types.KeyName{ + {Key: 1, Name: "Order"}, + {Key: 2, Name: "Completed"}, + {Key: 3, Name: "Shipped"}, + {Key: 4, Name: "UPS Pick Up"}, + {Key: 5, Name: "Arrival"}, + }, + InventoryLogisticsStatus: []types.KeyName{ + {Key: 1, Name: "Order"}, + {Key: 2, Name: "Arrival Inventory"}, + {Key: 3, Name: "Ready For Shipment"}, + }, + LogisticsStatus: []types.KeyNameButton{ + {Key: -1, Name: "All", Button: []string{}}, + {Key: 1, Name: "Draw", Button: []string{}}, + {Key: 2, Name: "Shipping", Button: []string{}}, + + {Key: 3, Name: "UPS pick up", Button: []string{"check_detail"}}, + {Key: 4, Name: "Arrival", Button: []string{}}, + }, + } + + return resp.SetStatus(basic.CodeOK, data) } // [ diff --git a/server/home-user-auth/internal/types/types.go b/server/home-user-auth/internal/types/types.go index aba9b3ec..a9c04c9b 100644 --- a/server/home-user-auth/internal/types/types.go +++ b/server/home-user-auth/internal/types/types.go @@ -70,12 +70,12 @@ type DataGetType struct { } type KeyName struct { - Key string `json:"key"` + Key int `json:"key"` Name string `json:"name"` } type KeyNameButton struct { - Key string `json:"key"` + Key int `json:"key"` Name string `json:"name"` Button []string `json:"button"` } @@ -88,7 +88,7 @@ type DataStatusConfig struct { InventoryLogisticsStatus []KeyName `json:"Inventory_logistics_status"` //订单物流状态 Time []KeyName `json:"time"` //返回订单时间筛选项 RefundReason []KeyName `json:"refund_reason"` //退款原因说明项 - LogisticsStatus []KeyName `json:"logistics_status"` //物流状态筛选项 + LogisticsStatus []KeyNameButton `json:"logistics_status"` //物流状态筛选项 } type Response struct { diff --git a/server_api/home-user-auth.api b/server_api/home-user-auth.api index 17a1ddfa..8223a1a9 100644 --- a/server_api/home-user-auth.api +++ b/server_api/home-user-auth.api @@ -28,7 +28,7 @@ service home-user-auth { post /user/basic-info(RequestBasicInfoForm) returns (response); @handler UserStatusConfigHandler - post /user/status-config(RequestBasicInfoForm) returns (response); + post /user/status-config(request) returns (response); } @server( @@ -107,13 +107,13 @@ type DataGetType { // KeyName 普通的key name 对象结构. eg: /user/status-config 用在返回值 type KeyName { - Key string `json:"key"` + Key int `json:"key"` Name string `json:"name"` } // KeyNameButton 普通的key name button 对象结构 eg: /user/status-config 用在返回值 type KeyNameButton { - Key string `json:"key"` + Key int `json:"key"` Name string `json:"name"` Button []string `json:"button"` } @@ -127,5 +127,5 @@ type DataStatusConfig { InventoryLogisticsStatus []KeyName `json:"Inventory_logistics_status"` //订单物流状态 Time []KeyName `json:"time"` //返回订单时间筛选项 RefundReason []KeyName `json:"refund_reason"` //退款原因说明项 - LogisticsStatus []KeyName `json:"logistics_status"` //物流状态筛选项 + LogisticsStatus []KeyNameButton `json:"logistics_status"` //物流状态筛选项 } \ No newline at end of file