mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-27 14:40:42 +08:00
模块化上传驱动,使用泛型优化工具库降低冗余
This commit is contained in:
@@ -117,7 +117,7 @@ func (in *@{.varName}StatusInp) 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
|
||||
}
|
||||
|
@@ -159,7 +159,7 @@ func (s *s@{.servFunName}) Switch(ctx context.Context, in @{.templateGroup}in.@{
|
||||
// ...
|
||||
}
|
||||
|
||||
if !validate.InSliceString(fields, in.Key) {
|
||||
if !validate.InSlice(fields, in.Key) {
|
||||
err = gerror.New("开关键名不在白名单")
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user