chore: seed migration objects batch 5
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
package sysin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/dict"
|
||||
|
||||
"github.com/gogf/gf/v2/encoding/gjson"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/os/gtime"
|
||||
)
|
||||
|
||||
type ImFeedbackConfigGetInp struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
}
|
||||
|
||||
func (in *ImFeedbackConfigGetInp) Filter(ctx context.Context) (err error) { return }
|
||||
|
||||
type ImFeedbackConfigModel struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
TenantName string `json:"tenantName" dc:"租户名称"`
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
Categories string `json:"categories" dc:"分类JSON"`
|
||||
MaxLength int `json:"maxLength" dc:"最大字数"`
|
||||
AttachmentPolicy string `json:"attachmentPolicy" dc:"附件策略JSON"`
|
||||
AllowContact int `json:"allowContact" dc:"允许联系方式"`
|
||||
DiagnosticsNotice string `json:"diagnosticsNotice" dc:"诊断信息提示"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt" dc:"更新时间"`
|
||||
}
|
||||
|
||||
type ImFeedbackConfigUpdateInp struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
Categories *gjson.Json `json:"categories" dc:"分类JSON"`
|
||||
MaxLength int `json:"maxLength" dc:"最大字数"`
|
||||
AttachmentPolicy *gjson.Json `json:"attachmentPolicy" dc:"附件策略JSON"`
|
||||
AllowContact int `json:"allowContact" dc:"允许联系方式"`
|
||||
DiagnosticsNotice string `json:"diagnosticsNotice" v:"required#诊断提示不能为空" dc:"诊断信息提示"`
|
||||
}
|
||||
|
||||
func (in *ImFeedbackConfigUpdateInp) Filter(ctx context.Context) (err error) {
|
||||
if in.MaxLength <= 0 {
|
||||
return gerror.New("最大字数必须大于0")
|
||||
}
|
||||
if !dict.HasOptionKey(consts.ImFilePolicySwitchOptions, in.AllowContact) {
|
||||
return gerror.New("联系方式开关不合法")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user