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
+49
View File
@@ -0,0 +1,49 @@
package currencyser
import (
"91porn-server/common/stderr"
"91porn-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
}