修改客户接口

finance
杨赟 2 years ago
parent 5167292432
commit 8f6e687050

@ -3,7 +3,8 @@ package customer
type serviceId uint type serviceId uint
const ( const (
ServiceSupply serviceId = 1 // 供应链 ServiceSupply serviceId = 1 // 供应链
ServiceWholesale serviceId = 2 // 批发
UserServiceStatusNone = 0 // 无 UserServiceStatusNone = 0 // 无
UserServiceStatusWait = 1 // 待审核 UserServiceStatusWait = 1 // 待审核

@ -3,12 +3,11 @@ package service
import ( import (
"context" "context"
"git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/client"
audit2 "git.oa00.com/supply-chain/service/customer/service/audit"
"git.oa00.com/supply-chain/service/lib/bean" "git.oa00.com/supply-chain/service/lib/bean"
"time"
) )
type audit struct { type audit struct {
audit2.Audit
} }
type AuditSearch struct { type AuditSearch struct {
ApplyUserId uint // 申请人 ApplyUserId uint // 申请人
@ -72,3 +71,74 @@ func (a *audit) History(ctx context.Context, args ArgsHistory) (reply ReplyHisto
err = xClient.Call(ctx, "History", args, &reply) err = xClient.Call(ctx, "History", args, &reply)
return return
} }
type ArgsAuditApply struct {
ServiceId uint `json:"serviceId"` // 服务id
ApplyUserId uint `json:"applyUserId"` // 申请人id
CustomerId uint `json:"customerId"` // 客户id
ExpirationAt time.Time `json:"expirationAt"` // 到期时间
Expand any `json:"expand"` // 拓展参数
}
// Apply @Title 申请
func (a *audit) Apply(ctx context.Context, args ArgsAuditApply) error {
reply := 0
xClient, err := client.GetClient(a)
if err != nil {
return err
}
return xClient.Call(ctx, "Apply", args, &reply)
}
type ArgsAuditAdopt struct {
AuditUserId uint // 审核人id
UserServiceId uint // 客户服务id
}
// Adopt @Title 审核通过
func (a *audit) Adopt(ctx context.Context, args ArgsAuditAdopt) error {
reply := 0
xClient, err := client.GetClient(a)
if err != nil {
return err
}
return xClient.Call(ctx, "Adopt", args, &reply)
}
type ArgsAuditReject struct {
AuditUserId uint // 审核人id
UserServiceId uint // 客户服务id
Reason string // 驳回原因
}
// Reject @Title 驳回
func (a *audit) Reject(ctx context.Context, args ArgsAuditReject) error {
reply := 0
xClient, err := client.GetClient(a)
if err != nil {
return err
}
return xClient.Call(ctx, "Reject", args, &reply)
}
type ReplyAuditInfo struct {
Id uint `json:"id"`
UserName string `json:"userName"`
ApplyUserId uint `json:"applyUserId"`
ApplyAt int64 `json:"applyAt"`
ServiceId uint `json:"serviceId"`
ServiceName string `json:"serviceName"`
ExpirationAt int64 `json:"expirationAt"`
AuditStatus uint `json:"auditStatus"`
AuditAt int64 `json:"auditAt"`
Reason string `json:"reason"`
AuditUserId uint `json:"auditUserId"`
Expand any `json:"expand"`
}
type ReplyProof struct {
Name string `json:"name"`
ChannelId uint `json:"channelId"` // 用户Id
AppKey string `json:"appKey"`
AppSecret string `json:"appSecret"`
}

@ -1,5 +0,0 @@
package audit
type Audit struct {
Supply supply
}

@ -1,101 +0,0 @@
package audit
import (
"context"
"git.oa00.com/supply-chain/service/client"
)
type supply struct {
}
type ArgsSupplyApply struct {
ApplyUserId uint // 申请人id
CustomerId uint // 客户id
RateId uint // 费率id
ExpirationAt string // 到期时间
Enclosure string // 附件
}
// Apply @Title 申请
func (s *supply) Apply(ctx context.Context, args ArgsSupplyApply) error {
reply := 0
xClient, err := client.GetClient(s)
if err != nil {
return err
}
return xClient.Call(ctx, "Apply", args, &reply)
}
type ArgsSupplyAdopt struct {
AuditUserId uint // 审核人id
UserServiceId uint // 客户服务id
}
// Adopt @Title 审核通过
func (s *supply) Adopt(ctx context.Context, args ArgsSupplyAdopt) error {
reply := 0
xClient, err := client.GetClient(s)
if err != nil {
return err
}
return xClient.Call(ctx, "Adopt", args, &reply)
}
type ArgsSupplyReject struct {
AuditUserId uint // 审核人id
UserServiceId uint // 客户服务id
Reason string // 驳回原因
}
// Reject @Title 驳回
func (s *supply) Reject(ctx context.Context, args ArgsSupplyReject) error {
reply := 0
xClient, err := client.GetClient(s)
if err != nil {
return err
}
return xClient.Call(ctx, "Reject", args, &reply)
}
type ReplySupplyInfo struct {
Id uint `json:"id"`
UserName string `json:"userName"`
ApplyUserId uint `json:"applyUserId"`
ApplyAt int64 `json:"applyAt"`
ServiceId uint `json:"serviceId"`
ServiceName string `json:"serviceName"`
ExpirationAt int64 `json:"expirationAt"`
RateId uint `json:"rateId"`
Enclosure string `json:"enclosure"`
AuditStatus uint `json:"auditStatus"`
AuditAt int64 `json:"auditAt"`
Reason string `json:"reason"`
AuditUserId uint `json:"auditUserId"`
}
// Info @Title 详情
func (s *supply) Info(ctx context.Context, userServiceId uint) (reply ReplySupplyInfo, err error) {
xClient, err := client.GetClient(s)
if err != nil {
return
}
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
}

@ -31,7 +31,6 @@ type UserItem struct {
Id uint `json:"id"` Id uint `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Account string `json:"account"` Account string `json:"account"`
RateId uint `json:"rateId"`
Liaison string `json:"liaison"` Liaison string `json:"liaison"`
Phone string `json:"phone"` Phone string `json:"phone"`
Amount decimal.Decimal `json:"amount"` Amount decimal.Decimal `json:"amount"`

Loading…
Cancel
Save