diff --git a/customer/user.go b/customer/user.go index d63be1b..1278a5e 100644 --- a/customer/user.go +++ b/customer/user.go @@ -3,7 +3,9 @@ package customer import ( "context" "git.oa00.com/supply-chain/service/client" + user2 "git.oa00.com/supply-chain/service/customer/user" "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" ) const ( @@ -15,6 +17,7 @@ const ( ) type user struct { + user2.User } type UserSearch struct { Status uint // 状态 @@ -25,15 +28,16 @@ type ArgsUserList struct { Page bean.Page } type UserItem struct { - Id uint `json:"id"` - Name string `json:"name"` - Account string `json:"account"` - Liaison string `json:"liaison"` - Phone string `json:"phone"` - Status uint `json:"status"` - CreatedType uint `json:"createdType"` - CreatedUserId uint `json:"createdUserId"` - CreatedAt int64 `json:"createdAt"` + Id uint `json:"id"` + Name string `json:"name"` + Account string `json:"account"` + Liaison string `json:"liaison"` + Phone string `json:"phone"` + Amount decimal.Decimal `json:"amount"` + Status uint `json:"status"` + CreatedType uint `json:"createdType"` + CreatedUserId uint `json:"createdUserId"` + CreatedAt int64 `json:"createdAt"` } type ReplyUserList struct { Lists []UserItem `json:"lists"` diff --git a/customer/user/deposit.go b/customer/user/deposit.go new file mode 100644 index 0000000..9501065 --- /dev/null +++ b/customer/user/deposit.go @@ -0,0 +1,62 @@ +package user + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "github.com/shopspring/decimal" +) + +type deposit struct { +} +type applyType uint // 申请人类型 +const ( + ApplyTypeCustomer = 1 // 客户 + ApplyTypePlatform = 2 // 平台 + + DepositAuditStatusWait = 1 // 待审核 + DepositAuditStatusAdopt = 2 // 审核通过 + DepositAuditStatusReject = 3 // 审核驳回 +) + +type ArgsDepositAdd struct { + UserId uint // 客户id + ApplyType uint // 申请人类型 1=客户 2=平台 + ApplyUserId uint // 申请人id + Amount decimal.Decimal // 充值金额 + Proof string // 充值凭证 + DepositAt int64 // 充值时间 + Remark string // 备注 +} + +// Add @Title 充值 +func (d *deposit) Add(ctx context.Context, args ArgsDepositAdd) error { + reply := 0 + return client.GetClient(d).Call(ctx, "Add", args, &reply) +} + +type ArgsDepositInfo struct { + DepositId uint // 充值记录id 必须 + UserId uint // 用户id 可选 +} +type ReplyDepositInfo struct { + Id uint `json:"id"` + UserId uint `json:"userId"` + UserName string `json:"userName"` + Amount decimal.Decimal `json:"amount"` + ApplyType uint `json:"applyType"` + ApplyUserId uint `json:"applyUserId"` + ApplyAt int64 `json:"applyAt"` + Proof string `json:"proof"` + DepositAt int64 `json:"depositAt"` + Remark string `json:"remark"` + AuditStatus uint `json:"auditStatus"` + AuditUserId uint `json:"auditUserId"` + AuditAt int64 `json:"auditAt"` + Reason string `json:"reason"` +} + +// Info @Title 详情 +func (d *deposit) Info(ctx context.Context, args ArgsDepositInfo) (reply ReplyDepositInfo, err error) { + err = client.GetClient(d).Call(ctx, "Info", args, &reply) + return +} diff --git a/customer/user/depositAudit.go b/customer/user/depositAudit.go new file mode 100644 index 0000000..21e28c4 --- /dev/null +++ b/customer/user/depositAudit.go @@ -0,0 +1,70 @@ +package user + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type depositAudit struct { +} + +type ArgsDepositAuditLists struct { + Search DepositAuditSearch + Page bean.Page +} + +type DepositAuditSearch struct { + Status uint // 审核状态 1=待审核 2=通过 3=驳回 + Name string // 客户名称 + Amount decimal.Decimal // 充值金额 + ApplyDateStart string // 申请日期 + ApplyDateEnd string // 申请日期 + AuditDateStart string // 审核日期 + AuditDateEnd string // 审核日期 +} +type ReplyDepositAuditList struct { + Lists []DepositAuditItem `json:"lists"` + Total int64 `json:"total"` +} +type DepositAuditItem struct { + Id uint `json:"id"` + UserId uint `json:"userId"` + UserName string `json:"userName"` + Amount decimal.Decimal `json:"amount"` + ApplyType uint `json:"applyType"` + ApplyUserId uint `json:"applyUserId"` + ApplyAt int64 `json:"applyAt"` + AuditStatus uint `json:"auditStatus"` +} + +// Lists @Title 充值审核列表 +func (d *depositAudit) Lists(ctx context.Context, args ArgsDepositAuditLists) (reply ReplyDepositAuditList, err error) { + err = client.GetClient(d).Call(ctx, "Lists", args, &reply) + return +} + +type ArgsDepositAuditAdopt struct { + DepositId uint // 充值记录id + AuditUserId uint // 审核人id +} + +// Adopt @Title 通过 +func (d *depositAudit) Adopt(ctx context.Context, args ArgsDepositAuditAdopt) error { + reply := 0 + return client.GetClient(d).Call(ctx, "Adopt", args, &reply) + +} + +type ArgsDepositAuditReject struct { + DepositId uint // 充值记录id + AuditUserId uint // 审核人id + Reason string // 驳回原因 +} + +// Reject @Title 驳回 +func (d *depositAudit) Reject(ctx context.Context, args ArgsDepositAuditReject) error { + reply := 0 + return client.GetClient(d).Call(ctx, "Reject", args, &reply) +} diff --git a/customer/user/user.go b/customer/user/user.go new file mode 100644 index 0000000..0c35d60 --- /dev/null +++ b/customer/user/user.go @@ -0,0 +1,6 @@ +package user + +type User struct { + Deposit deposit // 充值 + DepositAudit depositAudit // 充值审核 +} diff --git a/customer/user/wallet.go b/customer/user/wallet.go new file mode 100644 index 0000000..04aa620 --- /dev/null +++ b/customer/user/wallet.go @@ -0,0 +1,34 @@ +package user + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "github.com/shopspring/decimal" +) + +type wallet struct { +} +type walletType uint // 费用类型 + +const ( + WalletTypeIncome walletType = 1 // 收入 + WalletTypeExpend walletType = 2 // 支出 + + WalletStatusHandle = 1 // 处理中 + WalletStatusSuccess = 2 // 成功 + WalletStatusFail = 3 // 失败 +) + +type ArgsWalletDirect struct { + UserId uint // 客户id + WalletType walletType // 收支类型 + Amount decimal.Decimal // 金额 正数 + ServiceId uint // 服务id + Remark string // 备注信息 +} + +// Direct @Title 直接消费 +func (w *wallet) Direct(ctx context.Context, args ArgsDepositAuditReject) error { + reply := 0 + return client.GetClient(w).Call(ctx, "Direct", args, &reply) +} diff --git a/jd/sku.go b/jd/sku.go index bc34def..4b6776d 100644 --- a/jd/sku.go +++ b/jd/sku.go @@ -94,7 +94,7 @@ type SkuImg struct { } // GetImgs @Title 获取预览图 -func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply SkuImg, err error) { +func (s *sku) GetImgs(ctx context.Context, skuId uint) (reply []SkuImg, err error) { err = client.GetClient(s).Call(ctx, "GetImgs", skuId, &reply) return }