From e4dc4823ae67d8e6aefd6b63696230cdf5cce1cb Mon Sep 17 00:00:00 2001 From: kanade Date: Fri, 29 Jul 2022 16:41:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer/user.go | 2 + customer/user/deposit.go | 62 +++++++++++++++++++++++++++++++ customer/user/depositAudit.go | 70 +++++++++++++++++++++++++++++++++++ customer/user/user.go | 6 +++ customer/user/wallet.go | 34 +++++++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 customer/user/deposit.go create mode 100644 customer/user/depositAudit.go create mode 100644 customer/user/user.go create mode 100644 customer/user/wallet.go diff --git a/customer/user.go b/customer/user.go index d63be1b..850ec3f 100644 --- a/customer/user.go +++ b/customer/user.go @@ -3,6 +3,7 @@ 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" ) @@ -15,6 +16,7 @@ const ( ) type user struct { + user2.User } type UserSearch struct { Status uint // 状态 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) +}