```
feat(build): 更新构建脚本添加资源打包和proto编译 更新build.bat脚本,添加proto文件编译和资源打包功能,调整资源打包顺序。 BREAKING CHANGE: 构建流程发生变化,需要重新生成proto文件和打包资源。 --- refactor(xmlres): 使用gres替换gfile读取资源文件 将xmlres模块中文件读取方式从gfile.GetBytes改为gres.GetContent, 使
This commit is contained in:
@@ -15,20 +15,38 @@ func NewTaskService() *TaskService {
|
||||
return &TaskService{
|
||||
&cool.Service{
|
||||
Model: model.NewTaskConfig(),
|
||||
PageQueryOp: &cool.QueryOp{
|
||||
FieldEQ: []string{"task_type"},
|
||||
},
|
||||
//UniqueKey: map[string]string{"task_id": "索引不能重复"},
|
||||
},
|
||||
}
|
||||
}
|
||||
func (s *TaskService) Get(id, os uint32) *model.TaskConfig {
|
||||
var item *model.TaskConfig
|
||||
cool.DBM(s.Model).Where("task_id", id).Where("out_state", os).
|
||||
var item []model.TaskConfig
|
||||
cool.DBM(s.Model).Where("task_id", id).
|
||||
Cache(gdb.CacheOption{
|
||||
// Duration: time.Hour,
|
||||
|
||||
Force: false,
|
||||
}).Scan(&item)
|
||||
var res *model.TaskConfig
|
||||
if len(item) == 1 { //只有一个直接默认
|
||||
res = &item[0]
|
||||
}
|
||||
if len(item) > 1 { //
|
||||
|
||||
return item
|
||||
for _, v := range item {
|
||||
if v.OutState == os {
|
||||
res = &item[os]
|
||||
return res
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return res
|
||||
|
||||
}
|
||||
func (s *TaskService) GetDaily() []model.TaskConfig {
|
||||
|
||||
Reference in New Issue
Block a user