Procházet zdrojové kódy

update 添加货币类型、资产操作类型注释,并取消校验

Alvin před 8 měsíci
rodič
revize
c39c23b5b5

+ 2 - 2
game/game_cluster/internal/mdb/eventmodels/assetsEvent.go

@@ -4,8 +4,8 @@ package eventmodels
 type AssetsEventContent struct {
 	UserBasic
 	EventBasic
-	OperationType string `json:"operation_type"` // 操作类型 增加:increase;减少:decrease
-	Currency      string `json:"currency"`       // 货币类型
+	OperationType string `json:"operation_type"` // 操作类型 范围:constant.OperationTypeStr 增加:increase;减少:decrease
+	Currency      string `json:"currency"`       // 货币类型 范围:constant.CurrencyTypeStr
 	Reason        string `json:"reason"`         // 变动原因
 	BeforeBalance int64  `json:"before_balance"` // 变动前余额
 	Amount        int64  `json:"amount"`         // 变动金额

+ 1 - 1
game/game_cluster/internal/mdb/eventmodels/userWithdrawEvent.go

@@ -5,7 +5,7 @@ type UserWithdrawEventContent struct {
 	UserBasic
 	EventBasic
 	WithdrawId    string `json:"withdraw_id"`    // 提现记录id
-	Currency      string `json:"currency"`       // 货币类型
+	Currency      string `json:"currency"`       // 货币类型 范围:constant.CurrencyTypeStr
 	Ip            string `json:"ip"`             // IP
 	Platform      string `json:"platform"`       // 平台
 	Channel       string `json:"channel"`        // 渠道

+ 12 - 12
game/game_cluster/nodes/webadmin/service/synthesis.go

@@ -255,10 +255,10 @@ func (s *Synthesis) FindMDBUserLogDaily(req entity.UserLogDailyReq) (*entity.Use
 func (s *Synthesis) FindWithdrawal(req entity.UserWithdrawalReq) (*entity.UserWithdrawalResp, *code.Result) {
 	page, pageSize := checkPageParam(req.Page, req.Size)
 
-	if !constant.CurrencyValid(req.Currency) {
-		mhayaLogger.Warnf("FindWithdrawal unknow currency:%v", req.Currency)
-		return nil, common.NewResult(code.ParamError)
-	}
+	// if !constant.CurrencyValid(req.Currency) {
+	// 	mhayaLogger.Warnf("FindWithdrawal unknow currency:%v", req.Currency)
+	// 	return nil, common.NewResult(code.ParamError)
+	// }
 
 	var records []*eventmodels.UserWithdrawEventContent
 
@@ -933,15 +933,15 @@ func (s *Synthesis) Assets(req entity.AssetsReq) (*entity.AssetsResp, *code.Resu
 func (s *Synthesis) AssetsRecord(req entity.AssetsRecordReq) (*entity.AssetsRecordResp, *code.Result) {
 	page, pageSize := checkPageParam(req.Page, req.Size)
 
-	if !constant.CurrencyValid(req.Currency) {
-		mhayaLogger.Warnf("AssetsRecord unknow currency:%v", req.Currency)
-		return nil, common.NewResult(code.ParamError)
-	}
+	// if !constant.CurrencyValid(req.Currency) {
+	// 	mhayaLogger.Warnf("AssetsRecord unknow currency:%v", req.Currency)
+	// 	return nil, common.NewResult(code.ParamError)
+	// }
 
-	if req.OperationType != string(constant.IncreaseOp) && req.OperationType != string(constant.DecreaseOp) {
-		mhayaLogger.Warnf("AssetsRecord unknow OperationType:%v", req.OperationType)
-		return nil, common.NewResult(code.ParamError)
-	}
+	// if req.OperationType != string(constant.IncreaseOp) && req.OperationType != string(constant.DecreaseOp) {
+	// 	mhayaLogger.Warnf("AssetsRecord unknow OperationType:%v", req.OperationType)
+	// 	return nil, common.NewResult(code.ParamError)
+	// }
 
 	var records []*eventmodels.AssetsEventContent