Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
package taskser
import (
"time"
"91porn-server/common/stderr"
"91porn-server/models/v/taskmod"
)
func AddConfig(in taskmod.AddConfigCond) stderr.Code {
if err := taskmod.AddConfig(taskmod.TaskConfig{
Title: in.Title,
Desc: in.Desc,
Type: in.Type,
Detail: in.Detail,
Link: in.Link,
Status: in.Status,
UpdateTime: time.Now(),
CreateTime: time.Now(),
}); err != nil {
return stderr.ErrDbInsertError
}
return stderr.Success
}
func ModifyConfig(in *taskmod.ModifyConfigCond) stderr.Code {
if err := taskmod.ModifyConfig(in.Cond(), in.Bson()); err != nil {
return stderr.ErrDbUpdateError
}
return stderr.Success
}
func QueryAllConfig(in *taskmod.QueryAllConfigCond) (interface{}, stderr.Code) {
var data map[string]interface{} = map[string]interface{}{
"list": []interface{}{},
"count": 0,
}
count, err := taskmod.CountConfig(in.Query())
if err != nil {
return nil, stderr.ErrDbQueryError
}
if count == 0 {
return data, stderr.Success
}
data["count"] = count
list, err := taskmod.QueryAllConfig(in.Query(), in.Options())
if err != nil {
return nil, stderr.ErrDbQueryError
}
data["list"] = list
return data, stderr.Success
}