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
+36
View File
@@ -0,0 +1,36 @@
package wdtaxmod
import (
"fmt"
"91jd-server/common/db"
"91jd-server/common/log"
"91jd-server/models"
"go.mongodb.org/mongo-driver/bson"
)
const table = models.WithdrawTariff
func coll() *db.MongoTool {
return mdb.Coll(table)
}
func GetWithDrawTariff() (wt WithdrawTariff, err error) {
if err = coll().FindOne(&wt, bson.M{"_id": 1}); err != nil {
log.Warn(fmt.Sprintf("[METHOD-%s]==> Model %s %s fail error:%+v:", "GetWithDrawTariff", table, "FindOne", err))
}
return
}
func UpdateWithDrawTariff(set WithdrawTariffSelector) (modifyCount int64, err error) {
res, err := coll().UpsertOne(bson.M{"_id": 1}, bson.M{
"$set": set,
})
if err != nil {
log.Warn(fmt.Sprintf("[METHOD-%s]==> Model %s %s fail error:%+v:", "UpdateWithDrawTariff", table, "UpsertOne", err))
return
}
modifyCount = res.ModifiedCount
return
}