sync: port tangguo_server upstream changes

Ported 7 commits (3a79d6a..3dcf693) from tangguo_server:
- 版本控制: comment out 2FA in admin.go
- 支付和广告调试: pay/ad refactor across appg/adser/rechargeser/pingctrl
- 对接统计: add bili_sync statistics endpoint
- 代码优化: ginUtil improvements
- 修改es/修改appID/代码调整: cumulative updates

Preserved hgmj-local differences:
- ES table prefix stays 91jd_ (not tangguo_)
- BillPlatformID stays 91短剧 (not 糖果短剧)
- admin googauth label stays @91短剧
- appg.go retains LouFengH5/DataBuriedPoint fields
- rechargeser.go retains reportser event reporting

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 17:18:41 +08:00
co-authored by Claude Opus 4.7
parent 625e89c15d
commit 97f679d130
18 changed files with 750 additions and 218 deletions
+31 -12
View File
@@ -14,11 +14,23 @@ import (
)
type PayTypeParam struct {
Moneys []int64 `json:"moneys"`
DevType string `json:"devType"`
ProductType int `json:"productType"` //产品类型 0站群 1棋牌
UserLevel int `json:"userLevel"` //限定用户层级 (0默认无等级 1充值成功过的1等级)
PlatformID string `json:"platformID"` //平台
Moneys []int64 `json:"moneys"`
DevType string `json:"devType"`
ProductType int `json:"productType"` //产品类型 0站群 1棋牌
UserLevel int `json:"userLevel"` //限定用户层级 (0默认无等级 1充值成功过的1等级)
PlatformID string `json:"platformID"` //平台
DistrictCode string `json:"districtCode"` //用户渠道码 支付中心据此绑定可用支付渠道
}
// BillPlatformID 账单中心平台标识
const BillPlatformID = "91短剧"
// billDevType 账单中心设备类型,非android按ios处理
func billDevType(devType string) string {
if devType != "android" {
return "ios"
}
return devType
}
type RchgType struct {
@@ -40,13 +52,19 @@ type StdMsg struct {
// GetPayType 从支付中心获取充值金额对应的充值方式
func GetPayType(ctx context.Context, moneys []int64, devType string, productType, userLevel int) ([]RchgType, error) {
return GetPayTypeByDistrict(ctx, moneys, devType, productType, userLevel, "")
}
// GetPayTypeByDistrict 从支付中心获取充值金额对应的充值方式(按用户渠道码匹配)
func GetPayTypeByDistrict(ctx context.Context, moneys []int64, devType string, productType, userLevel int, districtCode string) ([]RchgType, error) {
var errlog string
p := PayTypeParam{
moneys,
devType,
productType,
userLevel,
"91短剧",
Moneys: moneys,
DevType: billDevType(devType),
ProductType: productType,
UserLevel: userLevel,
PlatformID: BillPlatformID,
DistrictCode: districtCode,
}
res := StdMsg{}
code, err := httputil.DefaultClientPostJsonWithResp(&res, p.GetURL(), nil, p.GetBody())
@@ -143,14 +161,15 @@ func (this *Rchg) ToPayNew(ctx context.Context) (res RchgMsg, err error) {
// GetURL 获取请求地址
func (this *Rchg) fill() {
this.PlatformID = "91短剧"
this.PlatformID = BillPlatformID
if this.ProductType == 0 {
this.TransNo = RChgIDAssemble(this.TransNo)
}
if this.ProductType == 1 {
this.TransNo = RChgWLIDAssemble(this.TransNo)
}
this.NotifyUrl = appg.Conf.URL.LocalWebUrl + RCHG_NOTIFY_URL + "bill"
// 回调路由 /3rd/defray/callback/rchg/:name 挂在 app 服务上
this.NotifyUrl = appg.Conf.PayCenter.CallbackUrl + RCHG_NOTIFY_URL + "bill"
this.PType = this.PayMethod
}