fix: resolve admin acceptance defects
This commit is contained in:
@@ -164,32 +164,44 @@ type AppMemberPaymentListInp struct {
|
||||
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"`
|
||||
Id uint64 `json:"id"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
AccountType int `json:"accountType"`
|
||||
BankCode string `json:"bankCode"`
|
||||
BankName string `json:"bankName"`
|
||||
HolderMask string `json:"holderMask"`
|
||||
IdentityNoMask string `json:"identityNoMask"`
|
||||
MobileMask string `json:"mobileMask"`
|
||||
AccountNoMask string `json:"accountNoMask"`
|
||||
DigitalRMBCodeMask string `json:"digitalRmbCodeMask"`
|
||||
QrAttachmentId uint64 `json:"qrAttachmentId"`
|
||||
WechatQrAttachmentId uint64 `json:"wechatQrAttachmentId"`
|
||||
AlipayQrAttachmentId uint64 `json:"alipayQrAttachmentId"`
|
||||
WechatQrUrl string `json:"wechatQrUrl"`
|
||||
AlipayQrUrl string `json:"alipayQrUrl"`
|
||||
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"`
|
||||
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"`
|
||||
IdentityNo string `json:"identityNo"`
|
||||
Mobile string `json:"mobile" v:"phone-loose#手机号格式不正确"`
|
||||
AccountNo string `json:"accountNo"`
|
||||
DigitalRMBCode string `json:"digitalRmbCode"`
|
||||
QrAttachmentId uint64 `json:"qrAttachmentId"`
|
||||
WechatQrAttachmentId uint64 `json:"wechatQrAttachmentId"`
|
||||
AlipayQrAttachmentId uint64 `json:"alipayQrAttachmentId"`
|
||||
WechatQrUrl string `json:"wechatQrUrl"`
|
||||
AlipayQrUrl string `json:"alipayQrUrl"`
|
||||
VerifyStatus int `json:"verifyStatus" d:"1"`
|
||||
IsDefault int `json:"isDefault" d:"2"`
|
||||
}
|
||||
|
||||
func (in *AppMemberPaymentEditInp) Filter(ctx context.Context) error {
|
||||
|
||||
@@ -55,14 +55,12 @@ 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 地址")
|
||||
}
|
||||
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 in.Config.TradeBalanceAmount <= 0 || in.Config.TradeWaitSeconds <= 0 || in.Config.DailyTradeLimit <= 0 || in.Config.DailyRewardLimit <= 0 || in.Config.MinimumRechargeAmount <= 0 {
|
||||
return gerror.New("交易余额、支付等待时长、每日次数和最低充值金额必须大于0")
|
||||
}
|
||||
if len(in.Config.CommissionRates) != 6 {
|
||||
return gerror.New("必须配置 0 至 5 级共 6 个佣金比例")
|
||||
@@ -77,11 +75,11 @@ func (in *SiteConfigSaveInp) Filter(ctx context.Context) error {
|
||||
if total > 1 {
|
||||
return gerror.New("各级佣金比例总和不能超过 100%")
|
||||
}
|
||||
if in.Config.AutoOrderDelaySeconds < 0 {
|
||||
return gerror.New("自动派单时间不能为负数")
|
||||
if in.Config.AutoOrderDelaySeconds <= 0 {
|
||||
return gerror.New("自动派单时间必须大于0")
|
||||
}
|
||||
if in.Config.AutoOrderMinAmount < 0 || in.Config.AutoOrderMaxAmount < in.Config.AutoOrderMinAmount {
|
||||
return gerror.New("自动派单最大金额不能小于最小金额")
|
||||
if in.Config.AutoOrderMinAmount <= 0 || in.Config.AutoOrderMaxAmount < in.Config.AutoOrderMinAmount {
|
||||
return gerror.New("自动派单金额必须大于0,且最大金额不能小于最小金额")
|
||||
}
|
||||
for _, ranges := range [][]string{in.Config.WithdrawTimeRanges, in.Config.RechargeTimeRanges, in.Config.TradeTimeRanges, in.Config.SignTimeRanges} {
|
||||
for _, value := range ranges {
|
||||
|
||||
@@ -123,6 +123,7 @@ func (in *ProductDeleteInp) Filter(ctx context.Context) error { return nil }
|
||||
|
||||
type TaskUpdateFields struct {
|
||||
HallId uint64
|
||||
ProductId uint64
|
||||
Title string
|
||||
Description string
|
||||
DetailHtml string
|
||||
@@ -157,10 +158,11 @@ 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"`
|
||||
HallName string `json:"hallName"`
|
||||
ProductName string `json:"productName"`
|
||||
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不能为空"`
|
||||
@@ -178,8 +180,8 @@ 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.HallId == 0 || in.ProductId == 0 || len(in.LevelIds) == 0 {
|
||||
return gerror.New("请选择关联商品、任务大厅和会员等级")
|
||||
}
|
||||
if in.PerMemberLimit == 0 {
|
||||
return gerror.New("单会员任务限制必须大于0")
|
||||
@@ -231,6 +233,8 @@ type TaskSubmissionListModel struct {
|
||||
Id uint64 `json:"id"`
|
||||
SubmissionNo string `json:"submissionNo"`
|
||||
TradeOrderId uint64 `json:"tradeOrderId"`
|
||||
TradeOrderNo string `json:"tradeOrderNo"`
|
||||
ProductName string `json:"productName"`
|
||||
TaskId uint64 `json:"taskId"`
|
||||
TaskTitle string `json:"taskTitle"`
|
||||
MemberId uint64 `json:"memberId"`
|
||||
|
||||
@@ -16,11 +16,12 @@ import (
|
||||
|
||||
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"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
Username string `json:"username"`
|
||||
Mobile string `json:"mobile"`
|
||||
AutoDispatch int `json:"autoDispatch"`
|
||||
OrderStatus int `json:"orderStatus"`
|
||||
CreatedAt []*gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
func (in *TradeOrderListInp) Filter(ctx context.Context) error { return nil }
|
||||
@@ -70,10 +71,36 @@ 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"`
|
||||
TaskId uint64 `json:"taskId"`
|
||||
ProductId uint64 `json:"productId"`
|
||||
MemberLevelId uint64 `json:"memberLevelId"`
|
||||
RuleSnapshot *gjson.Json `json:"ruleSnapshot"`
|
||||
UpdatedAt *gtime.Time `json:"updatedAt"`
|
||||
Timeline []*TradeOrderTimelineModel `json:"timeline"`
|
||||
Ledgers []*TradeOrderLedgerModel `json:"ledgers"`
|
||||
ApprovalActions []*TradeOrderApprovalActionModel `json:"approvalActions"`
|
||||
}
|
||||
|
||||
type TradeOrderTimelineModel struct {
|
||||
Title string `json:"title"`
|
||||
Time *gtime.Time `json:"time"`
|
||||
}
|
||||
type TradeOrderLedgerModel struct {
|
||||
LedgerNo string `json:"ledgerNo"`
|
||||
BizType string `json:"bizType"`
|
||||
Direction int `json:"direction"`
|
||||
Amount int64 `json:"amount"`
|
||||
BeforeAmount int64 `json:"beforeAmount"`
|
||||
AfterAmount int64 `json:"afterAmount"`
|
||||
Remark string `json:"remark"`
|
||||
OccurredAt *gtime.Time `json:"occurredAt"`
|
||||
}
|
||||
type TradeOrderApprovalActionModel struct {
|
||||
StepNo uint `json:"stepNo"`
|
||||
ActorId uint64 `json:"actorId"`
|
||||
Action int `json:"action"`
|
||||
Comment string `json:"comment"`
|
||||
CreatedAt *gtime.Time `json:"createdAt"`
|
||||
}
|
||||
|
||||
type TradeOrderApplyInp struct {
|
||||
|
||||
Reference in New Issue
Block a user