diff --git a/customer/service/audit/supply.go b/customer/service/audit/supply.go index 368109e..bcaed84 100644 --- a/customer/service/audit/supply.go +++ b/customer/service/audit/supply.go @@ -82,3 +82,20 @@ func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySuppl err = xClient.Call(ctx, "Info", userServiceId, &reply) return } + +type ReplyProof struct { + Name string `json:"name"` + ChannelId uint `json:"channelId"` // 用户Id + AppKey string `json:"appKey"` + AppSecret string `json:"appSecret"` +} + +// GetProof @Title 获取凭证 +func (s *supply) GetProof(ctx context.Context, userServiceId uint) (reply ReplyProof, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "GetProof", userServiceId, &reply) + return +} diff --git a/customer/service/service.go b/customer/service/service.go index 3eaf512..6a5b359 100644 --- a/customer/service/service.go +++ b/customer/service/service.go @@ -16,10 +16,11 @@ type ArgsServiceLists struct { } type ReplyServiceLists struct { - ServiceId uint `json:"serviceId"` - ServiceName string `json:"serviceName"` - EndTime int64 `json:"endTime"` - AuditStatus uint `json:"auditStatus"` + UserServiceId uint `json:"userServiceId"` + ServiceId uint `json:"serviceId"` + ServiceName string `json:"serviceName"` + EndTime int64 `json:"endTime"` + AuditStatus uint `json:"auditStatus"` } type service struct { diff --git a/customer/user/wallet.go b/customer/user/wallet.go index 1136b89..50aea1f 100644 --- a/customer/user/wallet.go +++ b/customer/user/wallet.go @@ -36,3 +36,52 @@ func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error } return xClient.Call(ctx, "Direct", args, &reply) } + +type ArgsWalletCreate struct { + UserId uint // 客户id + WalletType walletType // 收支类型 + Amount decimal.Decimal // 金额 正数 + ServiceId uint // 服务id + Remark string // 备注信息 + CancelSecond int64 // 自动取消秒 +} + +// Create @Title 创建消费 +func (w *wallet) Create(ctx context.Context, args ArgsWalletCreate) (walletId uint, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "Create", args, &walletId) + return +} + +type ArgsWalletSuccess struct { + UserId uint // 客户id + WalletId uint // 消费id +} + +// Success @Title 成功 +func (w *wallet) Success(ctx context.Context, args ArgsWalletSuccess) error { + reply := 0 + xClient, err := client.GetClient(w) + if err != nil { + return err + } + return xClient.Call(ctx, "Success", args, &reply) +} + +type ArgsWalletFail struct { + UserId uint // 客户id + WalletId uint // 消费id +} + +// Fail @Title 失败 +func (w *wallet) Fail(ctx context.Context, args ArgsWalletFail) error { + reply := 0 + xClient, err := client.GetClient(w) + if err != nil { + return err + } + return xClient.Call(ctx, "Fail", args, &reply) +} diff --git a/supply/channel/order.go b/supply/channel/order.go index 6e3a5aa..4a6d991 100644 --- a/supply/channel/order.go +++ b/supply/channel/order.go @@ -10,6 +10,17 @@ import ( const ( ReplyOrderFreightFeeErrCodeNone = 0 // 无错误 ReplyOrderFreightFeeErrCodeErr = 1 // 有错误 + + OrderStatusLock = 1 // 锁单待确认 + OrderStatusLadingBill = 2 // 提单 + OrderStatusClose = 3 // 关闭 + + OrderSubStatusLock = 1 // 锁单 + OrderSubStatusLadingBill = 2 // 提单 + OrderSubStatusSendOutGoods = 3 // 出库/发货 + OrderSubStatusDelivered = 4 // 妥投 + OrderSubStatusFinal = 5 // 完成 + OrderSubStatusCancel = 6 // 取消 ) type order struct { @@ -82,3 +93,26 @@ func (o *order) Submit(ctx context.Context, channelId string, args ArgsOrderSubm err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) return } + +// LadingBill @Title 提单 +func (o *order) LadingBill(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) + return +} + +type ArgsOrderClose struct { +} + +// Close @Title 关闭 +func (o *order) Close(ctx context.Context, channelId string, args ArgsOrderSubmit) (reply ReplyOrderSubmit, err error) { + xClient, err := client.GetClient(o) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Submit", args, &reply) + return +} diff --git a/supply/channel/sku.go b/supply/channel/sku.go index 55ce82c..265225f 100644 --- a/supply/channel/sku.go +++ b/supply/channel/sku.go @@ -119,6 +119,49 @@ func (s *sku) Details(ctx context.Context, channelId string, args ArgsSkuDetails return } +type ArgsSkuPrices struct { + SkuIds []uint // sku数组 +} +type SkuPrice struct { + Id uint `json:"id"` + Name string `json:"name"` + Price decimal.Decimal `json:"price"` + GuidePrice decimal.Decimal `json:"guidePrice"` + Profit decimal.Decimal `json:"profit"` + Status uint `json:"status"` + CreatedAt int64 `json:"createdAt"` + UpdatedAt int64 `json:"updatedAt"` +} + +// Prices @Title 获取sku价格 +func (s *sku) Prices(ctx context.Context, channelId string, args ArgsSkuPrices) (reply []SkuPrice, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Prices", args, &reply) + return +} + +type ArgsSkuGroups struct { + SkuIds []uint // sku数组 +} + +type SkuGroup struct { + SkuId uint `json:"skuId"` + GroupSkuIds []uint `json:"groupSkuIds"` +} + +// Groups @Title 获取sku分组信息 +func (s *sku) Groups(ctx context.Context, channelId string, args ArgsSkuGroups) (reply []SkuGroup, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(context.WithValue(ctx, share.ReqMetaDataKey, map[string]string{"channelId": channelId}), "Groups", args, &reply) + return +} + type ArgsSkuStock struct { Address string // 地址 Skus []SkuStockItem // sku信息