97 lines
3.2 KiB
Go
97 lines
3.2 KiB
Go
// Package sysin
|
|
// @Link https://github.com/bufanyun/hotgo
|
|
// @Copyright Copyright (c) 2026 HotGo
|
|
// @Author Ms <133814250@qq.com>
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
package sysin
|
|
|
|
import (
|
|
"context"
|
|
"hotgo/internal/consts"
|
|
"hotgo/internal/library/dict"
|
|
"hotgo/internal/model/input/form"
|
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
// ImRealnameListInp 获取IM实名审核列表
|
|
type ImRealnameListInp struct {
|
|
form.PageReq
|
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
|
UserId int64 `json:"userId" dc:"用户ID"`
|
|
SubmissionId string `json:"submissionId" dc:"提交ID"`
|
|
Status string `json:"status" dc:"状态"`
|
|
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
}
|
|
|
|
func (in *ImRealnameListInp) Filter(ctx context.Context) (err error) {
|
|
if in.TenantId <= 0 {
|
|
return gerror.New("请选择租户")
|
|
}
|
|
return
|
|
}
|
|
|
|
type ImRealnameListModel struct {
|
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
|
TenantName string `json:"tenantName" dc:"租户名称"`
|
|
Id int64 `json:"id" dc:"ID"`
|
|
UserId int64 `json:"userId" dc:"用户ID"`
|
|
SubmissionId string `json:"submissionId" dc:"提交ID"`
|
|
Status string `json:"status" dc:"状态"`
|
|
MaskedName string `json:"maskedName" dc:"脱敏姓名"`
|
|
MaskedIdNumber string `json:"maskedIdNumber" dc:"脱敏证件号"`
|
|
IdType string `json:"idType" dc:"证件类型"`
|
|
ReviewReason string `json:"reviewReason" dc:"审核原因"`
|
|
VerifiedAt *gtime.Time `json:"verifiedAt" dc:"通过时间"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
|
}
|
|
|
|
// ImRealnameViewInp 获取指定IM实名审核信息
|
|
type ImRealnameViewInp struct {
|
|
TenantId int64 `json:"tenantId" v:"required#租户ID不能为空" dc:"租户ID"`
|
|
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
|
}
|
|
|
|
func (in *ImRealnameViewInp) Filter(ctx context.Context) (err error) {
|
|
if in.TenantId <= 0 {
|
|
return gerror.New("请选择租户")
|
|
}
|
|
if in.Id <= 0 {
|
|
return gerror.New("ID不能为空")
|
|
}
|
|
return
|
|
}
|
|
|
|
type ImRealnameViewModel struct {
|
|
ImRealnameListModel
|
|
IdNumberHash string `json:"idNumberHash" dc:"证件号哈希"`
|
|
}
|
|
|
|
// ImRealnameReviewInp 审核IM实名
|
|
type ImRealnameReviewInp struct {
|
|
TenantId int64 `json:"tenantId" v:"required#租户ID不能为空" dc:"租户ID"`
|
|
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
|
Status string `json:"status" dc:"审核状态"`
|
|
ReviewReason string `json:"reviewReason" dc:"审核原因"`
|
|
}
|
|
|
|
func (in *ImRealnameReviewInp) Filter(ctx context.Context) (err error) {
|
|
if in.TenantId <= 0 {
|
|
return gerror.New("请选择租户")
|
|
}
|
|
if in.Id <= 0 {
|
|
return gerror.New("ID不能为空")
|
|
}
|
|
if !dict.HasOptionKey(consts.ImRealnameStatusOptions, in.Status) {
|
|
return gerror.New("审核状态不正确")
|
|
}
|
|
if in.Status == consts.ImRealnameStatusRejected && in.ReviewReason == "" {
|
|
return gerror.New("拒绝原因不能为空")
|
|
}
|
|
return
|
|
}
|
|
|
|
type ImRealnameReviewModel struct{}
|