feat: add Go backend
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"hotgo/internal/library/addons"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// AddonsListInp 获取列表
|
||||
type AddonsListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name" dc:"插件名称"`
|
||||
Group int `json:"group" dc:"分组"`
|
||||
Status int `json:"status" dc:"安装状态"`
|
||||
}
|
||||
|
||||
type AddonsListModel struct {
|
||||
addons.Skeleton
|
||||
GroupName string `json:"groupName" dc:"分组名称"`
|
||||
InstallVersion string `json:"installVersion" dc:"安装版本"`
|
||||
InstallStatus int `json:"installStatus" dc:"安装状态"`
|
||||
CanSave bool `json:"canSave" dc:"是否可以更新"`
|
||||
}
|
||||
|
||||
// AddonsBuildInp 提交生成
|
||||
type AddonsBuildInp struct {
|
||||
addons.Skeleton
|
||||
Extend []string `json:"extend" dc:"扩展功能"`
|
||||
}
|
||||
|
||||
func (in *AddonsBuildInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("插件名称不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.Name) {
|
||||
err = gerror.New("插件名称格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AddonsInstallInp 安装模块
|
||||
type AddonsInstallInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
|
||||
// AddonsUpgradeInp 更新模块
|
||||
type AddonsUpgradeInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
|
||||
// AddonsUnInstallInp 卸载模块
|
||||
type AddonsUnInstallInp struct {
|
||||
addons.Skeleton
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// UpdateAddonsConfigInp 更新指定插件的配置
|
||||
type UpdateAddonsConfigInp struct {
|
||||
AddonName string `json:"addonName"`
|
||||
Group string `json:"group"`
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
|
||||
// GetAddonsConfigInp 获取指定插件的配置
|
||||
type GetAddonsConfigInp struct {
|
||||
AddonName string `json:"addonName"`
|
||||
Group string `json:"group"`
|
||||
}
|
||||
type GetAddonsConfigModel struct {
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
@@ -0,0 +1,427 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type AppMemberListInp struct {
|
||||
form.PageReq
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
Mobile string `json:"mobile" dc:"手机号(精确查询)"`
|
||||
MemberStatus int `json:"memberStatus" dc:"会员状态"`
|
||||
AutoDispatch int `json:"autoDispatch" dc:"派单模式"`
|
||||
MemberCategory int `json:"memberCategory" dc:"会员类别"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"注册时间"`
|
||||
}
|
||||
|
||||
func (in *AppMemberListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
MemberNo string `json:"memberNo"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
RealNameMask string `json:"realNameMask"`
|
||||
AvailableAmount int64 `json:"availableAmount"`
|
||||
FrozenAmount int64 `json:"frozenAmount"`
|
||||
ParentId uint64 `json:"parentId"`
|
||||
ParentUsername string `json:"parentUsername"`
|
||||
InviteCode string `json:"inviteCode"`
|
||||
MemberStatus int `json:"memberStatus"`
|
||||
RiskStatus int `json:"riskStatus"`
|
||||
AutoDispatch int `json:"autoDispatch"`
|
||||
MemberCategory int `json:"memberCategory"`
|
||||
IsTestAccount int `json:"isTestAccount"`
|
||||
LastLoginAt *gtime.Time `json:"lastLoginAt"`
|
||||
LastLoginIpMask string `json:"lastLoginIpMask"`
|
||||
LastLoginRegion string `json:"lastLoginRegion"`
|
||||
TodayTradeCount int `json:"todayTradeCount"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type AppMemberViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberViewModel struct {
|
||||
AppMemberListModel
|
||||
LevelId uint64 `json:"levelId"`
|
||||
Level int `json:"level"`
|
||||
CreditScore int `json:"creditScore"`
|
||||
KycStatus int `json:"kycStatus"`
|
||||
IdNoMask string `json:"idNoMask"`
|
||||
PaymentAccountCount int `json:"paymentAccountCount"`
|
||||
AddressCount int `json:"addressCount"`
|
||||
TeamCount int `json:"teamCount"`
|
||||
}
|
||||
|
||||
type AppMemberEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
Username string `json:"username" v:"required|length:3,64#用户名不能为空|用户名长度为3到64个字符"`
|
||||
Mobile string `json:"mobile" v:"phone-loose#手机号格式不正确"`
|
||||
Password string `json:"password"`
|
||||
TradePassword string `json:"tradePassword"`
|
||||
RealName string `json:"realName" v:"max-length:64#姓名不能超过64个字符"`
|
||||
IdNo string `json:"idNo" v:"max-length:32#证件号不能超过32个字符"`
|
||||
ParentId uint64 `json:"parentId"`
|
||||
LevelId uint64 `json:"levelId"`
|
||||
RiskStatus int `json:"riskStatus" d:"1"`
|
||||
CreditScore int `json:"creditScore" d:"100" v:"between:0,1000#信用分范围为0到1000"`
|
||||
AutoDispatch int `json:"autoDispatch" d:"2"`
|
||||
MemberCategory int `json:"memberCategory"`
|
||||
IsTestAccount int `json:"isTestAccount"`
|
||||
}
|
||||
|
||||
func (in *AppMemberEditInp) Filter(ctx context.Context) error {
|
||||
if in.Id == 0 && strings.TrimSpace(in.Mobile) == "" {
|
||||
return gerror.New("新增会员时手机号不能为空")
|
||||
}
|
||||
if in.Id == 0 && len(in.Password) < 8 {
|
||||
return gerror.New("新增会员密码不能少于8位")
|
||||
}
|
||||
if in.Password != "" && (len(in.Password) < 8 || !containsLetterAndNumber(in.Password)) {
|
||||
return gerror.New("密码至少8位且必须同时包含字母和数字")
|
||||
}
|
||||
if in.TradePassword != "" && len(in.TradePassword) < 6 {
|
||||
return gerror.New("交易密码不能少于6位")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.AppMemberRiskStatusOptions, in.RiskStatus) {
|
||||
return gerror.New("风控状态不合法")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.AppMemberDispatchModeOptions, in.AutoDispatch) {
|
||||
return gerror.New("派单模式不合法")
|
||||
}
|
||||
if in.MemberCategory == 0 {
|
||||
if in.IsTestAccount == 1 {
|
||||
in.MemberCategory = consts.AppMemberCategoryFake
|
||||
} else {
|
||||
in.MemberCategory = consts.AppMemberCategoryReal
|
||||
}
|
||||
}
|
||||
if !dict.HasOptionKey(consts.AppMemberCategoryOptions, in.MemberCategory) {
|
||||
return gerror.New("会员类别不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func containsLetterAndNumber(value string) bool {
|
||||
letter, number := false, false
|
||||
for _, r := range value {
|
||||
if r >= '0' && r <= '9' {
|
||||
number = true
|
||||
}
|
||||
if (r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') {
|
||||
letter = true
|
||||
}
|
||||
}
|
||||
return letter && number
|
||||
}
|
||||
|
||||
type AppMemberDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#注销原因不能为空|注销原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *AppMemberDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberAutoDispatchInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
AutoDispatch int `json:"autoDispatch" v:"required|in:1,2#派单模式不能为空|派单模式不合法"`
|
||||
}
|
||||
|
||||
func (in *AppMemberAutoDispatchInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberCategoryInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
MemberCategory int `json:"memberCategory" v:"required#会员类别不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberCategoryInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.AppMemberCategoryOptions, in.MemberCategory) {
|
||||
return gerror.New("会员类别不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AppMemberPaymentListInp struct {
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberPaymentListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberPaymentModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
AccountType int `json:"accountType"`
|
||||
BankCode string `json:"bankCode"`
|
||||
BankName string `json:"bankName"`
|
||||
HolderMask string `json:"holderMask"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
AccountNoMask string `json:"accountNoMask"`
|
||||
QrAttachmentId uint64 `json:"qrAttachmentId"`
|
||||
VerifyStatus int `json:"verifyStatus"`
|
||||
IsDefault int `json:"isDefault"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
type AppMemberPaymentEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
AccountType int `json:"accountType" v:"required#账户类型不能为空"`
|
||||
BankCode string `json:"bankCode" v:"max-length:32#银行编码不能超过32个字符"`
|
||||
BankName string `json:"bankName" v:"max-length:100#银行名称不能超过100个字符"`
|
||||
Holder string `json:"holder"`
|
||||
Mobile string `json:"mobile" v:"phone-loose#手机号格式不正确"`
|
||||
AccountNo string `json:"accountNo"`
|
||||
QrAttachmentId uint64 `json:"qrAttachmentId"`
|
||||
VerifyStatus int `json:"verifyStatus" d:"1"`
|
||||
IsDefault int `json:"isDefault" d:"2"`
|
||||
}
|
||||
|
||||
func (in *AppMemberPaymentEditInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.PaymentAccountTypeOptions, in.AccountType) {
|
||||
return gerror.New("收款账户类型不合法")
|
||||
}
|
||||
if in.Id == 0 && (strings.TrimSpace(in.Holder) == "" || strings.TrimSpace(in.AccountNo) == "") {
|
||||
return gerror.New("新增收款账户时持有人和账号不能为空")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AppMemberPaymentDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#账户ID不能为空|账户ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberPaymentDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberAddressListInp struct {
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberAddressListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberAddressModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
ReceiverMask string `json:"receiverMask"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
Province string `json:"province"`
|
||||
City string `json:"city"`
|
||||
District string `json:"district"`
|
||||
AddressMask string `json:"addressMask"`
|
||||
IsDefault int `json:"isDefault"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
}
|
||||
type AppMemberAddressEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
Receiver string `json:"receiver"`
|
||||
Mobile string `json:"mobile" v:"phone-loose#手机号格式不正确"`
|
||||
Province string `json:"province"`
|
||||
City string `json:"city"`
|
||||
District string `json:"district"`
|
||||
Address string `json:"address"`
|
||||
IsDefault int `json:"isDefault" d:"2"`
|
||||
}
|
||||
|
||||
func (in *AppMemberAddressEditInp) Filter(ctx context.Context) error {
|
||||
if in.Id == 0 && (strings.TrimSpace(in.Receiver) == "" || strings.TrimSpace(in.Mobile) == "" || strings.TrimSpace(in.Address) == "") {
|
||||
return gerror.New("新增地址时收货人、手机号和详细地址不能为空")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AppMemberAddressDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#地址ID不能为空|地址ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberAddressDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberSensitiveInp struct {
|
||||
TargetType string `json:"targetType" v:"required|in:member,payment,address#目标类型不能为空|目标类型不合法"`
|
||||
TargetId uint64 `json:"targetId" v:"required|min:1#目标ID不能为空|目标ID不能为空"`
|
||||
PurposeCode string `json:"purposeCode" v:"required|max-length:64#用途编码不能为空|用途编码不能超过64个字符"`
|
||||
PurposeText string `json:"purposeText" v:"required|max-length:500#用途说明不能为空|用途说明不能超过500个字符"`
|
||||
Confirm bool `json:"confirm" v:"required#必须确认敏感信息查看"`
|
||||
}
|
||||
|
||||
func (in *AppMemberSensitiveInp) Filter(ctx context.Context) error {
|
||||
if !in.Confirm {
|
||||
return gerror.New("请确认本次敏感信息查看")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AppMemberSensitiveModel struct {
|
||||
Fields map[string]string `json:"fields"`
|
||||
AccessNo string `json:"accessNo"`
|
||||
}
|
||||
|
||||
type AppMemberTeamInp struct {
|
||||
form.PageReq
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
MaxLevel int `json:"maxLevel" d:"3" v:"between:1,10#团队层级范围为1到10"`
|
||||
}
|
||||
|
||||
func (in *AppMemberTeamInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberTeamModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
ParentId uint64 `json:"parentId"`
|
||||
RelativeLevel int `json:"relativeLevel"`
|
||||
TeamCount int `json:"teamCount"`
|
||||
AvailableAmount int64 `json:"availableAmount"`
|
||||
FrozenAmount int64 `json:"frozenAmount"`
|
||||
MemberStatus int `json:"memberStatus"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type AppMemberStatusRequestInp struct {
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
ToStatus int `json:"toStatus" v:"required#目标状态不能为空"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码不能超过64个字符"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#原因说明不能为空|原因说明不能超过500个字符"`
|
||||
ExpireAt *gtime.Time `json:"expireAt"`
|
||||
}
|
||||
|
||||
func (in *AppMemberStatusRequestInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.AppMemberStatusOptions, in.ToStatus) {
|
||||
return gerror.New("目标状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AppMemberStatusExecuteInp struct {
|
||||
ApprovalId uint64 `json:"approvalId" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *AppMemberStatusExecuteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type AppMemberApprovalModel struct {
|
||||
ApprovalId uint64 `json:"approvalId"`
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
}
|
||||
|
||||
type WalletAdjustmentListInp struct {
|
||||
form.PageReq
|
||||
MemberId uint64 `json:"memberId"`
|
||||
RequestStatus int `json:"requestStatus"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *WalletAdjustmentListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WalletLedgerListInp struct {
|
||||
form.PageReq
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *WalletLedgerListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WalletLedgerListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
LedgerNo string `json:"ledgerNo"`
|
||||
BizType string `json:"bizType"`
|
||||
BizNo string `json:"bizNo"`
|
||||
EntryType string `json:"entryType"`
|
||||
Direction int `json:"direction"`
|
||||
Amount int64 `json:"amount"`
|
||||
BeforeAmount int64 `json:"beforeAmount"`
|
||||
AfterAmount int64 `json:"afterAmount"`
|
||||
Currency string `json:"currency"`
|
||||
Remark string `json:"remark"`
|
||||
OccurredAt *gtime.Time `json:"occurredAt"`
|
||||
}
|
||||
|
||||
type WalletAdjustmentListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
RequestNo string `json:"requestNo"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
AdjustType int `json:"adjustType"`
|
||||
Direction int `json:"direction"`
|
||||
Amount int64 `json:"amount"`
|
||||
ReasonCode string `json:"reasonCode"`
|
||||
ReasonText string `json:"reasonText"`
|
||||
RequestStatus int `json:"requestStatus"`
|
||||
ApprovalRequestId uint64 `json:"approvalRequestId"`
|
||||
LedgerId uint64 `json:"ledgerId"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
type WalletAdjustmentRequestInp struct {
|
||||
MemberId uint64 `json:"memberId" v:"required|min:1#会员ID不能为空|会员ID不能为空"`
|
||||
AdjustType int `json:"adjustType" v:"required#调整类型不能为空"`
|
||||
Direction int `json:"direction" v:"required#资金方向不能为空"`
|
||||
Amount int64 `json:"amount" v:"required|min:1#金额不能为空|金额必须大于0"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码不能超过64个字符"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#原因说明不能为空|原因说明不能超过500个字符"`
|
||||
EvidenceJson *gjson.Json `json:"evidenceJson"`
|
||||
IdempotencyKey string `json:"idempotencyKey" v:"required|max-length:80#幂等键不能为空|幂等键不能超过80个字符"`
|
||||
}
|
||||
|
||||
func (in *WalletAdjustmentRequestInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.WalletAdjustTypeOptions, in.AdjustType) || !dict.HasOptionKey(consts.WalletDirectionOptions, in.Direction) {
|
||||
return gerror.New("调整类型或资金方向不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type WalletAdjustmentExecuteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#调账申请ID不能为空|调账申请ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *WalletAdjustmentExecuteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberNoticeListInp struct {
|
||||
form.PageReq
|
||||
Title string `json:"title"`
|
||||
SourceType int `json:"sourceType"`
|
||||
NoticeStatus int `json:"noticeStatus"`
|
||||
}
|
||||
|
||||
func (in *MemberNoticeListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberNoticeListModel struct {
|
||||
entity.AppMemberNotice
|
||||
Username string `json:"username"`
|
||||
}
|
||||
type MemberNoticeEditInp struct {
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Title string `json:"title" v:"required|max-length:120#标题不能为空|标题不能超过120个字符"`
|
||||
Content string `json:"content" v:"required|max-length:500#内容不能为空|内容不能超过500个字符"`
|
||||
SourceType int `json:"sourceType" v:"required#来源不能为空"`
|
||||
StartAt *gtime.Time `json:"startAt" v:"required#开始时间不能为空"`
|
||||
EndAt *gtime.Time `json:"endAt" v:"required#结束时间不能为空"`
|
||||
}
|
||||
|
||||
func (in *MemberNoticeEditInp) Filter(ctx context.Context) error {
|
||||
if in.StartAt.After(in.EndAt) {
|
||||
return gerror.New("结束时间必须晚于开始时间")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.MemberNoticeSourceOptions, in.SourceType) {
|
||||
return gerror.New("通知来源不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemberNoticeRevokeInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#通知ID不能为空|通知ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#撤回原因不能为空|撤回原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *MemberNoticeRevokeInp) Filter(ctx context.Context) error { return nil }
|
||||
@@ -0,0 +1,137 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type ApprovalRequestInsertFields struct {
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
ApprovalType string `json:"approvalType"`
|
||||
TargetType string `json:"targetType"`
|
||||
TargetId uint64 `json:"targetId"`
|
||||
Action string `json:"action"`
|
||||
Title string `json:"title"`
|
||||
PayloadJson *gjson.Json `json:"payloadJson"`
|
||||
DiffJson *gjson.Json `json:"diffJson"`
|
||||
RiskLevel int `json:"riskLevel"`
|
||||
RequiredApprovals uint `json:"requiredApprovals"`
|
||||
ApprovalStatus int `json:"approvalStatus"`
|
||||
ApplicantId uint64 `json:"applicantId"`
|
||||
ExpireAt *gtime.Time `json:"expireAt"`
|
||||
Version uint `json:"version"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedBy uint64 `json:"createdBy"`
|
||||
}
|
||||
|
||||
type ApprovalCreateInp struct {
|
||||
ApprovalType string `json:"approvalType" v:"required|max-length:32#审批类型不能为空|审批类型不能超过32个字符" dc:"审批类型"`
|
||||
TargetType string `json:"targetType" v:"required|max-length:32#目标类型不能为空|目标类型不能超过32个字符" dc:"目标类型"`
|
||||
TargetId uint64 `json:"targetId" dc:"目标ID"`
|
||||
Action string `json:"action" v:"required|max-length:64#拟执行动作不能为空|拟执行动作不能超过64个字符" dc:"拟执行动作"`
|
||||
Title string `json:"title" v:"required|max-length:200#审批标题不能为空|审批标题不能超过200个字符" dc:"审批标题"`
|
||||
PayloadJson *gjson.Json `json:"payloadJson" v:"required#待执行数据不能为空" dc:"待执行数据快照"`
|
||||
DiffJson *gjson.Json `json:"diffJson" dc:"前后差异"`
|
||||
RiskLevel int `json:"riskLevel" d:"1" dc:"风险等级"`
|
||||
RequiredApprovals uint `json:"requiredApprovals" d:"1" v:"min:1|max:10#至少需要1人审批|审批人数不能超过10人" dc:"需要通过数"`
|
||||
ExpireAt *gtime.Time `json:"expireAt" dc:"超时时间"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注不能超过500个字符" dc:"备注"`
|
||||
}
|
||||
|
||||
func (in *ApprovalCreateInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.ApprovalRiskLevelOptions, in.RiskLevel) {
|
||||
return gerror.New("审批风险等级不合法")
|
||||
}
|
||||
if in.ExpireAt != nil && in.ExpireAt.Before(gtime.Now()) {
|
||||
return gerror.New("审批超时时间必须晚于当前时间")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ApprovalCreateModel struct {
|
||||
Id uint64 `json:"id" dc:"审批ID"`
|
||||
ApprovalNo string `json:"approvalNo" dc:"审批单号"`
|
||||
}
|
||||
|
||||
type ApprovalListInp struct {
|
||||
form.PageReq
|
||||
ApprovalNo string `json:"approvalNo" dc:"审批单号"`
|
||||
ApprovalType string `json:"approvalType" dc:"审批类型"`
|
||||
TargetType string `json:"targetType" dc:"目标类型"`
|
||||
TargetId uint64 `json:"targetId" dc:"目标ID"`
|
||||
ApprovalStatus int `json:"approvalStatus" dc:"审批状态"`
|
||||
RiskLevel int `json:"riskLevel" dc:"风险等级"`
|
||||
Applicant string `json:"applicant" dc:"申请人关键词"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *ApprovalListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ApprovalListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
ApprovalType string `json:"approvalType"`
|
||||
TargetType string `json:"targetType"`
|
||||
TargetId uint64 `json:"targetId"`
|
||||
Action string `json:"action"`
|
||||
Title string `json:"title"`
|
||||
RiskLevel int `json:"riskLevel"`
|
||||
RequiredApprovals uint `json:"requiredApprovals"`
|
||||
ApprovalStatus int `json:"approvalStatus"`
|
||||
ApplicantId uint64 `json:"applicantId"`
|
||||
SubmittedAt *gtime.Time `json:"submittedAt"`
|
||||
DecidedAt *gtime.Time `json:"decidedAt"`
|
||||
ExpireAt *gtime.Time `json:"expireAt"`
|
||||
Version uint `json:"version"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
AllowedActions []string `json:"allowedActions" dc:"当前用户可执行动作"`
|
||||
}
|
||||
|
||||
type ApprovalViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#审批ID不能为空|审批ID不能为空" dc:"审批ID"`
|
||||
}
|
||||
|
||||
func (in *ApprovalViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ApprovalActionModel struct {
|
||||
entity.ApprovalAction
|
||||
}
|
||||
|
||||
type ApprovalViewModel struct {
|
||||
entity.ApprovalRequest
|
||||
Actions []*ApprovalActionModel `json:"actions" dc:"审批记录"`
|
||||
AllowedActions []string `json:"allowedActions" dc:"当前用户可执行动作"`
|
||||
}
|
||||
|
||||
type ApprovalSubmitInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
Version uint `json:"version" dc:"数据版本"`
|
||||
}
|
||||
|
||||
func (in *ApprovalSubmitInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ApprovalDecisionInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
Version uint `json:"version" dc:"数据版本"`
|
||||
ReasonCode string `json:"reasonCode" v:"max-length:64#原因编码不能超过64个字符" dc:"原因编码"`
|
||||
Comment string `json:"comment" v:"max-length:1000#审批意见不能超过1000个字符" dc:"审批意见"`
|
||||
MfaVerified int `json:"mfaVerified" dc:"是否已二次认证"`
|
||||
}
|
||||
|
||||
func (in *ApprovalDecisionInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ApprovalCancelInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
Version uint `json:"version" dc:"数据版本"`
|
||||
Comment string `json:"comment" v:"max-length:1000#取消原因不能超过1000个字符" dc:"取消原因"`
|
||||
}
|
||||
|
||||
func (in *ApprovalCancelInp) Filter(ctx context.Context) error { return nil }
|
||||
@@ -0,0 +1,106 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/library/storager"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// AttachmentDeleteInp 删除附件
|
||||
type AttachmentDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
|
||||
}
|
||||
|
||||
type AttachmentDeleteModel struct{}
|
||||
|
||||
// AttachmentViewInp 获取附件信息
|
||||
type AttachmentViewInp struct {
|
||||
Id int64 `json:"id" v:"required#附件ID不能为空" dc:"附件ID"`
|
||||
}
|
||||
|
||||
type AttachmentViewModel struct {
|
||||
entity.SysAttachment
|
||||
}
|
||||
|
||||
// AttachmentClearKindInp 清空上传类型
|
||||
type AttachmentClearKindInp struct {
|
||||
Kind string `json:"kind" v:"required#上传类型不能为空" dc:"上传类型"`
|
||||
}
|
||||
|
||||
func (in *AttachmentClearKindInp) Filter(ctx context.Context) (err error) {
|
||||
if !validate.InSlice(storager.KindSlice, in.Kind) {
|
||||
err = gerror.New("上传类型是无效的")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// AttachmentListInp 获取附件列表
|
||||
type AttachmentListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
MemberId int64 `json:"member_id" dc:"用户ID"`
|
||||
Name string `json:"name" dc:"文件名称"`
|
||||
Drive string `json:"drive" dc:"驱动"`
|
||||
Kind string `json:"kind" dc:"上传类型"`
|
||||
UpdatedAt []*gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
type AttachmentListModel struct {
|
||||
entity.SysAttachment
|
||||
SizeFormat string `json:"sizeFormat" dc:"大小"`
|
||||
}
|
||||
|
||||
// AttachmentChooserListInp 获取附件列表
|
||||
type AttachmentChooserListInp struct {
|
||||
form.PageReq
|
||||
Drive string `json:"drive" dc:"驱动"`
|
||||
Kind string `json:"kind" dc:"上传类型"`
|
||||
UpdatedAt []int64 `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
type AttachmentChooserListModel struct {
|
||||
entity.SysAttachment
|
||||
SizeFormat string `json:"sizeFormat" dc:"大小"`
|
||||
}
|
||||
|
||||
// AttachmentClearInp 清空分类
|
||||
type AttachmentClearInp struct {
|
||||
Kind string `json:"kind" dc:"上传类型"`
|
||||
}
|
||||
|
||||
// CheckMultipartInp 检查文件分片
|
||||
type CheckMultipartInp struct {
|
||||
*storager.CheckMultipartParams
|
||||
}
|
||||
|
||||
type CheckMultipartModel struct {
|
||||
*storager.CheckMultipartModel
|
||||
}
|
||||
|
||||
// UploadPartInp 上传分片
|
||||
type UploadPartInp struct {
|
||||
*storager.UploadPartParams
|
||||
}
|
||||
|
||||
type UploadPartModel struct {
|
||||
*storager.UploadPartModel
|
||||
}
|
||||
|
||||
// ImageTransferStorageInp 图片链接转存
|
||||
type ImageTransferStorageInp struct {
|
||||
Url string `json:"url" v:"required#图片链接不能为空" dc:"图片链接"`
|
||||
}
|
||||
|
||||
type ImageTransferStorageModel struct {
|
||||
*AttachmentListModel
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type BizAuditRecordInp struct {
|
||||
Module string
|
||||
Action string
|
||||
TargetType string
|
||||
TargetId uint64
|
||||
Before any
|
||||
After any
|
||||
ChangeJson *gjson.Json
|
||||
Reason string
|
||||
ApprovalNo string
|
||||
}
|
||||
|
||||
type BizAuditListInp struct {
|
||||
form.PageReq
|
||||
AuditNo string `json:"auditNo" dc:"审计号"`
|
||||
Module string `json:"module" dc:"业务模块"`
|
||||
Action string `json:"action" dc:"操作动作"`
|
||||
TargetType string `json:"targetType" dc:"目标类型"`
|
||||
TargetId uint64 `json:"targetId" dc:"目标ID"`
|
||||
Actor string `json:"actor" dc:"操作人关键词"`
|
||||
ApprovalNo string `json:"approvalNo" dc:"审批单号"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *BizAuditListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BizAuditListModel struct {
|
||||
entity.BizAuditLog
|
||||
}
|
||||
|
||||
type BizAuditViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#审计ID不能为空|审计ID不能为空" dc:"审计ID"`
|
||||
}
|
||||
|
||||
func (in *BizAuditViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BizAuditViewModel struct {
|
||||
entity.BizAuditLog
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// BlacklistEditInp 修改/新增黑名单数据
|
||||
type BlacklistEditInp struct {
|
||||
entity.SysBlacklist
|
||||
}
|
||||
|
||||
type BlacklistEditModel struct{}
|
||||
|
||||
// BlacklistDeleteInp 删除黑名单类型
|
||||
type BlacklistDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
|
||||
}
|
||||
|
||||
type BlacklistDeleteModel struct{}
|
||||
|
||||
// BlacklistViewInp 获取信息
|
||||
type BlacklistViewInp struct {
|
||||
Id int64 `json:"id" v:"required#黑名单ID不能为空" dc:"黑名单ID"`
|
||||
}
|
||||
|
||||
type BlacklistViewModel struct {
|
||||
entity.SysBlacklist
|
||||
}
|
||||
|
||||
// BlacklistListInp 获取列表
|
||||
type BlacklistListInp struct {
|
||||
form.PageReq
|
||||
|
||||
form.StatusReq
|
||||
Ip string `json:"ip" dc:"IP"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *BlacklistListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type BlacklistListModel struct {
|
||||
entity.SysBlacklist
|
||||
}
|
||||
|
||||
// BlacklistStatusInp 更新状态
|
||||
type BlacklistStatusInp struct {
|
||||
entity.SysBlacklist
|
||||
}
|
||||
|
||||
func (in *BlacklistStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type BlacklistStatusModel struct{}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// UpdateConfigInp 更新指定分组的配置
|
||||
type UpdateConfigInp struct {
|
||||
Group string `json:"group"`
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
|
||||
// GetConfigInp 获取指定分组的配置
|
||||
type GetConfigInp struct {
|
||||
Group string `json:"group"`
|
||||
}
|
||||
|
||||
type GetConfigModel struct {
|
||||
List g.Map `json:"list"`
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"hotgo/internal/library/cron"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// CronMaxSortInp 最大排序
|
||||
type CronMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type CronMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// CronEditInp 修改/新增
|
||||
type CronEditInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type CronEditModel struct{}
|
||||
|
||||
// CronDeleteInp 删除
|
||||
type CronDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type CronDeleteModel struct{}
|
||||
|
||||
// CronViewInp 获取信息
|
||||
type CronViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type CronViewModel struct {
|
||||
entity.SysCron
|
||||
}
|
||||
|
||||
// CronListInp 获取列表
|
||||
type CronListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
GroupId int64 `json:"groupId" description:"分组ID"`
|
||||
Name string `json:"name" description:"任务名称"`
|
||||
}
|
||||
|
||||
type CronListModel struct {
|
||||
entity.SysCron
|
||||
GroupName string `json:"groupName"`
|
||||
}
|
||||
|
||||
// CronStatusInp 更新状态
|
||||
type CronStatusInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type CronStatusModel struct{}
|
||||
|
||||
// OnlineExecInp 在线执行
|
||||
type OnlineExecInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type OnlineExecModel struct{}
|
||||
|
||||
// DispatchLogInp 查看指定任务的调度日志
|
||||
type DispatchLogInp struct {
|
||||
entity.SysCron
|
||||
}
|
||||
type DispatchLogModel struct {
|
||||
*cron.Log
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// CronGroupMaxSortInp 最大排序
|
||||
type CronGroupMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type CronGroupMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// CronGroupEditInp 修改/新增字典数据
|
||||
type CronGroupEditInp struct {
|
||||
entity.SysCronGroup
|
||||
}
|
||||
|
||||
func (in *CronGroupEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("名称不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Id > 0 && in.Id == in.Pid {
|
||||
err = gerror.New("上级分组不能是自己")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type CronGroupEditModel struct{}
|
||||
|
||||
// CronGroupUpdateFields 修改数据字段过滤
|
||||
type CronGroupUpdateFields struct {
|
||||
Id int64 `json:"id" description:"任务分组ID"`
|
||||
Pid int64 `json:"pid" description:"父类字典类型ID"`
|
||||
Name string `json:"name" description:"字典类型名称"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"字典类型状态"`
|
||||
}
|
||||
|
||||
// CronGroupInsertFields 新增数据字段过滤
|
||||
type CronGroupInsertFields struct {
|
||||
Pid int64 `json:"pid" description:"父类任务分组ID"`
|
||||
Name string `json:"name" description:"分组名称"`
|
||||
IsDefault int `json:"isDefault" description:"是否默认"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"分组状态"`
|
||||
}
|
||||
|
||||
// CronGroupDeleteInp 删除字典类型
|
||||
type CronGroupDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type CronGroupDeleteModel struct{}
|
||||
|
||||
// CronGroupViewInp 获取信息
|
||||
type CronGroupViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type CronGroupViewModel struct {
|
||||
entity.SysCronGroup
|
||||
}
|
||||
|
||||
// CronGroupListInp 获取列表
|
||||
type CronGroupListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
Name string
|
||||
}
|
||||
|
||||
type CronGroupListModel struct {
|
||||
entity.SysCronGroup
|
||||
SupName string `json:"supName" description:"上级分组名称"`
|
||||
}
|
||||
|
||||
// CronGroupStatusInp 更新状态
|
||||
type CronGroupStatusInp struct {
|
||||
entity.SysCronGroup
|
||||
}
|
||||
|
||||
func (in *CronGroupStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type CronGroupStatusModel struct{}
|
||||
|
||||
// CronGroupSelectInp 选项
|
||||
type CronGroupSelectInp struct {
|
||||
}
|
||||
|
||||
type CronGroupSelectModel struct {
|
||||
List []*CronGroupTree `json:"list"`
|
||||
}
|
||||
|
||||
type CronGroupTree struct {
|
||||
entity.SysCronGroup
|
||||
Disabled bool `json:"disabled" dc:"是否禁用"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Key int64 `json:"key" dc:"键名"`
|
||||
Children []*CronGroupTree `json:"children" dc:"子级"`
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.18.6
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/hgorm/hook"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// CurdDemoUpdateFields 修改CURD列表字段过滤
|
||||
type CurdDemoUpdateFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Content string `json:"content" dc:"内容"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
CityId int64 `json:"cityId" dc:"所在城市"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
||||
}
|
||||
|
||||
// CurdDemoInsertFields 新增CURD列表字段过滤
|
||||
type CurdDemoInsertFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Content string `json:"content" dc:"内容"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
CityId int64 `json:"cityId" dc:"所在城市"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
}
|
||||
|
||||
// CurdDemoEditInp 修改/新增CURD列表
|
||||
type CurdDemoEditInp struct {
|
||||
entity.SysGenCurdDemo
|
||||
}
|
||||
|
||||
func (in *CurdDemoEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证标题
|
||||
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
// 验证描述
|
||||
if err := g.Validator().Rules("required").Data(in.Description).Messages("描述不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
// 验证内容
|
||||
if err := g.Validator().Rules("required").Data(in.Content).Messages("内容不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
// 验证排序
|
||||
if err := g.Validator().Rules("required").Data(in.Sort).Messages("排序不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoEditModel struct{}
|
||||
|
||||
// CurdDemoDeleteInp 删除CURD列表
|
||||
type CurdDemoDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoDeleteModel struct{}
|
||||
|
||||
// CurdDemoViewInp 获取指定CURD列表信息
|
||||
type CurdDemoViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoViewModel struct {
|
||||
entity.SysGenCurdDemo
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
|
||||
DeletedBySumma *hook.MemberSumma `json:"deletedBySumma" dc:"删除者摘要信息"`
|
||||
}
|
||||
|
||||
// CurdDemoListInp 获取CURD列表列表
|
||||
type CurdDemoListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
CreatedBy string `json:"createdBy" dc:"创建者"`
|
||||
DeletedBy string `json:"deletedBy" dc:"删除者"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoListModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
||||
UpdatedBySumma *hook.MemberSumma `json:"updatedBySumma" dc:"更新者摘要信息"`
|
||||
DeletedBy int64 `json:"deletedBy" dc:"删除者"`
|
||||
DeletedBySumma *hook.MemberSumma `json:"deletedBySumma" dc:"删除者摘要信息"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
|
||||
}
|
||||
|
||||
// CurdDemoExportModel 导出CURD列表
|
||||
type CurdDemoExportModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Image string `json:"image" dc:"单图"`
|
||||
Attachfile string `json:"attachfile" dc:"附件"`
|
||||
CityId int64 `json:"cityId" dc:"所在城市"`
|
||||
Switch int `json:"switch" dc:"显示开关"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
||||
DeletedBy int64 `json:"deletedBy" dc:"删除者"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
TestCategoryName string `json:"testCategoryName" dc:"关联分类"`
|
||||
}
|
||||
|
||||
// CurdDemoMaxSortInp 获取CURD列表最大排序
|
||||
type CurdDemoMaxSortInp struct{}
|
||||
|
||||
func (in *CurdDemoMaxSortInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// CurdDemoStatusInp 更新CURD列表状态
|
||||
type CurdDemoStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoStatusModel struct{}
|
||||
|
||||
// CurdDemoSwitchInp 更新CURD列表开关状态
|
||||
type CurdDemoSwitchInp struct {
|
||||
form.SwitchReq
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *CurdDemoSwitchInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type CurdDemoSwitchModel struct{}
|
||||
@@ -0,0 +1,80 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type DashboardSummaryInp struct {
|
||||
StartDate *gtime.Time `json:"startDate" dc:"开始日期"`
|
||||
EndDate *gtime.Time `json:"endDate" dc:"结束日期"`
|
||||
}
|
||||
|
||||
func (in *DashboardSummaryInp) Filter(ctx context.Context) error {
|
||||
if in.StartDate == nil && in.EndDate == nil {
|
||||
return nil
|
||||
}
|
||||
if in.StartDate == nil || in.EndDate == nil {
|
||||
return gerror.New("开始日期和结束日期必须同时填写")
|
||||
}
|
||||
if in.StartDate.After(in.EndDate) {
|
||||
return gerror.New("开始日期不能晚于结束日期")
|
||||
}
|
||||
if in.EndDate.Sub(in.StartDate) > 366*24*60*60*1e9 {
|
||||
return gerror.New("单次最多查询366天")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DashboardRangeModel struct {
|
||||
StartDate string `json:"startDate"`
|
||||
EndDate string `json:"endDate"`
|
||||
}
|
||||
|
||||
type DashboardMetricModel struct {
|
||||
Code string `json:"code"`
|
||||
Title string `json:"title"`
|
||||
Value int64 `json:"value"`
|
||||
PreviousValue int64 `json:"previousValue"`
|
||||
ChangeRate float64 `json:"changeRate"`
|
||||
ValueType string `json:"valueType" dc:"count或amount"`
|
||||
Masked bool `json:"masked"`
|
||||
Description string `json:"description"`
|
||||
RouteName string `json:"routeName"`
|
||||
}
|
||||
|
||||
type DashboardTrendPointModel struct {
|
||||
Date string `json:"date"`
|
||||
OrderAmount int64 `json:"orderAmount"`
|
||||
RechargeAmount int64 `json:"rechargeAmount"`
|
||||
WithdrawalAmount int64 `json:"withdrawalAmount"`
|
||||
CommissionAmount int64 `json:"commissionAmount"`
|
||||
}
|
||||
|
||||
type DashboardChannelModel struct {
|
||||
Channel string `json:"channel"`
|
||||
Label string `json:"label"`
|
||||
RechargeCount int64 `json:"rechargeCount"`
|
||||
RechargeAmount int64 `json:"rechargeAmount"`
|
||||
WithdrawalCount int64 `json:"withdrawalCount"`
|
||||
WithdrawalAmount int64 `json:"withdrawalAmount"`
|
||||
PreviousRechargeCount int64 `json:"previousRechargeCount"`
|
||||
PreviousRechargeAmount int64 `json:"previousRechargeAmount"`
|
||||
PreviousWithdrawalCount int64 `json:"previousWithdrawalCount"`
|
||||
PreviousWithdrawalAmount int64 `json:"previousWithdrawalAmount"`
|
||||
Masked bool `json:"masked"`
|
||||
}
|
||||
|
||||
type DashboardSummaryModel struct {
|
||||
Range DashboardRangeModel `json:"range"`
|
||||
Metrics []*DashboardMetricModel `json:"metrics"`
|
||||
Trend []*DashboardTrendPointModel `json:"trend"`
|
||||
Channels []*DashboardChannelModel `json:"channels"`
|
||||
GeneratedAt *gtime.Time `json:"generatedAt"`
|
||||
DataAsOf *gtime.Time `json:"dataAsOf"`
|
||||
DataDelaySeconds int64 `json:"dataDelaySeconds"`
|
||||
DataReady bool `json:"dataReady"`
|
||||
Warning string `json:"warning"`
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// DictDataEditInp 修改/新增字典数据
|
||||
type DictDataEditInp struct {
|
||||
entity.SysDictData
|
||||
TypeID int64 `json:"typeID" dc:"字典类型ID"`
|
||||
}
|
||||
|
||||
func (in *DictDataEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Label == "" {
|
||||
err = gerror.New("字典标签不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Id > 0 && in.TypeID <= 0 {
|
||||
err = gerror.New("字典类型不能为空")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type DictDataEditModel struct{}
|
||||
|
||||
// DictDataUpdateFields 修改数据字段过滤
|
||||
type DictDataUpdateFields struct {
|
||||
Id int64 `json:"id" description:"字典数据ID"`
|
||||
Label string `json:"label" description:"字典标签"`
|
||||
Value string `json:"value" description:"字典键值"`
|
||||
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
ListClass string `json:"listClass" description:"表格回显样式"`
|
||||
IsDefault int `json:"isDefault" description:"是否为系统默认"`
|
||||
Sort int `json:"sort" description:"字典排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
}
|
||||
|
||||
// DictDataInsertFields 新增数据字段过滤
|
||||
type DictDataInsertFields struct {
|
||||
Label string `json:"label" description:"字典标签"`
|
||||
Value string `json:"value" description:"字典键值"`
|
||||
ValueType string `json:"valueType" description:"键值数据类型:string,int,uint,bool,datetime,date"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
ListClass string `json:"listClass" description:"表格回显样式"`
|
||||
IsDefault int `json:"isDefault" description:"是否为系统默认"`
|
||||
Sort int `json:"sort" description:"字典排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
}
|
||||
|
||||
// DictDataDeleteInp 删除字典数据
|
||||
type DictDataDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#字典数据ID不能为空" dc:"字典数据ID"`
|
||||
}
|
||||
|
||||
type DictDataDeleteModel struct{}
|
||||
|
||||
// DictDataListInp 获取列表
|
||||
type DictDataListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
TypeID int64 `json:"typeId" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
||||
Type string `json:"type" dc:"字典类型"`
|
||||
Label string `json:"label" dc:"字典标签"`
|
||||
Value string `json:"value" dc:"字典键值"`
|
||||
}
|
||||
|
||||
type DictDataListModel struct {
|
||||
TypeID int64 `json:"typeId"`
|
||||
Key string `json:"key"`
|
||||
entity.SysDictData
|
||||
}
|
||||
|
||||
// DataSelectInp 获取指定字典选项
|
||||
type DataSelectInp struct {
|
||||
Type string `in:"path" v:"required#字典类型不能为空" dc:"字典类型"`
|
||||
}
|
||||
|
||||
type DataSelectModel []*model.Option
|
||||
@@ -0,0 +1,76 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
)
|
||||
|
||||
// DictTypeEditInp 修改/新增字典数据
|
||||
type DictTypeEditInp struct {
|
||||
entity.SysDictType
|
||||
}
|
||||
|
||||
func (in *DictTypeEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Name == "" {
|
||||
err = gerror.New("名称不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Id > 0 && in.Id == in.Pid {
|
||||
err = gerror.New("上级字典不能是自己")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type DictTypeEditModel struct{}
|
||||
|
||||
// DictTypeUpdateFields 修改数据字段过滤
|
||||
type DictTypeUpdateFields struct {
|
||||
Id int64 `json:"id" description:"字典类型ID"`
|
||||
Pid int64 `json:"pid" description:"父类字典类型ID"`
|
||||
Name string `json:"name" description:"字典类型名称"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"字典类型状态"`
|
||||
}
|
||||
|
||||
// DictTypeInsertFields 新增数据字段过滤
|
||||
type DictTypeInsertFields struct {
|
||||
Pid int64 `json:"pid" description:"父类字典类型ID"`
|
||||
Name string `json:"name" description:"字典类型名称"`
|
||||
Type string `json:"type" description:"字典类型"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Remark string `json:"remark" description:"备注"`
|
||||
Status int `json:"status" description:"字典类型状态"`
|
||||
}
|
||||
|
||||
// DictTypeDeleteInp 删除字典类型
|
||||
type DictTypeDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#字典类型ID不能为空" dc:"字典类型ID"`
|
||||
}
|
||||
|
||||
type DictTypeDeleteModel struct{}
|
||||
|
||||
// DictTreeSelectInp 获取类型关系树选项
|
||||
type DictTreeSelectInp struct {
|
||||
}
|
||||
|
||||
type DictTreeSelectModel []g.Map
|
||||
|
||||
type DictTypeTree struct {
|
||||
entity.SysDictType
|
||||
Disabled bool `json:"disabled" dc:"是否禁用"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Key int64 `json:"key" dc:"键名"`
|
||||
Children []*DictTypeTree `json:"children" dc:"子级"`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// EmsLogEditInp 修改/新增数据
|
||||
type EmsLogEditInp struct {
|
||||
entity.SysEmsLog
|
||||
}
|
||||
|
||||
type EmsLogEditModel struct{}
|
||||
|
||||
// EmsLogDeleteInp 删除
|
||||
type EmsLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#邮件记录ID不能为空" dc:"邮件记录ID"`
|
||||
}
|
||||
|
||||
type EmsLogDeleteModel struct{}
|
||||
|
||||
// EmsLogViewInp 获取信息
|
||||
type EmsLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#邮件记录ID不能为空" dc:"邮件记录ID"`
|
||||
}
|
||||
|
||||
type EmsLogViewModel struct {
|
||||
entity.SysEmsLog
|
||||
}
|
||||
|
||||
// EmsLogListInp 获取列表
|
||||
type EmsLogListInp struct {
|
||||
form.PageReq
|
||||
|
||||
form.StatusReq
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type EmsLogListModel struct {
|
||||
entity.SysEmsLog
|
||||
}
|
||||
|
||||
// EmsLogStatusInp 更新状态
|
||||
type EmsLogStatusInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type EmsLogStatusModel struct{}
|
||||
|
||||
// SendEmsInp 发送邮件
|
||||
type SendEmsInp struct {
|
||||
Event string `json:"event" v:"required#邮件事件不能为空" description:"事件"`
|
||||
Email string `json:"email" v:"required#邮箱地址不能为空" description:"邮箱地址"`
|
||||
Code string `json:"code" description:"验证码或短信内容"`
|
||||
Content string `json:"content" description:"邮件内容"`
|
||||
Template string `json:"-" description:"发信模板"`
|
||||
TplData g.Map `json:"-" description:"模板变量"`
|
||||
}
|
||||
|
||||
// VerifyEmsCodeInp 效验验证码
|
||||
type VerifyEmsCodeInp struct {
|
||||
Event string `json:"event" v:"required#邮件事件不能为空" description:"事件"`
|
||||
Email string `json:"email" v:"required#邮箱地址不能为空" description:"邮箱地址"`
|
||||
Code string `json:"code" description:"验证码"`
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/text/gregex"
|
||||
"github.com/gogf/gf/v2/util/gconv"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// GenCodesMaxSortInp 最大排序
|
||||
type GenCodesMaxSortInp struct {
|
||||
Id int64 `json:"id" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesMaxSortModel struct {
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// GenCodesEditInp 修改/新增数据
|
||||
type GenCodesEditInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesEditInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
type GenCodesEditModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenCodesDeleteInp 删除
|
||||
type GenCodesDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesDeleteModel struct{}
|
||||
|
||||
// GenCodesViewInp 获取信息
|
||||
type GenCodesViewInp struct {
|
||||
Id int64 `json:"id" v:"required#生成代码ID不能为空" dc:"生成代码ID"`
|
||||
}
|
||||
|
||||
type GenCodesViewModel struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
// GenCodesListInp 获取列表
|
||||
type GenCodesListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
GenType int `json:"genType" dc:"生成类型"`
|
||||
VarName string `json:"varName" dc:"实体"`
|
||||
}
|
||||
|
||||
type GenCodesListModel struct {
|
||||
entity.SysGenCodes
|
||||
GenTemplateGroup string `json:"genTemplateGroup" dc:"生成模板组名"`
|
||||
}
|
||||
|
||||
// GenCodesStatusInp 更新状态
|
||||
type GenCodesStatusInp struct {
|
||||
Id int64 `json:"id" description:"生成ID"`
|
||||
Status int `json:"status" description:"生成状态"`
|
||||
}
|
||||
type GenCodesStatusModel struct{}
|
||||
|
||||
// GenCodesSelectsInp 选项
|
||||
type GenCodesSelectsInp struct {
|
||||
}
|
||||
|
||||
type GenCodesSelectsModel struct {
|
||||
GenType GenTypeSelects `json:"genType" dc:"生成类型"`
|
||||
Db form.Selects `json:"db" dc:"数据库选项"`
|
||||
Status form.Selects `json:"status" dc:"生成状态"`
|
||||
LinkMode form.Selects `json:"linkMode" dc:"关联表方式"`
|
||||
BuildMeth form.Selects `json:"buildMeth" dc:"生成方式"`
|
||||
// 字段表格选项
|
||||
FormMode form.Selects `json:"formMode" dc:"表单组件"`
|
||||
FormRole form.Selects `json:"formRole" dc:"表单验证"`
|
||||
DictMode []*DictTypeTree `json:"dictMode" dc:"字典类型"`
|
||||
WhereMode form.Selects `json:"whereMode" dc:"查询条件"`
|
||||
Addons form.Selects `json:"addons" dc:"插件选项"`
|
||||
TableAlign form.Selects `json:"tableAlign" dc:"表格排列方式"`
|
||||
TreeStyleType []*model.Option `json:"treeStyleType" dc:"树表样式选项"`
|
||||
}
|
||||
|
||||
type GenTypeSelects []*GenTypeSelect
|
||||
|
||||
type GenTypeSelect struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
Templates GenTemplateSelects `json:"templates"`
|
||||
}
|
||||
|
||||
type GenTemplateSelects []*GenTemplateSelect
|
||||
|
||||
type GenTemplateSelect struct {
|
||||
Value interface{} `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
IsAddon bool `json:"isAddon"`
|
||||
}
|
||||
|
||||
func (p GenTemplateSelects) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
|
||||
func (p GenTemplateSelects) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
|
||||
func (p GenTemplateSelects) Less(i, j int) bool {
|
||||
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
|
||||
}
|
||||
|
||||
func (p GenTypeSelects) Len() int {
|
||||
return len(p)
|
||||
}
|
||||
|
||||
func (p GenTypeSelects) Swap(i, j int) {
|
||||
p[i], p[j] = p[j], p[i]
|
||||
}
|
||||
|
||||
func (p GenTypeSelects) Less(i, j int) bool {
|
||||
return gconv.Int64(p[j].Value) > gconv.Int64(p[i].Value)
|
||||
}
|
||||
|
||||
// GenCodesTableSelectInp 数据库表选项
|
||||
type GenCodesTableSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
}
|
||||
|
||||
type GenCodesTableSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
DaoName string `json:"daoName" dc:"orm模型名称"`
|
||||
DefVarName string `json:"defVarName" dc:"默认实体名称"`
|
||||
DefAlias string `json:"defAlias" dc:"默认关联表别名"`
|
||||
DefTableComment string `json:"defTableComment" dc:"默认菜单名称"`
|
||||
}
|
||||
|
||||
// GenCodesColumnSelectInp 表字段选项
|
||||
type GenCodesColumnSelectInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
Table string `json:"table" dc:"表名称"`
|
||||
}
|
||||
|
||||
type GenCodesColumnSelectModel struct {
|
||||
Value string `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// GenCodesColumnListInp 表字段列表
|
||||
type GenCodesColumnListInp struct {
|
||||
Name string `json:"name" dc:"数据库配置名称"`
|
||||
Table string `json:"table" dc:"表名称"`
|
||||
IsLink int64 `json:"isLink" dc:"是否是关联表"`
|
||||
Alias string `json:"alias" dc:"关联表别名"`
|
||||
}
|
||||
|
||||
type GenCodesColumnListModel struct {
|
||||
model.GenCodesColumn
|
||||
}
|
||||
|
||||
// GenCodesPreviewInp 生成预览
|
||||
type GenCodesPreviewInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesPreviewInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
// GenFile 生成文件配置
|
||||
type GenFile struct {
|
||||
Content string `json:"content" dc:"页面内容"`
|
||||
Path string `json:"path" dc:"生成路径"`
|
||||
Meth int `json:"meth" dc:"生成方式"`
|
||||
Required bool `json:"required" dc:"是否是必要构建文件"`
|
||||
}
|
||||
|
||||
type GenCodesPreviewModel struct {
|
||||
Config *model.GenerateConfig `json:"config"`
|
||||
Views map[string]*GenFile `json:"views" dc:"页面"`
|
||||
}
|
||||
|
||||
// GenCodesBuildInp 提交生成
|
||||
type GenCodesBuildInp struct {
|
||||
entity.SysGenCodes
|
||||
}
|
||||
|
||||
func (in *GenCodesBuildInp) Filter(ctx context.Context) (err error) {
|
||||
return genFilter(ctx, in.SysGenCodes)
|
||||
}
|
||||
|
||||
func genFilter(ctx context.Context, in entity.SysGenCodes) (err error) {
|
||||
if in.VarName == "" {
|
||||
err = gerror.New("实体命名不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !gregex.IsMatchString(`^[a-zA-Z]{1}\w{1,23}$`, in.VarName) {
|
||||
err = gerror.New("实体命名格式不正确,字母开头,只能包含字母、数字和下划线,长度在2~24之间")
|
||||
return
|
||||
}
|
||||
|
||||
if in.GenType == consts.GenCodesTypeCurd || in.GenType == consts.GenCodesTypeTree {
|
||||
if in.DbName == "" {
|
||||
err = gerror.New("数据库不能为空")
|
||||
return
|
||||
}
|
||||
if in.TableName == "" {
|
||||
err = gerror.New("数据库表不能为空")
|
||||
return
|
||||
}
|
||||
if in.TableComment == "" {
|
||||
err = gerror.New("菜单名称不能为空")
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// LogListInp 获取菜单列表
|
||||
type LogListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
ReqId string `json:"reqId" dc:"对外ID"`
|
||||
Module string `json:"module" dc:"应用端口"`
|
||||
MemberId int `json:"memberId" dc:"用户ID"`
|
||||
TakeUpTime string `json:"takeUpTime" dc:"请求耗时"`
|
||||
Method string `json:"method" dc:"请求方式"`
|
||||
Url string `json:"url" dc:"请求路径"`
|
||||
Ip string `json:"ip" dc:"访问IP"`
|
||||
ErrorCode string `json:"errorCode" dc:"状态码"`
|
||||
CreatedAt []int64 `json:"createdAt" dc:"创建时间"`
|
||||
Keyword string `json:"keyword" dc:"关键词"`
|
||||
ComplexMemberId []string `json:"complexMemberId" dc:"操作人筛选"`
|
||||
}
|
||||
|
||||
type LogListModel struct {
|
||||
entity.SysLog
|
||||
MemberName string `json:"memberName"`
|
||||
Region string `json:"region"`
|
||||
CityLabel string `json:"cityLabel" dc:"城市标签"`
|
||||
Tags string `json:"tags" dc:"接口所属的标签,用于接口分类"`
|
||||
Summary string `json:"summary" dc:"接口/参数概要描述"`
|
||||
Description string `json:"description" dc:"接口/参数详细描述"`
|
||||
}
|
||||
|
||||
// LogViewInp 获取信息
|
||||
type LogViewInp struct {
|
||||
Id string `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
|
||||
}
|
||||
|
||||
type LogViewModel struct {
|
||||
entity.SysLog
|
||||
CityLabel string `json:"cityLabel" dc:"城市标签"`
|
||||
Tags string `json:"tags" dc:"接口所属的标签,用于接口分类"`
|
||||
Summary string `json:"summary" dc:"接口/参数概要描述"`
|
||||
Description string `json:"description" dc:"接口/参数详细描述"`
|
||||
}
|
||||
|
||||
// LogDeleteInp 删除
|
||||
type LogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" description:"日志ID"`
|
||||
}
|
||||
|
||||
type LogDeleteModel struct{}
|
||||
@@ -0,0 +1,79 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/adminin"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// LoginLogDeleteInp 删除登录日志
|
||||
type LoginLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type LoginLogDeleteModel struct{}
|
||||
|
||||
// LoginLogViewInp 获取指定登录日志信息
|
||||
type LoginLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type LoginLogViewModel struct {
|
||||
entity.SysLoginLog
|
||||
}
|
||||
|
||||
// LoginLogListInp 获取登录日志列表
|
||||
type LoginLogListInp struct {
|
||||
form.PageReq
|
||||
Username string `json:"username" dc:"用户名"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
LoginAt []*gtime.Time `json:"loginAt" dc:"登录时间"`
|
||||
LoginIp string `json:"loginIp" dc:"登录IP"`
|
||||
}
|
||||
|
||||
type LoginLogListModel struct {
|
||||
entity.SysLoginLog
|
||||
Os string `json:"os"`
|
||||
Browser string `json:"browser"`
|
||||
CityLabel string `json:"cityLabel"`
|
||||
SysLogId gdb.Value `json:"sysLogId"`
|
||||
}
|
||||
|
||||
func (in *LoginLogListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// LoginLogExportModel 导出登录日志
|
||||
type LoginLogExportModel struct {
|
||||
Id int64 `json:"id" orm:"id" description:"日志ID"`
|
||||
ReqId string `json:"reqId" orm:"req_id" description:"请求ID"`
|
||||
MemberId int64 `json:"memberId" orm:"member_id" description:"用户ID"`
|
||||
Username string `json:"username" orm:"username" description:"用户名"`
|
||||
Response *gjson.Json `json:"response" orm:"response" description:"响应数据"`
|
||||
LoginAt *gtime.Time `json:"loginAt" orm:"login_at" description:"登录时间"`
|
||||
LoginIp string `json:"loginIp" orm:"login_ip" description:"登录IP"`
|
||||
ProvinceId int64 `json:"provinceId" orm:"province_id" description:"省编码"`
|
||||
CityId int64 `json:"cityId" orm:"city_id" description:"市编码"`
|
||||
UserAgent string `json:"userAgent" orm:"user_agent" description:"UA信息"`
|
||||
ErrMsg string `json:"errMsg" orm:"err_msg" description:"错误提示"`
|
||||
Status int `json:"status" orm:"status" description:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"修改时间"`
|
||||
Os string `json:"os"`
|
||||
Browser string `json:"browser"`
|
||||
}
|
||||
|
||||
// LoginLogPushInp 解推送登录日志
|
||||
type LoginLogPushInp struct {
|
||||
Response *adminin.LoginModel
|
||||
Err error
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type MemberLevelListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
Status int `json:"status"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
LevelCode string `json:"levelCode"`
|
||||
Name string `json:"name"`
|
||||
IconUrl string `json:"iconUrl"`
|
||||
CurrentVersionId uint64 `json:"currentVersionId"`
|
||||
MemberCount uint64 `json:"memberCount"`
|
||||
Status int `json:"status"`
|
||||
Sort int `json:"sort"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
VersionNo uint `json:"versionNo"`
|
||||
UpgradeAmount int64 `json:"upgradeAmount"`
|
||||
GiftAmount int64 `json:"giftAmount"`
|
||||
DailyOrderLimit uint `json:"dailyOrderLimit"`
|
||||
CommissionRate uint `json:"commissionRate"`
|
||||
DailyWithdrawLimit uint `json:"dailyWithdrawLimit"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
EffectiveAt *gtime.Time `json:"effectiveAt"`
|
||||
}
|
||||
type MemberLevelViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#等级ID不能为空|等级ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelViewModel struct {
|
||||
Level *entity.AppMemberLevel `json:"level"`
|
||||
Draft *entity.AppMemberLevelVersion `json:"draft"`
|
||||
Published *entity.AppMemberLevelVersion `json:"published"`
|
||||
}
|
||||
type MemberLevelSaveInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
VersionId uint64 `json:"versionId"`
|
||||
Version uint `json:"version"`
|
||||
LevelCode string `json:"levelCode" v:"required|max-length:32#等级编码不能为空|等级编码不能超过32个字符"`
|
||||
Name string `json:"name" v:"required|max-length:64#等级名称不能为空|等级名称不能超过64个字符"`
|
||||
IconAttachmentId uint64 `json:"iconAttachmentId"`
|
||||
IconUrl string `json:"iconUrl" v:"max-length:1000#图标地址不能超过1000个字符"`
|
||||
UpgradeAmount int64 `json:"upgradeAmount" v:"min:0#升级金额不能小于0"`
|
||||
GiftAmount int64 `json:"giftAmount" v:"min:0#赠送金额不能小于0"`
|
||||
DailyOrderLimit uint `json:"dailyOrderLimit"`
|
||||
CommissionRate uint `json:"commissionRate" v:"max:10000#佣金比例不能超过100%"`
|
||||
DailyWithdrawLimit uint `json:"dailyWithdrawLimit"`
|
||||
RuleJson *gjson.Json `json:"ruleJson"`
|
||||
EffectiveAt *gtime.Time `json:"effectiveAt"`
|
||||
Sort int `json:"sort"`
|
||||
Status int `json:"status" d:"1"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelSaveInp) Filter(ctx context.Context) error {
|
||||
if in.Status != consts.StatusEnabled && in.Status != consts.StatusDisable {
|
||||
return gerror.New("等级状态不合法")
|
||||
}
|
||||
if in.UpgradeAmount > 0 && in.GiftAmount > in.UpgradeAmount {
|
||||
return gerror.New("赠送金额不能超过升级金额")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemberLevelSubmitInp struct {
|
||||
VersionId uint64 `json:"versionId" v:"required|min:1#版本ID不能为空|版本ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#提交原因不能为空|提交原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelSubmitInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelPublishInp struct {
|
||||
VersionId uint64 `json:"versionId" v:"required|min:1#版本ID不能为空|版本ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelPublishInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelRollbackInp struct {
|
||||
VersionId uint64 `json:"versionId" v:"required|min:1#版本ID不能为空|版本ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#回滚原因不能为空|回滚原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelRollbackInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelHistoryInp struct {
|
||||
form.PageReq
|
||||
LevelId uint64 `json:"levelId" v:"required|min:1#等级ID不能为空|等级ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelHistoryInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#等级ID不能为空|等级ID不能为空"`
|
||||
Status int `json:"status" v:"required|in:1,2#状态不能为空|状态不合法"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelStatusInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#等级ID不能为空|等级ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#删除原因不能为空|删除原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *MemberLevelDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelApprovalModel struct {
|
||||
ApprovalId uint64 `json:"approvalId"`
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
}
|
||||
|
||||
type TaskHallListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *TaskHallListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskHallListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
HallCode string `json:"hallCode"`
|
||||
Name string `json:"name"`
|
||||
IconAttachmentId uint64 `json:"iconAttachmentId"`
|
||||
IconUrl string `json:"iconUrl"`
|
||||
Summary string `json:"summary"`
|
||||
CommissionRate uint `json:"commissionRate"`
|
||||
RateUnit string `json:"rateUnit"`
|
||||
ClientRoute string `json:"clientRoute"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
Sort int `json:"sort"`
|
||||
Version uint `json:"version"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
LevelIds []uint64 `json:"levelIds"`
|
||||
LevelNames []string `json:"levelNames"`
|
||||
}
|
||||
type TaskHallViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#大厅ID不能为空|大厅ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TaskHallViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskHallEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
Version uint `json:"version"`
|
||||
HallCode string `json:"hallCode" v:"required|max-length:32#大厅编码不能为空|大厅编码不能超过32个字符"`
|
||||
Name string `json:"name" v:"required|max-length:100#大厅名称不能为空|大厅名称不能超过100个字符"`
|
||||
IconAttachmentId uint64 `json:"iconAttachmentId"`
|
||||
IconUrl string `json:"iconUrl" v:"required|max-length:1000#图标不能为空|图标地址不能超过1000个字符"`
|
||||
Summary string `json:"summary" v:"required|max-length:500#简介不能为空|简介不能超过500个字符"`
|
||||
CommissionRate uint `json:"commissionRate" v:"max:10000#佣金比例不能超过100%"`
|
||||
ClientRoute string `json:"clientRoute" v:"required|max-length:500#C端跳转不能为空|C端跳转不能超过500个字符"`
|
||||
LevelIds []uint64 `json:"levelIds" v:"required#至少绑定一个会员等级"`
|
||||
Sort int `json:"sort"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *TaskHallEditInp) Filter(ctx context.Context) error {
|
||||
if len(in.LevelIds) != 1 {
|
||||
return gerror.New("请选择一个会员等级")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TaskHallStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#大厅ID不能为空|大厅ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
PublishStatus int `json:"publishStatus" v:"required|in:3,4#状态不能为空|仅支持发布或下线"`
|
||||
}
|
||||
|
||||
func (in *TaskHallStatusInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.BizPublishStatusOptions, in.PublishStatus) {
|
||||
return gerror.New("发布状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TaskHallDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#大厅ID不能为空|大厅ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#删除原因不能为空|删除原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *TaskHallDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type MemberLevelOptionModel struct {
|
||||
Options []*model.Option `json:"options"`
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/library/hgorm/hook"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/tree"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// NormalTreeDemoUpdateFields 修改普通树表字段过滤
|
||||
type NormalTreeDemoUpdateFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
Level int `json:"level" dc:"关系树级别"`
|
||||
Tree string `json:"tree" dc:"关系树"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
||||
}
|
||||
|
||||
// NormalTreeDemoInsertFields 新增普通树表字段过滤
|
||||
type NormalTreeDemoInsertFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
Level int `json:"level" dc:"关系树级别"`
|
||||
Tree string `json:"tree" dc:"关系树"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
}
|
||||
|
||||
// NormalTreeDemoEditInp 修改/新增普通树表
|
||||
type NormalTreeDemoEditInp struct {
|
||||
entity.SysGenTreeDemo
|
||||
}
|
||||
|
||||
func (in *NormalTreeDemoEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证标题
|
||||
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type NormalTreeDemoEditModel struct{}
|
||||
|
||||
// NormalTreeDemoDeleteInp 删除普通树表
|
||||
type NormalTreeDemoDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *NormalTreeDemoDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type NormalTreeDemoDeleteModel struct{}
|
||||
|
||||
// NormalTreeDemoViewInp 获取指定普通树表信息
|
||||
type NormalTreeDemoViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *NormalTreeDemoViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type NormalTreeDemoViewModel struct {
|
||||
entity.SysGenTreeDemo
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
}
|
||||
|
||||
// NormalTreeDemoListInp 获取普通树表列表
|
||||
type NormalTreeDemoListInp struct {
|
||||
form.PageReq
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *NormalTreeDemoListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type NormalTreeDemoListModel struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
// NormalTreeDemoMaxSortInp 获取普通树表最大排序
|
||||
type NormalTreeDemoMaxSortInp struct{}
|
||||
|
||||
func (in *NormalTreeDemoMaxSortInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type NormalTreeDemoMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// NormalTreeDemoTreeOption 关系树选项
|
||||
type NormalTreeDemoTreeOption struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
Children []tree.Node `json:"children" dc:"子节点"`
|
||||
}
|
||||
|
||||
// ID 获取节点ID
|
||||
func (t *NormalTreeDemoTreeOption) ID() int64 {
|
||||
return t.Id
|
||||
}
|
||||
|
||||
// PID 获取父级节点ID
|
||||
func (t *NormalTreeDemoTreeOption) PID() int64 {
|
||||
return t.Pid
|
||||
}
|
||||
|
||||
// SetChildren 设置子节点数据
|
||||
func (t *NormalTreeDemoTreeOption) SetChildren(children []tree.Node) {
|
||||
t.Children = children
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2025 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.17.8
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/library/hgorm/hook"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/tree"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// OptionTreeDemoUpdateFields 修改选项树表字段过滤
|
||||
type OptionTreeDemoUpdateFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
Level int `json:"level" dc:"关系树级别"`
|
||||
Tree string `json:"tree" dc:"关系树"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
UpdatedBy int64 `json:"updatedBy" dc:"更新者"`
|
||||
}
|
||||
|
||||
// OptionTreeDemoInsertFields 新增选项树表字段过滤
|
||||
type OptionTreeDemoInsertFields struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
Level int `json:"level" dc:"关系树级别"`
|
||||
Tree string `json:"tree" dc:"关系树"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
}
|
||||
|
||||
// OptionTreeDemoEditInp 修改/新增选项树表
|
||||
type OptionTreeDemoEditInp struct {
|
||||
entity.SysGenTreeDemo
|
||||
}
|
||||
|
||||
func (in *OptionTreeDemoEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证标题
|
||||
if err := g.Validator().Rules("required").Data(in.Title).Messages("标题不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type OptionTreeDemoEditModel struct{}
|
||||
|
||||
// OptionTreeDemoDeleteInp 删除选项树表
|
||||
type OptionTreeDemoDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *OptionTreeDemoDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type OptionTreeDemoDeleteModel struct{}
|
||||
|
||||
// OptionTreeDemoViewInp 获取指定选项树表信息
|
||||
type OptionTreeDemoViewInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *OptionTreeDemoViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type OptionTreeDemoViewModel struct {
|
||||
entity.SysGenTreeDemo
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
}
|
||||
|
||||
// OptionTreeDemoListInp 获取选项树表列表
|
||||
type OptionTreeDemoListInp struct {
|
||||
form.PageReq
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *OptionTreeDemoListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type OptionTreeDemoListModel struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
CategoryId int64 `json:"categoryId" dc:"测试分类"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedBy int64 `json:"createdBy" dc:"创建者"`
|
||||
CreatedBySumma *hook.MemberSumma `json:"createdBySumma" dc:"创建者摘要信息"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
// OptionTreeDemoMaxSortInp 获取选项树表最大排序
|
||||
type OptionTreeDemoMaxSortInp struct{}
|
||||
|
||||
func (in *OptionTreeDemoMaxSortInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type OptionTreeDemoMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// OptionTreeDemoTreeOption 关系树选项
|
||||
type OptionTreeDemoTreeOption struct {
|
||||
Title string `json:"title" dc:"标题"`
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Pid int64 `json:"pid" dc:"上级"`
|
||||
|
||||
Children []tree.Node `json:"children" dc:"子节点"`
|
||||
}
|
||||
|
||||
// ID 获取节点ID
|
||||
func (t *OptionTreeDemoTreeOption) ID() int64 {
|
||||
return t.Id
|
||||
}
|
||||
|
||||
// PID 获取父级节点ID
|
||||
func (t *OptionTreeDemoTreeOption) PID() int64 {
|
||||
return t.Pid
|
||||
}
|
||||
|
||||
// SetChildren 设置子节点数据
|
||||
func (t *OptionTreeDemoTreeOption) SetChildren(children []tree.Node) {
|
||||
t.Children = children
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/dict"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
)
|
||||
|
||||
type SiteConfigData struct {
|
||||
LogoUrl string `json:"logoUrl"`
|
||||
SiteName string `json:"siteName"`
|
||||
PrivacyPolicyUrl string `json:"privacyPolicyUrl"`
|
||||
TradeBalanceAmount int64 `json:"tradeBalanceAmount"`
|
||||
TradeWaitSeconds int `json:"tradeWaitSeconds"`
|
||||
DailyTradeLimit int `json:"dailyTradeLimit"`
|
||||
DailyRewardLimit int `json:"dailyRewardLimit"`
|
||||
CommissionRates []float64 `json:"commissionRates"`
|
||||
WithdrawTimeRanges []string `json:"withdrawTimeRanges"`
|
||||
RechargeTimeRanges []string `json:"rechargeTimeRanges"`
|
||||
TradeTimeRanges []string `json:"tradeTimeRanges"`
|
||||
SignTimeRanges []string `json:"signTimeRanges"`
|
||||
MinimumRechargeAmount int64 `json:"minimumRechargeAmount"`
|
||||
AutoOrderDelaySeconds int `json:"autoOrderDelaySeconds"`
|
||||
AutoOrderMinAmount int64 `json:"autoOrderMinAmount"`
|
||||
AutoOrderMaxAmount int64 `json:"autoOrderMaxAmount"`
|
||||
FreeClaimEnabled int `json:"freeClaimEnabled"`
|
||||
ManualMallEnabled int `json:"manualMallEnabled"`
|
||||
HomeTaskEnabled int `json:"homeTaskEnabled"`
|
||||
SignEnabled int `json:"signEnabled"`
|
||||
ProductModeEnabled int `json:"productModeEnabled"`
|
||||
CaptchaEnabled int `json:"captchaEnabled"`
|
||||
}
|
||||
|
||||
type SiteConfigSaveInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
Version uint `json:"version"`
|
||||
ConfigGroup string `json:"configGroup" d:"portal" v:"required|max-length:64#配置组不能为空|配置组过长"`
|
||||
Config SiteConfigData `json:"config" v:"required#配置不能为空"`
|
||||
EffectiveAt *gtime.Time `json:"effectiveAt"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigSaveInp) Filter(ctx context.Context) error {
|
||||
if strings.TrimSpace(in.Config.SiteName) == "" {
|
||||
return gerror.New("站点名称不能为空")
|
||||
}
|
||||
if in.Config.PrivacyPolicyUrl != "" {
|
||||
u, err := url.Parse(in.Config.PrivacyPolicyUrl)
|
||||
if err != nil || u.Scheme != "https" || u.Host == "" {
|
||||
return gerror.New("隐私政策地址必须是有效的 HTTPS 地址")
|
||||
}
|
||||
}
|
||||
if in.Config.TradeWaitSeconds < 0 || in.Config.DailyTradeLimit < 0 || in.Config.DailyRewardLimit < 0 {
|
||||
return gerror.New("交易等待时间和每日次数不能为负数")
|
||||
}
|
||||
if len(in.Config.CommissionRates) != 6 {
|
||||
return gerror.New("必须配置 0 至 5 级共 6 个佣金比例")
|
||||
}
|
||||
total := float64(0)
|
||||
for _, rate := range in.Config.CommissionRates {
|
||||
if rate < 0 || rate > 1 {
|
||||
return gerror.New("佣金比例必须在 0 至 1 之间")
|
||||
}
|
||||
total += rate
|
||||
}
|
||||
if total > 1 {
|
||||
return gerror.New("各级佣金比例总和不能超过 100%")
|
||||
}
|
||||
if in.Config.AutoOrderDelaySeconds < 0 {
|
||||
return gerror.New("自动派单时间不能为负数")
|
||||
}
|
||||
if in.Config.AutoOrderMinAmount < 0 || in.Config.AutoOrderMaxAmount < in.Config.AutoOrderMinAmount {
|
||||
return gerror.New("自动派单最大金额不能小于最小金额")
|
||||
}
|
||||
for _, ranges := range [][]string{in.Config.WithdrawTimeRanges, in.Config.RechargeTimeRanges, in.Config.TradeTimeRanges, in.Config.SignTimeRanges} {
|
||||
for _, value := range ranges {
|
||||
parts := strings.Split(value, "-")
|
||||
if len(parts) != 2 || parts[0] >= parts[1] {
|
||||
return gerror.Newf("时间区间 %s 不合法,结束时间必须晚于开始时间", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type SiteConfigCurrentInp struct {
|
||||
ConfigGroup string `json:"configGroup" d:"portal"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigCurrentInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type SiteConfigCurrentModel struct {
|
||||
Draft *entity.SiteConfigVersion `json:"draft"`
|
||||
Published *entity.SiteConfigVersion `json:"published"`
|
||||
}
|
||||
|
||||
type SiteConfigSubmitInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#配置版本不能为空|配置版本不能为空"`
|
||||
Version uint `json:"version"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#提交原因不能为空|提交原因过长"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigSubmitInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type SiteConfigPublishInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#配置版本不能为空|配置版本不能为空"`
|
||||
Version uint `json:"version"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigPublishInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type SiteConfigRollbackInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#历史版本不能为空|历史版本不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#回滚原因不能为空|回滚原因过长"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigRollbackInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type SiteConfigHistoryInp struct {
|
||||
form.PageReq
|
||||
ConfigGroup string `json:"configGroup" d:"portal"`
|
||||
}
|
||||
|
||||
func (in *SiteConfigHistoryInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type SiteConfigHistoryModel struct{ entity.SiteConfigVersion }
|
||||
|
||||
type ContentListInp struct {
|
||||
form.PageReq
|
||||
Title string `json:"title"`
|
||||
ContentType string `json:"contentType"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *ContentListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ContentListModel struct {
|
||||
entity.Content
|
||||
LatestVersionId uint64 `json:"latestVersionId"`
|
||||
LatestVersionNo uint `json:"latestVersionNo"`
|
||||
Summary string `json:"summary"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
}
|
||||
type ContentViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#内容ID不能为空|内容ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *ContentViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ContentViewModel struct {
|
||||
entity.Content
|
||||
LatestVersion *entity.ContentVersion `json:"latestVersion"`
|
||||
Versions []*entity.ContentVersion `json:"versions"`
|
||||
}
|
||||
type ContentEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
Version uint `json:"version"`
|
||||
ContentKey string `json:"contentKey" v:"required|max-length:64#内容标识不能为空|内容标识过长"`
|
||||
ContentType string `json:"contentType" v:"required#内容类型不能为空"`
|
||||
Title string `json:"title" v:"required|max-length:200#标题不能为空|标题过长"`
|
||||
Summary string `json:"summary" v:"max-length:500#摘要过长"`
|
||||
BodyHtml string `json:"bodyHtml" v:"required#正文不能为空"`
|
||||
BodyText string `json:"bodyText"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
EffectiveAt *gtime.Time `json:"effectiveAt"`
|
||||
Sort int `json:"sort"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注过长"`
|
||||
}
|
||||
|
||||
func (in *ContentEditInp) Filter(ctx context.Context) error {
|
||||
if !regexp.MustCompile(`^[a-z][a-z0-9_]{1,63}$`).MatchString(in.ContentKey) {
|
||||
return gerror.New("内容标识仅支持小写字母、数字和下划线,且必须以字母开头")
|
||||
}
|
||||
if unsafeHTML(in.BodyHtml) {
|
||||
return gerror.New("正文包含 script、事件属性、javascript 链接或 iframe 等不安全内容")
|
||||
}
|
||||
in.BodyHtml = bluemonday.UGCPolicy().Sanitize(in.BodyHtml)
|
||||
return nil
|
||||
}
|
||||
|
||||
type ContentDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#内容ID不能为空|内容ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *ContentDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ContentPublishInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#内容ID不能为空|内容ID不能为空"`
|
||||
VersionId uint64 `json:"versionId" v:"required|min:1#内容版本不能为空|内容版本不能为空"`
|
||||
}
|
||||
|
||||
func (in *ContentPublishInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ContentOfflineInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#内容ID不能为空|内容ID不能为空"`
|
||||
Reason string `json:"reason" v:"required#下线原因不能为空"`
|
||||
}
|
||||
|
||||
func (in *ContentOfflineInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BannerListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
Position string `json:"position"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *BannerListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BannerListModel struct{ entity.Banner }
|
||||
type BannerViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#Banner ID不能为空|Banner ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *BannerViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BannerEditInp struct{ entity.Banner }
|
||||
|
||||
func (in *BannerEditInp) Filter(ctx context.Context) error {
|
||||
if strings.TrimSpace(in.Name) == "" || strings.TrimSpace(in.ImageUrl) == "" || strings.TrimSpace(in.AltText) == "" {
|
||||
return gerror.New("名称、图片和替代文本不能为空")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.BannerPositionOptions, in.Position) {
|
||||
return gerror.New("Banner 投放位置不合法")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.BannerTargetTypeOptions, in.TargetType) {
|
||||
return gerror.New("跳转类型不合法")
|
||||
}
|
||||
if in.TargetType != consts.BannerTargetNone && strings.TrimSpace(in.TargetValue) == "" {
|
||||
return gerror.New("当前跳转类型必须填写跳转目标")
|
||||
}
|
||||
if in.TargetType == consts.BannerTargetExternal {
|
||||
u, err := url.Parse(in.TargetValue)
|
||||
if err != nil || u.Scheme != "https" || u.Host == "" {
|
||||
return gerror.New("外部跳转必须是有效的 HTTPS 地址")
|
||||
}
|
||||
}
|
||||
if in.StartAt != nil && in.EndAt != nil && !in.EndAt.After(in.StartAt) {
|
||||
return gerror.New("结束时间必须晚于开始时间")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type BannerDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#Banner ID不能为空|Banner ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *BannerDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type BannerStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#Banner ID不能为空|Banner ID不能为空"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
Version uint `json:"version"`
|
||||
}
|
||||
|
||||
func (in *BannerStatusInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.BizPublishStatusOptions, in.PublishStatus) {
|
||||
return gerror.New("发布状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ManualProductListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *ManualProductListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ManualProductListModel struct {
|
||||
entity.Product
|
||||
Price string `json:"price"`
|
||||
}
|
||||
type ManualProductViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *ManualProductViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ManualProductViewModel struct {
|
||||
entity.Product
|
||||
Price string `json:"price"`
|
||||
}
|
||||
type ManualProductEditInp struct {
|
||||
entity.Product
|
||||
Price string `json:"price" v:"required#价格不能为空"`
|
||||
}
|
||||
|
||||
func (in *ManualProductEditInp) Filter(ctx context.Context) error {
|
||||
if strings.TrimSpace(in.Name) == "" || strings.TrimSpace(in.CoverUrl) == "" {
|
||||
return gerror.New("商品名称和图片不能为空")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ManualProductDeleteInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
Ids []uint64 `json:"ids"`
|
||||
}
|
||||
|
||||
func (in *ManualProductDeleteInp) Filter(ctx context.Context) error {
|
||||
if len(in.Ids) == 0 && in.Id > 0 {
|
||||
in.Ids = []uint64{in.Id}
|
||||
}
|
||||
if len(in.Ids) == 0 {
|
||||
return gerror.New("请选择要删除的商品")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ManualProductStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
Version uint `json:"version"`
|
||||
}
|
||||
|
||||
func (in *ManualProductStatusInp) Filter(ctx context.Context) error {
|
||||
if !dict.HasOptionKey(consts.BizPublishStatusOptions, in.PublishStatus) {
|
||||
return gerror.New("发布状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func unsafeHTML(value string) bool {
|
||||
lower := strings.ToLower(value)
|
||||
patterns := []string{"<script", "javascript:", "<iframe", " onerror=", " onclick=", " onload="}
|
||||
for _, pattern := range patterns {
|
||||
if strings.Contains(lower, pattern) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type PortalApprovalModel struct {
|
||||
ApprovalId uint64 `json:"approvalId"`
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
}
|
||||
type JsonPayload struct {
|
||||
Value *gjson.Json `json:"value"`
|
||||
}
|
||||
@@ -0,0 +1,272 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"github.com/microcosm-cc/bluemonday"
|
||||
)
|
||||
|
||||
type ProductUpdateFields struct {
|
||||
CategoryId uint64
|
||||
ProductType int
|
||||
PaymentType string
|
||||
Name string
|
||||
ShopName string
|
||||
PriceAmount int64
|
||||
Currency string
|
||||
CoverAttachmentId uint64
|
||||
CoverUrl string
|
||||
DetailHtml string
|
||||
IsRecommended int
|
||||
StartAt *gtime.Time
|
||||
EndAt *gtime.Time
|
||||
Sort int
|
||||
Remark string
|
||||
UpdatedBy uint64
|
||||
Version uint
|
||||
}
|
||||
type ProductInsertFields struct {
|
||||
ProductUpdateFields
|
||||
ProductNo string
|
||||
PublishStatus int
|
||||
CreatedBy uint64
|
||||
}
|
||||
type ProductListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
PaymentType string `json:"paymentType"`
|
||||
CategoryId uint64 `json:"categoryId"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *ProductListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ProductListModel struct {
|
||||
entity.Product
|
||||
CategoryName string `json:"categoryName"`
|
||||
Price string `json:"price"`
|
||||
Referenced bool `json:"referenced"`
|
||||
}
|
||||
type ProductViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *ProductViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type ProductEditInp struct {
|
||||
entity.Product
|
||||
Price string `json:"price" v:"required#价格不能为空"`
|
||||
}
|
||||
|
||||
func (in *ProductEditInp) Filter(ctx context.Context) error {
|
||||
if strings.TrimSpace(in.Name) == "" || strings.TrimSpace(in.ShopName) == "" || strings.TrimSpace(in.CoverUrl) == "" {
|
||||
return gerror.New("商品名称、店铺名称和展示图片不能为空")
|
||||
}
|
||||
if in.CategoryId == 0 {
|
||||
return gerror.New("请选择商品分类")
|
||||
}
|
||||
if in.ProductType != consts.ProductTypeStandard && in.ProductType != consts.ProductTypeManual {
|
||||
return gerror.New("商品类型不合法")
|
||||
}
|
||||
if in.IsRecommended != consts.StatusEnabled && in.IsRecommended != consts.StatusDisable {
|
||||
return gerror.New("推荐状态不合法")
|
||||
}
|
||||
if unsafeHTML(in.DetailHtml) {
|
||||
return gerror.New("商品详情包含不安全内容")
|
||||
}
|
||||
in.DetailHtml = bluemonday.UGCPolicy().Sanitize(in.DetailHtml)
|
||||
if in.StartAt != nil && in.EndAt != nil && !in.EndAt.After(in.StartAt) {
|
||||
return gerror.New("展示结束时间必须晚于开始时间")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProductStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *ProductStatusInp) Filter(ctx context.Context) error {
|
||||
if in.PublishStatus != consts.BizPublishPublished && in.PublishStatus != consts.BizPublishOffline {
|
||||
return gerror.New("商品状态只允许上架或下架")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProductRecommendInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
IsRecommended int `json:"isRecommended"`
|
||||
}
|
||||
|
||||
func (in *ProductRecommendInp) Filter(ctx context.Context) error {
|
||||
if in.IsRecommended != consts.StatusEnabled && in.IsRecommended != consts.StatusDisable {
|
||||
return gerror.New("推荐状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ProductDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#商品ID不能为空|商品ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *ProductDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskUpdateFields struct {
|
||||
HallId uint64
|
||||
Title string
|
||||
Description string
|
||||
DetailHtml string
|
||||
CoverAttachmentId uint64
|
||||
CoverUrl string
|
||||
CommissionAmount int64
|
||||
CommissionRate uint
|
||||
DailyLimit uint
|
||||
PerMemberLimit uint
|
||||
StartAt *gtime.Time
|
||||
EndAt *gtime.Time
|
||||
Sort int
|
||||
Remark string
|
||||
UpdatedBy uint64
|
||||
Version uint
|
||||
}
|
||||
type TaskInsertFields struct {
|
||||
TaskUpdateFields
|
||||
TaskNo string
|
||||
PublishStatus int
|
||||
CreatedBy uint64
|
||||
}
|
||||
type TaskListInp struct {
|
||||
form.PageReq
|
||||
Title string `json:"title"`
|
||||
LevelId uint64 `json:"levelId"`
|
||||
HallId uint64 `json:"hallId"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *TaskListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskListModel struct {
|
||||
entity.Task
|
||||
HallName string `json:"hallName"`
|
||||
LevelIds []uint64 `json:"levelIds"`
|
||||
LevelNames []string `json:"levelNames"`
|
||||
Referenced bool `json:"referenced"`
|
||||
}
|
||||
type TaskViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#任务ID不能为空|任务ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TaskViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskEditInp struct {
|
||||
entity.Task
|
||||
LevelIds []uint64 `json:"levelIds"`
|
||||
Commission string `json:"commission" v:"required#佣金不能为空"`
|
||||
}
|
||||
|
||||
func (in *TaskEditInp) Filter(ctx context.Context) error {
|
||||
if strings.TrimSpace(in.Title) == "" || strings.TrimSpace(in.Description) == "" || strings.TrimSpace(in.CoverUrl) == "" {
|
||||
return gerror.New("任务标题、描述和封面不能为空")
|
||||
}
|
||||
if in.HallId == 0 || len(in.LevelIds) == 0 {
|
||||
return gerror.New("请选择任务大厅和会员等级")
|
||||
}
|
||||
if in.PerMemberLimit == 0 {
|
||||
return gerror.New("单会员任务限制必须大于0")
|
||||
}
|
||||
if in.CommissionRate > 10000 {
|
||||
return gerror.New("佣金比例不能超过100%")
|
||||
}
|
||||
if unsafeHTML(in.DetailHtml) {
|
||||
return gerror.New("任务详情包含不安全内容")
|
||||
}
|
||||
in.DetailHtml = bluemonday.UGCPolicy().Sanitize(in.DetailHtml)
|
||||
if in.StartAt != nil && in.EndAt != nil && !in.EndAt.After(in.StartAt) {
|
||||
return gerror.New("任务结束时间必须晚于开始时间")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TaskStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#任务ID不能为空|任务ID不能为空"`
|
||||
Version uint `json:"version"`
|
||||
PublishStatus int `json:"publishStatus"`
|
||||
}
|
||||
|
||||
func (in *TaskStatusInp) Filter(ctx context.Context) error {
|
||||
if in.PublishStatus != consts.BizPublishPublished && in.PublishStatus != consts.BizPublishOffline {
|
||||
return gerror.New("任务状态只允许发布或下线")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type TaskDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#任务ID不能为空|任务ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TaskDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskSubmissionListInp struct {
|
||||
form.PageReq
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
SubmissionStatus int `json:"submissionStatus"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *TaskSubmissionListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskSubmissionListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
SubmissionNo string `json:"submissionNo"`
|
||||
TradeOrderId uint64 `json:"tradeOrderId"`
|
||||
TaskId uint64 `json:"taskId"`
|
||||
TaskTitle string `json:"taskTitle"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
LevelName string `json:"levelName"`
|
||||
EvidenceText string `json:"evidenceText"`
|
||||
EvidenceAttachmentIds *gjson.Json `json:"evidenceAttachmentIds"`
|
||||
SubmissionStatus int `json:"submissionStatus"`
|
||||
CommissionAmount int64 `json:"commissionAmount"`
|
||||
SuccessRate uint `json:"successRate"`
|
||||
ReviewReasonCode string `json:"reviewReasonCode"`
|
||||
ReviewReason string `json:"reviewReason"`
|
||||
AllowResubmit int `json:"allowResubmit"`
|
||||
LedgerId uint64 `json:"ledgerId"`
|
||||
ReviewedAt *gtime.Time `json:"reviewedAt"`
|
||||
SettledAt *gtime.Time `json:"settledAt"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
type TaskSubmissionViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#提交记录ID不能为空|提交记录ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TaskSubmissionViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskSubmissionReviewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#提交记录ID不能为空|提交记录ID不能为空"`
|
||||
Decision int `json:"decision" v:"required|in:1,2#审核结论不能为空|审核结论不合法"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码过长"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#审核意见不能为空|审核意见过长"`
|
||||
AllowResubmit int `json:"allowResubmit"`
|
||||
IdempotencyKey string `json:"idempotencyKey" v:"required|max-length:128#幂等键不能为空|幂等键过长"`
|
||||
}
|
||||
|
||||
func (in *TaskSubmissionReviewInp) Filter(ctx context.Context) error {
|
||||
if in.AllowResubmit != consts.StatusEnabled && in.AllowResubmit != consts.StatusDisable {
|
||||
return gerror.New("重提选项不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// ProvincesMaxSortInp 最大排序
|
||||
type ProvincesMaxSortInp struct {
|
||||
}
|
||||
|
||||
type ProvincesMaxSortModel struct {
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
}
|
||||
|
||||
// ProvincesEditInp 修改/新增字典数据
|
||||
type ProvincesEditInp struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
|
||||
func (in *ProvincesEditInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Title == "" {
|
||||
err = gerror.New("标题不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("地区Id必须大于0")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type ProvincesEditModel struct{}
|
||||
|
||||
// ProvincesUpdateFields 修改数据字段过滤
|
||||
type ProvincesUpdateFields struct {
|
||||
Id int64 `json:"id" description:"省市区ID"`
|
||||
Title string `json:"title" description:"栏目名称"`
|
||||
Pinyin string `json:"pinyin" description:"拼音"`
|
||||
Lng string `json:"lng" description:"经度"`
|
||||
Lat string `json:"lat" description:"纬度"`
|
||||
Pid int64 `json:"pid" description:"父栏目"`
|
||||
Level int `json:"level" description:"关系树等级"`
|
||||
Tree string `json:"tree" description:"关系"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
}
|
||||
|
||||
// ProvincesInsertFields 新增数据字段过滤
|
||||
type ProvincesInsertFields struct {
|
||||
Id int64 `json:"id" description:"省市区ID"`
|
||||
Title string `json:"title" description:"栏目名称"`
|
||||
Pinyin string `json:"pinyin" description:"拼音"`
|
||||
Lng string `json:"lng" description:"经度"`
|
||||
Lat string `json:"lat" description:"纬度"`
|
||||
Pid int64 `json:"pid" description:"父栏目"`
|
||||
Level int `json:"level" description:"关系树等级"`
|
||||
Tree string `json:"tree" description:"关系"`
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
Status int `json:"status" description:"状态"`
|
||||
}
|
||||
|
||||
// ProvincesDeleteInp 删除字典类型
|
||||
type ProvincesDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
|
||||
}
|
||||
|
||||
type ProvincesDeleteModel struct{}
|
||||
|
||||
// ProvincesViewInp 获取信息
|
||||
type ProvincesViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type ProvincesViewModel struct {
|
||||
Id int64 `json:"id" v:"required#省市区ID不能为空" dc:"省市区ID"`
|
||||
}
|
||||
|
||||
// ProvincesListInp 获取列表
|
||||
type ProvincesListInp struct {
|
||||
form.PageReq
|
||||
|
||||
form.StatusReq
|
||||
Title string `json:"title"`
|
||||
Content string `json:"content"`
|
||||
}
|
||||
|
||||
type ProvincesListModel struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
|
||||
// ProvincesStatusInp 更新状态
|
||||
type ProvincesStatusInp struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
|
||||
func (in *ProvincesStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ProvincesStatusModel struct{}
|
||||
|
||||
// ProvincesChildrenListInp 获取省市区下级列表
|
||||
type ProvincesChildrenListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
Pid int64 `json:"pid" dc:"上级ID"`
|
||||
Id int64 `json:"id" dc:"地区ID"`
|
||||
Title string `json:"title" dc:"地区名称"`
|
||||
}
|
||||
|
||||
type ProvincesChildrenListModel struct {
|
||||
entity.SysProvinces
|
||||
}
|
||||
|
||||
// ProvincesUniqueIdInp 获取省市区下级列表
|
||||
type ProvincesUniqueIdInp struct {
|
||||
OldId int64 `json:"oldId" dc:"原始ID"`
|
||||
NewId int64 `json:"newId" dc:"新的ID"`
|
||||
}
|
||||
|
||||
type ProvincesUniqueIdModel struct {
|
||||
IsUnique bool `json:"unique" dc:"是否唯一"`
|
||||
}
|
||||
|
||||
type ProvincesSelectInp struct {
|
||||
DataType string `json:"dataType" v:"required#数据类型不能为空" dc:"数据类型"`
|
||||
Value int64 `json:"value" dc:"上级ID"`
|
||||
}
|
||||
|
||||
type ProvincesSelectModel struct {
|
||||
List []*ProvincesSelectData `json:"list" dc:"数据列表"`
|
||||
}
|
||||
|
||||
type ProvincesSelectData struct {
|
||||
Label string `json:"label" description:"地区名称"`
|
||||
Value int64 `json:"value" description:"地区ID"`
|
||||
Level int `json:"level" description:"地区等级"`
|
||||
IsLeaf bool `json:"isLeaf" description:"是否是最后一个节点"`
|
||||
}
|
||||
|
||||
// ProvincesCityLabelInp 获取指定城市标签
|
||||
type ProvincesCityLabelInp struct {
|
||||
Id int64 `json:"oldId" dc:"城市ID"`
|
||||
Spilt string `json:"spilt" dc:"分隔符"`
|
||||
}
|
||||
|
||||
type ProvincesCityLabelModel string
|
||||
|
||||
// ProvincesTree 树
|
||||
type ProvincesTree struct {
|
||||
entity.SysProvinces
|
||||
Key int64 `json:"key" dc:"key"`
|
||||
Label string `json:"label" dc:"标签"`
|
||||
Value int64 `json:"value" dc:"键值"`
|
||||
Children []*ProvincesTree `json:"children"`
|
||||
}
|
||||
@@ -0,0 +1,190 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.7.6
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
)
|
||||
|
||||
// ServeLicenseUpdateFields 修改服务许可证字段过滤
|
||||
type ServeLicenseUpdateFields struct {
|
||||
Group string `json:"group" dc:"分组"`
|
||||
Name string `json:"name" dc:"许可名称"`
|
||||
Appid string `json:"appid" dc:"应用ID"`
|
||||
SecretKey string `json:"secretKey" dc:"应用秘钥"`
|
||||
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
|
||||
// Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
|
||||
AllowedIps string `json:"allowedIps" dc:"白名单,*代表所有,只有允许的IP才能连接到tcp服务"`
|
||||
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// ServeLicenseInsertFields 新增服务许可证字段过滤
|
||||
type ServeLicenseInsertFields struct {
|
||||
Group string `json:"group" dc:"分组"`
|
||||
Name string `json:"name" dc:"许可名称"`
|
||||
Appid string `json:"appid" dc:"应用ID"`
|
||||
SecretKey string `json:"secretKey" dc:"应用秘钥"`
|
||||
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
|
||||
// Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
|
||||
AllowedIps string `json:"allowedIps" dc:"白名单,*代表所有,只有允许的IP才能连接到tcp服务"`
|
||||
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// ServeLicenseEditInp 修改/新增服务许可证
|
||||
type ServeLicenseEditInp struct {
|
||||
entity.SysServeLicense
|
||||
}
|
||||
|
||||
func (in *ServeLicenseEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证分组
|
||||
if err := g.Validator().Rules("required").Data(in.Group).Messages("分组不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
// 验证许可名称
|
||||
if err := g.Validator().Rules("required").Data(in.Name).Messages("许可名称不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
// 验证应用ID
|
||||
if err := g.Validator().Rules("required").Data(in.Appid).Messages("应用ID不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
// 验证授权结束时间
|
||||
if err := g.Validator().Rules("required").Data(in.EndAt).Messages("授权结束时间不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type ServeLicenseEditModel struct{}
|
||||
|
||||
// ServeLicenseDeleteInp 删除服务许可证
|
||||
type ServeLicenseDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
|
||||
}
|
||||
|
||||
func (in *ServeLicenseDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ServeLicenseDeleteModel struct{}
|
||||
|
||||
// ServeLicenseViewInp 获取指定服务许可证信息
|
||||
type ServeLicenseViewInp struct {
|
||||
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
|
||||
}
|
||||
|
||||
func (in *ServeLicenseViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ServeLicenseViewModel struct {
|
||||
entity.SysServeLicense
|
||||
}
|
||||
|
||||
// ServeLicenseListInp 获取服务许可证列表
|
||||
type ServeLicenseListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" dc:"许可ID"`
|
||||
Group string `json:"group" dc:"分组"`
|
||||
Name string `json:"name" dc:"许可名称"`
|
||||
Appid string `json:"appid" dc:"应用ID"`
|
||||
EndAt []*gtime.Time `json:"endAt" dc:"授权结束时间"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *ServeLicenseListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type ServeLicenseListModel struct {
|
||||
Id int64 `json:"id" dc:"许可ID"`
|
||||
Group string `json:"group" dc:"分组"`
|
||||
Name string `json:"name" dc:"许可名称"`
|
||||
Appid string `json:"appid" dc:"应用ID"`
|
||||
SecretKey string `json:"secretKey" dc:"应用秘钥"`
|
||||
RemoteAddr string `json:"remoteAddr" dc:"最后连接地址"`
|
||||
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
|
||||
LoginTimes int64 `json:"loginTimes" dc:"登录次数"`
|
||||
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
|
||||
LastActiveAt *gtime.Time `json:"lastActiveAt" dc:"最后活跃时间"`
|
||||
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
|
||||
Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
Online int `json:"online" dc:"在线"`
|
||||
}
|
||||
|
||||
// ServeLicenseExportModel 导出服务许可证
|
||||
type ServeLicenseExportModel struct {
|
||||
Id int64 `json:"id" dc:"许可ID"`
|
||||
Group string `json:"group" dc:"分组"`
|
||||
Name string `json:"name" dc:"许可名称"`
|
||||
Appid string `json:"appid" dc:"应用ID"`
|
||||
SecretKey string `json:"secretKey" dc:"应用秘钥"`
|
||||
RemoteAddr string `json:"remoteAddr" dc:"最后连接地址"`
|
||||
OnlineLimit int `json:"onlineLimit" dc:"在线数量限制,默认1"`
|
||||
LoginTimes int64 `json:"loginTimes" dc:"登录次数"`
|
||||
LastLoginAt *gtime.Time `json:"lastLoginAt" dc:"最后登录时间"`
|
||||
LastActiveAt *gtime.Time `json:"lastActiveAt" dc:"最后活跃时间"`
|
||||
EndAt *gtime.Time `json:"endAt" dc:"授权结束时间"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
||||
|
||||
// ServeLicenseStatusInp 更新服务许可证状态
|
||||
type ServeLicenseStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
func (in *ServeLicenseStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("许可ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ServeLicenseStatusModel struct{}
|
||||
|
||||
type ServeLicenseAssignRouterInp struct {
|
||||
Id int64 `json:"id" v:"required#许可ID不能为空" dc:"许可ID"`
|
||||
Routes *gjson.Json `json:"routes" dc:"路由表,空使用默认分组路由"`
|
||||
}
|
||||
|
||||
func (in *ServeLicenseAssignRouterInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// ServeLogDeleteInp 删除服务日志
|
||||
type ServeLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type ServeLogDeleteModel struct{}
|
||||
|
||||
// ServeLogViewInp 获取指定服务日志信息
|
||||
type ServeLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#日志ID不能为空" dc:"日志ID"`
|
||||
}
|
||||
|
||||
type ServeLogViewModel struct {
|
||||
entity.SysServeLog
|
||||
}
|
||||
|
||||
// ServeLogListInp 获取服务日志列表
|
||||
type ServeLogListInp struct {
|
||||
form.PageReq
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
Content string `json:"content" dc:"日志内容"`
|
||||
TriggerNs []int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
type ServeLogListModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
Content string `json:"content" dc:"日志内容"`
|
||||
Stack string `json:"stack" dc:"堆栈"`
|
||||
Line string `json:"line" dc:"调用行"`
|
||||
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
SysLogId int64 `json:"sysLogId" dc:"访问日志ID"`
|
||||
}
|
||||
|
||||
func (in *ServeLogListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// ServeLogExportModel 导出服务日志
|
||||
type ServeLogExportModel struct {
|
||||
Id int64 `json:"id" dc:"日志ID"`
|
||||
Env string `json:"env" dc:"环境"`
|
||||
TraceId string `json:"traceId" dc:"链路ID"`
|
||||
LevelFormat string `json:"levelFormat" dc:"日志级别"`
|
||||
Content string `json:"content" dc:"日志内容"`
|
||||
Line string `json:"line" dc:"调用行"`
|
||||
TriggerNs int64 `json:"triggerNs" dc:"触发时间(ns)"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// SmsLogEditInp 修改/新增数据
|
||||
type SmsLogEditInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type SmsLogEditModel struct{}
|
||||
|
||||
// SmsLogDeleteInp 删除
|
||||
type SmsLogDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
|
||||
}
|
||||
|
||||
type SmsLogDeleteModel struct{}
|
||||
|
||||
// SmsLogViewInp 获取信息
|
||||
type SmsLogViewInp struct {
|
||||
Id int64 `json:"id" v:"required#短信记录ID不能为空" dc:"短信记录ID"`
|
||||
}
|
||||
|
||||
type SmsLogViewModel struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
// SmsLogListInp 获取列表
|
||||
type SmsLogListInp struct {
|
||||
form.PageReq
|
||||
form.StatusReq
|
||||
Mobile string `json:"mobile" dc:"手机号"`
|
||||
Ip string `json:"ip" dc:"IP"`
|
||||
Event string `json:"event" dc:"事件"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *SmsLogListInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Event != "" {
|
||||
if _, ok := consts.SmsTemplateEventMap[in.Event]; !ok {
|
||||
err = gerror.Newf("无效的事件类型:%v", in.Event)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type SmsLogListModel struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
// SmsLogStatusInp 更新状态
|
||||
type SmsLogStatusInp struct {
|
||||
entity.SysSmsLog
|
||||
}
|
||||
|
||||
type SmsLogStatusModel struct{}
|
||||
|
||||
// SendCodeInp 发送验证码
|
||||
type SendCodeInp struct {
|
||||
Event string `json:"event" description:"事件"` // 必填
|
||||
Mobile string `json:"mobile" description:"手机号"` // 必填
|
||||
Code string `json:"code" description:"验证码或短信内容"`
|
||||
Template string `json:"-" description:"发信模板 "`
|
||||
}
|
||||
|
||||
// VerifyCodeInp 效验验证码
|
||||
type VerifyCodeInp struct {
|
||||
Event string `json:"event" description:"事件"` // 必填
|
||||
Mobile string `json:"mobile" description:"手机号"` // 必填
|
||||
Code string `json:"code" description:"验证码或短信内容"` // 必填
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
// Package sysin
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2024 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
// @AutoGenerate Version 2.15.7
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
"hotgo/utility/validate"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
// TestCategoryUpdateFields 修改测试分类字段过滤
|
||||
type TestCategoryUpdateFields struct {
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ShortName string `json:"shortName" dc:"简称"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// TestCategoryInsertFields 新增测试分类字段过滤
|
||||
type TestCategoryInsertFields struct {
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ShortName string `json:"shortName" dc:"简称"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Sort int `json:"sort" dc:"排序"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
Remark string `json:"remark" dc:"备注"`
|
||||
}
|
||||
|
||||
// TestCategoryEditInp 修改/新增测试分类
|
||||
type TestCategoryEditInp struct {
|
||||
entity.TestCategory
|
||||
}
|
||||
|
||||
func (in *TestCategoryEditInp) Filter(ctx context.Context) (err error) {
|
||||
// 验证分类名称
|
||||
if err := g.Validator().Rules("required").Data(in.Name).Messages("分类名称不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
// 验证排序
|
||||
if err := g.Validator().Rules("required").Data(in.Sort).Messages("排序不能为空").Run(ctx); err != nil {
|
||||
return err.Current()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryEditModel struct{}
|
||||
|
||||
// TestCategoryDeleteInp 删除测试分类
|
||||
type TestCategoryDeleteInp struct {
|
||||
Id interface{} `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
|
||||
}
|
||||
|
||||
func (in *TestCategoryDeleteInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryDeleteModel struct{}
|
||||
|
||||
// TestCategoryViewInp 获取指定测试分类信息
|
||||
type TestCategoryViewInp struct {
|
||||
Id int64 `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
|
||||
}
|
||||
|
||||
func (in *TestCategoryViewInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryViewModel struct {
|
||||
entity.TestCategory
|
||||
}
|
||||
|
||||
// TestCategoryListInp 获取测试分类列表
|
||||
type TestCategoryListInp struct {
|
||||
form.PageReq
|
||||
Id int64 `json:"id" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
func (in *TestCategoryListInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryListModel struct {
|
||||
Id int64 `json:"id" dc:"分类ID"`
|
||||
Name string `json:"name" dc:"分类名称"`
|
||||
ShortName string `json:"shortName" dc:"简称"`
|
||||
Description string `json:"description" dc:"描述"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
// TestCategoryMaxSortInp 获取测试分类最大排序
|
||||
type TestCategoryMaxSortInp struct{}
|
||||
|
||||
func (in *TestCategoryMaxSortInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryMaxSortModel struct {
|
||||
Sort int `json:"sort" description:"排序"`
|
||||
}
|
||||
|
||||
// TestCategoryStatusInp 更新测试分类状态
|
||||
type TestCategoryStatusInp struct {
|
||||
Id int64 `json:"id" v:"required#分类ID不能为空" dc:"分类ID"`
|
||||
Status int `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
func (in *TestCategoryStatusInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
err = gerror.New("分类ID不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if in.Status <= 0 {
|
||||
err = gerror.New("状态不能为空")
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type TestCategoryStatusModel struct{}
|
||||
@@ -0,0 +1,327 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/form"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type TradeOrderListInp struct {
|
||||
form.PageReq
|
||||
OrderNo string `json:"orderNo"`
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
OrderStatus int `json:"orderStatus"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TradeOrderListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
RealNameMask string `json:"realNameMask"`
|
||||
AutoDispatch int `json:"autoDispatch"`
|
||||
AvailableAmount int64 `json:"availableAmount"`
|
||||
FrozenAmount int64 `json:"frozenAmount"`
|
||||
TodayTradeCount int `json:"todayTradeCount"`
|
||||
ProductName string `json:"productName"`
|
||||
OrderType int `json:"orderType"`
|
||||
Quantity uint `json:"quantity"`
|
||||
UnitPriceAmount int64 `json:"unitPriceAmount"`
|
||||
TotalAmount int64 `json:"totalAmount"`
|
||||
CommissionAmount int64 `json:"commissionAmount"`
|
||||
Currency string `json:"currency"`
|
||||
Message string `json:"message"`
|
||||
OrderStatus int `json:"orderStatus"`
|
||||
FreezeStatus int `json:"freezeStatus"`
|
||||
ApprovalRequestId uint64 `json:"approvalRequestId"`
|
||||
MatchedAt *gtime.Time `json:"matchedAt"`
|
||||
CompletedAt *gtime.Time `json:"completedAt"`
|
||||
UnfrozenAt *gtime.Time `json:"unfrozenAt"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
ApprovalStatus int `json:"approvalStatus"`
|
||||
CanMatch bool `json:"canMatch"`
|
||||
CanApply bool `json:"canApply"`
|
||||
CanExecute bool `json:"canExecute"`
|
||||
}
|
||||
|
||||
type TradeOrderViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#订单ID不能为空|订单ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TradeOrderViewModel struct {
|
||||
TradeOrderListModel
|
||||
TaskId uint64 `json:"taskId"`
|
||||
ProductId uint64 `json:"productId"`
|
||||
MemberLevelId uint64 `json:"memberLevelId"`
|
||||
RuleSnapshot *gjson.Json `json:"ruleSnapshot"`
|
||||
}
|
||||
|
||||
type TradeOrderApplyInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#订单ID不能为空|订单ID不能为空"`
|
||||
Action string `json:"action" v:"required|in:cancel_match,rematch,unfreeze#处理动作不能为空|处理动作不合法"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码不能超过64个字符"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#原因说明不能为空|原因说明不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderApplyInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TradeOrderExecuteInp struct {
|
||||
ApprovalId uint64 `json:"approvalId" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderExecuteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TradeOrderMatchProductListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name" dc:"商品名称"`
|
||||
PriceMin string `json:"priceMin" dc:"最低价格"`
|
||||
PriceMax string `json:"priceMax" dc:"最高价格"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderMatchProductListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TradeOrderMatchProductModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CoverUrl string `json:"coverUrl"`
|
||||
PriceAmount int64 `json:"priceAmount"`
|
||||
}
|
||||
|
||||
type TradeOrderMatchInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#订单ID不能为空|订单ID不能为空"`
|
||||
ProductId uint64 `json:"productId" v:"required|min:1#请选择商品|请选择商品"`
|
||||
Quantity uint `json:"quantity" v:"required|min:1|max:999#商品数量不能为空|商品数量最少为1|商品数量不能超过999"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderMatchInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type FinanceApprovalModel struct {
|
||||
ApprovalId uint64 `json:"approvalId"`
|
||||
ApprovalNo string `json:"approvalNo"`
|
||||
}
|
||||
|
||||
type RechargeOrderListInp struct {
|
||||
form.PageReq
|
||||
RechargeNo string `json:"rechargeNo"`
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
RechargeStatus int `json:"rechargeStatus"`
|
||||
ChannelId uint64 `json:"channelId"`
|
||||
ChannelName string `json:"channelName"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *RechargeOrderListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type RechargeOrderListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
RechargeNo string `json:"rechargeNo"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
RealNameMask string `json:"realNameMask"`
|
||||
AvailableAmount int64 `json:"availableAmount"`
|
||||
ChannelId uint64 `json:"channelId"`
|
||||
ChannelName string `json:"channelName"`
|
||||
RequestAmount int64 `json:"requestAmount"`
|
||||
PaidAmount int64 `json:"paidAmount"`
|
||||
Currency string `json:"currency"`
|
||||
ExternalNo string `json:"externalNo"`
|
||||
VoucherAttachmentIds *gjson.Json `json:"voucherAttachmentIds"`
|
||||
RechargeType int `json:"rechargeType"`
|
||||
RechargeStatus int `json:"rechargeStatus"`
|
||||
Remark string `json:"remark"`
|
||||
ReviewReasonCode string `json:"reviewReasonCode"`
|
||||
ReviewReason string `json:"reviewReason"`
|
||||
ApprovalRequestId uint64 `json:"approvalRequestId"`
|
||||
LedgerId uint64 `json:"ledgerId"`
|
||||
PaidAt *gtime.Time `json:"paidAt"`
|
||||
ReviewedAt *gtime.Time `json:"reviewedAt"`
|
||||
CreditedAt *gtime.Time `json:"creditedAt"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type RechargeSummaryModel struct {
|
||||
TotalCount int64 `json:"totalCount"`
|
||||
TotalAmount int64 `json:"totalAmount"`
|
||||
PaidCount int64 `json:"paidCount"`
|
||||
PaidAmount int64 `json:"paidAmount"`
|
||||
UnpaidCount int64 `json:"unpaidCount"`
|
||||
UnpaidAmount int64 `json:"unpaidAmount"`
|
||||
ReviewCount int64 `json:"reviewCount"`
|
||||
ReviewAmount int64 `json:"reviewAmount"`
|
||||
RejectedCount int64 `json:"rejectedCount"`
|
||||
RejectedAmount int64 `json:"rejectedAmount"`
|
||||
}
|
||||
|
||||
type RechargeOrderViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#充值单ID不能为空|充值单ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *RechargeOrderViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type RechargeReviewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#充值单ID不能为空|充值单ID不能为空"`
|
||||
Decision int `json:"decision" v:"required|in:1,2#审核结论不能为空|审核结论不合法"`
|
||||
PaidAmount int64 `json:"paidAmount" v:"min:0#实付金额不能小于0"`
|
||||
ExternalNo string `json:"externalNo" v:"max-length:128#外部单号不能超过128个字符"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码不能超过64个字符"`
|
||||
ReasonText string `json:"reasonText" v:"max-length:500#审核说明不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *RechargeReviewInp) Filter(ctx context.Context) error {
|
||||
if in.Decision == consts.FinanceDecisionApprove && in.PaidAmount <= 0 {
|
||||
return gerror.New("审核通过时实付金额必须大于0")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type FinanceExecuteInp struct {
|
||||
ApprovalId uint64 `json:"approvalId" v:"required|min:1#审批ID不能为空|审批ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *FinanceExecuteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WithdrawalOrderListInp struct {
|
||||
form.PageReq
|
||||
WithdrawalNo string `json:"withdrawalNo"`
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
WithdrawalStatus int `json:"withdrawalStatus"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *WithdrawalOrderListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WithdrawalOrderListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
WithdrawalNo string `json:"withdrawalNo"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
Username string `json:"username"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
AvailableAmount int64 `json:"availableAmount"`
|
||||
FrozenAmount int64 `json:"frozenAmount"`
|
||||
RequestAmount int64 `json:"requestAmount"`
|
||||
FeeAmount int64 `json:"feeAmount"`
|
||||
ActualAmount int64 `json:"actualAmount"`
|
||||
Currency string `json:"currency"`
|
||||
AccountMask string `json:"accountMask"`
|
||||
BankName string `json:"bankName"`
|
||||
HolderMask string `json:"holderMask"`
|
||||
PaymentAccountType int `json:"paymentAccountType"`
|
||||
QrCodeUrl string `json:"qrCodeUrl"`
|
||||
RiskResult *gjson.Json `json:"riskResult"`
|
||||
WithdrawalStatus int `json:"withdrawalStatus"`
|
||||
ReviewReasonCode string `json:"reviewReasonCode"`
|
||||
ReviewReason string `json:"reviewReason"`
|
||||
ApprovalRequestId uint64 `json:"approvalRequestId"`
|
||||
ExternalNo string `json:"externalNo"`
|
||||
FreezeLedgerId uint64 `json:"freezeLedgerId"`
|
||||
FinalLedgerId uint64 `json:"finalLedgerId"`
|
||||
ReviewedAt *gtime.Time `json:"reviewedAt"`
|
||||
ProcessedAt *gtime.Time `json:"processedAt"`
|
||||
CompletedAt *gtime.Time `json:"completedAt"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type WithdrawalOrderViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#提现单ID不能为空|提现单ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *WithdrawalOrderViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WithdrawalReviewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#提现单ID不能为空|提现单ID不能为空"`
|
||||
Decision int `json:"decision" v:"required|in:1,2#审核结论不能为空|审核结论不合法"`
|
||||
ReasonCode string `json:"reasonCode" v:"required|max-length:64#原因编码不能为空|原因编码不能超过64个字符"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#审核说明不能为空|审核说明不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *WithdrawalReviewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type WithdrawalCompleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#提现单ID不能为空|提现单ID不能为空"`
|
||||
Success bool `json:"success"`
|
||||
ExternalNo string `json:"externalNo" v:"max-length:128#外部单号不能超过128个字符"`
|
||||
ReasonText string `json:"reasonText" v:"required|max-length:500#处理说明不能为空|处理说明不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *WithdrawalCompleteInp) Filter(ctx context.Context) error {
|
||||
if in.Success && strings.TrimSpace(in.ExternalNo) == "" {
|
||||
return gerror.New("付款成功时外部付款单号不能为空")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CustomerServiceListInp struct {
|
||||
form.PageReq
|
||||
Name string `json:"name"`
|
||||
Status int `json:"status"`
|
||||
}
|
||||
|
||||
func (in *CustomerServiceListInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type CustomerServiceEditInp struct {
|
||||
Id uint64 `json:"id"`
|
||||
ServiceCode string `json:"serviceCode" v:"required|max-length:32#客服编码不能为空|客服编码不能超过32个字符"`
|
||||
Name string `json:"name" v:"required|max-length:100#客服名称不能为空|客服名称不能超过100个字符"`
|
||||
AvatarUrl string `json:"avatarUrl" v:"max-length:1000#头像地址不能超过1000个字符"`
|
||||
WorkTime string `json:"workTime" v:"required|max-length:200#工作时间不能为空|工作时间不能超过200个字符"`
|
||||
OnlineStatus int `json:"onlineStatus" v:"required|in:1,2#在线状态不能为空|在线状态不合法"`
|
||||
ServiceUrl string `json:"serviceUrl" v:"required|max-length:1000#客服链接不能为空|客服链接不能超过1000个字符"`
|
||||
BackupContact string `json:"backupContact" v:"required|max-length:500#备用联系方式不能为空|备用联系方式不能超过500个字符"`
|
||||
SessionMapping *gjson.Json `json:"sessionMapping"`
|
||||
Status int `json:"status" d:"1" v:"required|in:1,2#状态不能为空|状态不合法"`
|
||||
Sort int `json:"sort"`
|
||||
Remark string `json:"remark" v:"max-length:500#备注不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *CustomerServiceEditInp) Filter(ctx context.Context) error {
|
||||
u, err := url.Parse(in.ServiceUrl)
|
||||
if err != nil || !strings.EqualFold(u.Scheme, "https") || u.Host == "" {
|
||||
return gerror.New("客服链接必须是有效的 HTTPS 地址")
|
||||
}
|
||||
if in.OnlineStatus != consts.CustomerServiceOnline && in.OnlineStatus != consts.CustomerServiceOffline {
|
||||
return gerror.New("客服在线状态不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CustomerServiceViewInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#客服ID不能为空|客服ID不能为空"`
|
||||
}
|
||||
|
||||
func (in *CustomerServiceViewInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type CustomerServiceStatusInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#客服ID不能为空|客服ID不能为空"`
|
||||
Status int `json:"status" v:"required|in:1,2#状态不能为空|状态不合法"`
|
||||
}
|
||||
|
||||
func (in *CustomerServiceStatusInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type CustomerServiceDeleteInp struct {
|
||||
Id uint64 `json:"id" v:"required|min:1#客服ID不能为空|客服ID不能为空"`
|
||||
Reason string `json:"reason" v:"required|max-length:500#删除原因不能为空|删除原因不能超过500个字符"`
|
||||
}
|
||||
|
||||
func (in *CustomerServiceDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type CustomerServiceListModel struct {
|
||||
*entity.CustomerService
|
||||
}
|
||||
Reference in New Issue
Block a user