添加客户接口

finance
杨赟 2 years ago
parent 1237f97014
commit e4dc4823ae

@ -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 // 状态

@ -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
}

@ -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)
}

@ -0,0 +1,6 @@
package user
type User struct {
Deposit deposit // 充值
DepositAudit depositAudit // 充值审核
}

@ -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)
}
Loading…
Cancel
Save