mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
模块化上传驱动,使用泛型优化工具库降低冗余
This commit is contained in:
@@ -124,7 +124,7 @@ func (in *DeptStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
@@ -225,7 +225,7 @@ func (in *MemberStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ type OrderAcceptRefundInp struct {
|
||||
}
|
||||
|
||||
func (in *OrderAcceptRefundInp) Filter(ctx context.Context) (err error) {
|
||||
if !validate.InSliceInt64(consts.OrderStatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.OrderStatusSlice, in.Status) {
|
||||
err = gerror.Newf("订单状态不正确")
|
||||
return
|
||||
}
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// @Copyright Copyright (c) 2023 HotGo CLI
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
//
|
||||
package sysin
|
||||
|
||||
import (
|
||||
@@ -11,28 +10,13 @@ import (
|
||||
"hotgo/internal/model/input/form"
|
||||
)
|
||||
|
||||
// AttachmentMaxSortInp 最大排序
|
||||
type AttachmentMaxSortInp struct {
|
||||
Id int64
|
||||
}
|
||||
|
||||
type AttachmentMaxSortModel struct {
|
||||
Sort int
|
||||
}
|
||||
|
||||
// AttachmentEditInp 修改/新增字典数据
|
||||
type AttachmentEditInp struct {
|
||||
entity.SysAttachment
|
||||
}
|
||||
type AttachmentEditModel struct{}
|
||||
|
||||
// AttachmentDeleteInp 删除字典类型
|
||||
// AttachmentDeleteInp 删除附件
|
||||
type AttachmentDeleteInp struct {
|
||||
Id interface{}
|
||||
}
|
||||
type AttachmentDeleteModel struct{}
|
||||
|
||||
// AttachmentViewInp 获取信息
|
||||
// AttachmentViewInp 获取附件信息
|
||||
type AttachmentViewInp struct {
|
||||
Id int64
|
||||
}
|
||||
@@ -41,7 +25,7 @@ type AttachmentViewModel struct {
|
||||
entity.SysAttachment
|
||||
}
|
||||
|
||||
// AttachmentListInp 获取列表
|
||||
// AttachmentListInp 获取附件列表
|
||||
type AttachmentListInp struct {
|
||||
form.PageReq
|
||||
form.RangeDateReq
|
||||
@@ -54,19 +38,3 @@ type AttachmentListModel struct {
|
||||
entity.SysAttachment
|
||||
SizeFormat string `json:"sizeFormat" description:"长度"`
|
||||
}
|
||||
|
||||
// AttachmentStatusInp 更新状态
|
||||
type AttachmentStatusInp struct {
|
||||
entity.SysAttachment
|
||||
}
|
||||
type AttachmentStatusModel struct{}
|
||||
|
||||
type UploadFileMeta struct {
|
||||
Filename string
|
||||
Size int64
|
||||
Kind string
|
||||
MetaType string
|
||||
NaiveType string
|
||||
Ext string
|
||||
Md5 string
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ func (in *CronGroupStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
@@ -186,7 +186,7 @@ func (in *CurdDemoStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
@@ -114,7 +114,7 @@ func (in *ProvincesStatusInp) Filter(ctx context.Context) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if !validate.InSliceInt(consts.StatusSlice, in.Status) {
|
||||
if !validate.InSlice(consts.StatusSlice, in.Status) {
|
||||
err = gerror.New("状态不正确")
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user