init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
package taskser
import (
"time"
"91jd-server/common/stderr"
"91jd-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
}