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
+22
View File
@@ -0,0 +1,22 @@
package wdtaxmod
import "91porn-server/common/db"
// WithdrawTariff 提现税率配置修改
type WithdrawTariff struct {
ID int `bson:"_id"`
CashTax int `json:"cashTax,omitempty" bson:"cashTax"` // 代理提现比率
CoinTax int `json:"coinTax,omitempty" bson:"coinTax"` // 金币提现比率
DiscCashTax int `json:"discCashTax,omitempty" bson:"discCashTax"` // 商区自提现比率
DiscFinanceTax int `json:"discFinanceTax,omitempty" bson:"discFinanceTax"` // 商区财务打款比率
GameTax int `json:"gameTax" bson:"gameTax"` // qp提现比率
SuperUserCoinTax int `json:"superUserCoinTax,omitempty" bson:"superUserCoinTax"` // 大V金币提现比率
}
var (
mdb *db.MongoDB
)
func Init() {
mdb = db.Init(table)
}
+10
View File
@@ -0,0 +1,10 @@
package wdtaxmod
// WithdrawTariffSelector 提现税率配置修改
type WithdrawTariffSelector struct {
CashTax *int `json:"cashTax,omitempty" bson:"cashTax,omitempty"` //代理提现比率
CoinTax *int `json:"coinTax,omitempty" bson:"coinTax,omitempty"` //金币提现比率
DiscCashTax *int `json:"discCashTax,omitempty" bson:"discCashTax,omitempty"` //商区提现比率
DiscFinanceTax *int `json:"discFinanceTax,omitempty" bson:"discFinanceTax,omitempty"` //商区财务打款比率
GameTax *int `json:"gameTax,omitempty" bson:"gameTax,omitempty"` //qp提现比率
}
+36
View File
@@ -0,0 +1,36 @@
package wdtaxmod
import (
"fmt"
"91porn-server/common/db"
"91porn-server/common/log"
"91porn-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
}