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
+49
View File
@@ -0,0 +1,49 @@
package currencyser
import (
"91jd-server/common/stderr"
"91jd-server/models/v/currencymod"
)
// Add 新增裸聊资料
func Add(in *AddCond) stderr.Code {
// 插入数据库
n, err := in.Document()
if err != nil {
return stderr.ErrReqForbidden
}
if err := currencymod.Add(n); err != nil {
return stderr.ErrDbInsertError
}
return stderr.Success
}
// Edit 编辑裸聊资料
func Edit(in *EditCond) stderr.Code {
if err := currencymod.Edit(in.Cond(), in.Update()); err != nil {
return stderr.ErrDbUpdateError
}
return stderr.Success
}
// QueryAll 查询裸聊列表
func QueryAll(in *QueryAllCond) (interface{}, stderr.Code) {
var data = map[string]interface{}{
"data": []interface{}{},
"total": 0,
}
count, err := currencymod.QueryCount(in.Query())
if err != nil {
return data, stderr.ErrDbQueryError
}
if count == 0 {
return data, stderr.Success
}
data["total"] = count
list, err := currencymod.QueryAll(in.Query(), in.Options())
if err != nil {
return data, stderr.ErrDbQueryError
}
data["data"] = list
return data, stderr.Success
}