diff --git a/server/inventory/internal/logic/getpickuplistlogic.go b/server/inventory/internal/logic/getpickuplistlogic.go index fff544ee..28d20a81 100644 --- a/server/inventory/internal/logic/getpickuplistlogic.go +++ b/server/inventory/internal/logic/getpickuplistlogic.go @@ -27,8 +27,9 @@ func NewGetPickupListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } func (l *GetPickupListLogic) GetPickupList(req *types.GetPickupListReq, userinfo *auth.UserInfo) (resp *basic.Response) { - // 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data) - // userinfo 传入值时, 一定不为null + if userinfo.GetIdType() != auth.IDTYPE_User { + return resp.SetStatusWithMessage(basic.CodeServiceErr, "please login first") + } return resp.SetStatus(basic.CodeOK) } diff --git a/server/inventory/internal/types/types.go b/server/inventory/internal/types/types.go index 40d7272c..338666eb 100644 --- a/server/inventory/internal/types/types.go +++ b/server/inventory/internal/types/types.go @@ -70,6 +70,46 @@ type GetPickupListReq struct { Size int `form:"size"` } +type GetPickupListRsp struct { + PickupList []PickupItem `json:"items"` + Meta Meta `json:"_meta"` +} + +type PickupItem struct { + Id int `json:"id"` + UserId int `json:"user_id"` + TrackNum string `json:"track_num"` + Ctime string `json:"ctime"` + Status int `json:"status"` + UpsSn string `json:"ups_sn"` + Address string `json:"address"` + ProductList []Product `json:"productList"` + Pcs int `json:"pcs"` + PcsBox int `json:"pcs_box"` + LogisticsStatus int `json:"logistics_status"` + StatusTimes []StatusTimesItem `json:"status_times"` +} + +type Product struct { + Id int `json:"id"` + PickId int `json:"pick_id"` + StockId int `json:"stock_id"` + Num int `json:"num"` + Boxes int `json:"boxes"` + Ctime int `json:"ctime"` + ProductName string `json:"product_name"` + Pcs int `json:"pcs"` + PcsBox int `json:"pcs_box"` + Cover string `json:"cover"` + Size string `json:"size"` + Fitting string `json:"fitting"` +} + +type StatusTimesItem struct { + Key int `json:"key"` + Time string `json:"time"` +} + type Request struct { } diff --git a/server_api/inventory.api b/server_api/inventory.api index 803b1041..38047062 100644 --- a/server_api/inventory.api +++ b/server_api/inventory.api @@ -84,4 +84,40 @@ type GetPickupListReq { Page int `form:"page"` PageSize int `form:"page_size"` Size int `form:"size"` +} +type GetPickupListRsp { + PickupList []PickupItem `json:"items"` + Meta Meta `json:"_meta"` +} +type PickupItem { + Id int `json:"id"` + UserId int `json:"user_id"` + TrackNum string `json:"track_num"` + Ctime string `json:"ctime"` + Status int `json:"status"` + UpsSn string `json:"ups_sn"` + Address string `json:"address"` + ProductList []Product `json:"productList"` + Pcs int `json:"pcs"` + PcsBox int `json:"pcs_box"` + LogisticsStatus int `json:"logistics_status"` + StatusTimes []StatusTimesItem `json:"status_times"` +} +type Product { + Id int `json:"id"` + PickId int `json:"pick_id"` + StockId int `json:"stock_id"` + Num int `json:"num"` + Boxes int `json:"boxes"` + Ctime int `json:"ctime"` + ProductName string `json:"product_name"` + Pcs int `json:"pcs"` + PcsBox int `json:"pcs_box"` + Cover string `json:"cover"` + Size string `json:"size"` + Fitting string `json:"fitting"` +} +type StatusTimesItem { + Key int `json:"key"` + Time string `json:"time"` } \ No newline at end of file