使用action代替api单个操作

改写job
This commit is contained in:
linwenxiang committed 2020-08-29 22:22:52 +08:00
1 parent 78417c2d33
commit 562e61cf4f
15 files changed
+332 -6

No files matched your search

+24 -1
View File
@@ -1,6 +1,7 @@
package tools
import (
"github.com/google/uuid"
"go-admin/tools/config"
"github.com/matchstalk/go-admin-core/search"
@@ -8,8 +9,30 @@ import (
)
type GeneralDelDto struct {
Id string `uri:"id" json:"id" validate:"required"`
Id string `uri:"id" json:"id" validate:"required"`
Ids []string `json:"ids"`
}
func (g GeneralDelDto) GetIds() []string {
ids := make([]string, 0)
if len(g.Ids) > 0 {
for _, id := range g.Ids {
if len(id) > 0 {
ids = append(ids, id)
}
}
} else {
if len(g.Id) > 0 {
ids = append(ids, g.Id)
}
}
if len(ids) <= 0 {
//方式全部删除
ids = append(ids, uuid.New().String())
}
return ids
}
type GeneralGetDto struct {
Id string `uri:"id" json:"id" validate:"required"`
}