You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
2.4 KiB
103 lines
2.4 KiB
package user
|
|
|
|
import (
|
|
"context"
|
|
"git.oa00.com/supply-chain/service/client"
|
|
"git.oa00.com/supply-chain/service/lib/bean"
|
|
)
|
|
|
|
type real struct {
|
|
}
|
|
|
|
type ArgsUserRealLists struct {
|
|
Search UserRealSearch
|
|
Page bean.Page
|
|
}
|
|
|
|
type UserRealSearch struct {
|
|
UserName string
|
|
AuditStatus uint // 状态 1=待审核 2=审核通过 3=审核驳回
|
|
}
|
|
|
|
type ReplyUserRealLists struct {
|
|
Lists []UserRealItem
|
|
Total int64
|
|
}
|
|
|
|
type UserRealItem struct {
|
|
Id uint `json:"id"`
|
|
UserName string `json:"userName"`
|
|
Name string `json:"name"`
|
|
Code string `json:"code"`
|
|
CardImg string `json:"cardImg"`
|
|
AuditStatus uint `json:"auditStatus"`
|
|
AuditUserId uint `json:"auditUserId"`
|
|
AuditAt int64 `json:"auditAt"`
|
|
Reason string `json:"reason"`
|
|
CreatedAt int64 `json:"createdAt"`
|
|
}
|
|
|
|
// List @Title 实名认证列表
|
|
func (r *real) List(ctx context.Context, args ArgsUserRealLists) (reply ReplyUserRealLists, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return ReplyUserRealLists{}, err
|
|
}
|
|
err = xClient.Call(ctx, "List", args, &reply)
|
|
return
|
|
}
|
|
|
|
type ReplyUserRealInfo struct {
|
|
Id uint `json:"id"`
|
|
UserName string `json:"userName"`
|
|
Name string `json:"name"`
|
|
Code string `json:"code"`
|
|
CardImg string `json:"cardImg"`
|
|
AuditStatus uint `json:"auditStatus"`
|
|
AuditUserId uint `json:"auditUserId"`
|
|
AuditAt int64 `json:"auditAt"`
|
|
Reason string `json:"reason"`
|
|
CreatedAt int64 `json:"createdAt"`
|
|
}
|
|
|
|
// Info @Title 审核详情
|
|
func (r *real) Info(ctx context.Context, RealId uint) (reply ReplyUserRealInfo, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return ReplyUserRealInfo{}, err
|
|
}
|
|
err = xClient.Call(ctx, "Info", RealId, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsUserRealAdopt struct {
|
|
RealId uint
|
|
AuditUserId uint // 审核人Id
|
|
}
|
|
|
|
// Adopt @Title 审核通过
|
|
func (r *real) Adopt(ctx context.Context, args ArgsUserRealAdopt) error {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Adopt", args, &reply)
|
|
}
|
|
|
|
type ArgsUserRealReject struct {
|
|
RealId uint
|
|
AuditUserId uint // 审核人Id
|
|
Reason string // 驳回原因
|
|
}
|
|
|
|
// Reject @Title 审核驳回
|
|
func (r *real) Reject(ctx context.Context, args ArgsUserRealReject) error {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Reject", args, &reply)
|
|
}
|