ソースを参照

Merge remote-tracking branch 'origin/master'

master
huangjiajun 8ヶ月前
コミット
aefaff835b
3個のファイルの変更26行の追加15行の削除
  1. +5
    -4
      md/mq.go
  2. +0
    -3
      rule/one_circles/coin_settlement.go
  3. +21
    -8
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go

+ 5
- 4
md/mq.go ファイルの表示

@@ -3,10 +3,11 @@ package md
const OneCirclesExchange = "one.circles"

const (
OneCirclesRoutKeyForSignIn = "sign_in" // 签到
OneCirclesRoutKeyForStarLevelDividend = "star_level_dividend" // 星级分红
OneCirclesRoutKeyForAutoExchangeGreenEnergyToPerson = "auto_exchange_green_energy_to_person" // 自动兑换个人绿色能量
OneCirclesRoutKeyForAutoExchangeGreenEnergyToTeam = "auto_exchange_green_energy_to_team" // 自动兑换团队绿色能量
OneCirclesRoutKeyForSignIn = "sign_in" // 签到
OneCirclesRoutKeyForStarLevelDividend = "star_level_dividend" // 星级分红
OneCirclesRoutKeyForAutoExchangeGreenEnergyToPerson = "auto_exchange_green_energy_to_person" // 自动兑换个人绿色能量
OneCirclesRoutKeyForAutoExchangeGreenEnergyToTeam = "auto_exchange_green_energy_to_team" // 自动兑换团队绿色能量
OneCirclesRoutKeyForSettlementPublicGiveActivityCoin = "settlement_public_give_activity_coin" // 计算观看激励视屏得到活跃积分
)

type OneCirclesStructForSignIn struct {


+ 0
- 3
rule/one_circles/coin_settlement.go ファイルの表示

@@ -15,9 +15,6 @@ import (
"xorm.io/xorm"
)

const PessimismLockKey = "daily_settlement_block_star_chain_pessimism_lock_key"
const PessimismLockValue = "running"

// DealUserCoin 处理给用户虚拟币积分
func DealUserCoin(session *xorm.Session, req md.DealUserCoinReq) (err error) {
if req.Amount < 0 {


+ 21
- 8
rule/one_circles/one_circles_public_platoon_give_activty_coin.go ファイルの表示

@@ -1,6 +1,7 @@
package one_circles

import (
"code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git/rabbit"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/db/model"
"code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/md"
@@ -17,7 +18,7 @@ import (
)

// SettlementPublicGiveActivityCoin 计算观看激励视屏得到活跃积分
func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid int) (err error) {
func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid int, ch *rabbit.Channel) (err error) {
//1、查找 `one_circles_public_platoon_basic_setting` 基础设置
oneCirclesPublicPlatoonBasicSetting, err := db.OneCirclesPublicPlatoonBasicSettingGetOneByParams(engine, map[string]interface{}{
"key": "is_open",
@@ -182,7 +183,8 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid

//给相应的用户加上"团队"活跃积分
for _, vv := range rewardFather {
err = DealUserCoin(session, md.DealUserCoinReq{
//TODO::推入rabbitmq 异步处理
ch.Publish(md.OneCirclesExchange, md.DealUserCoinReq{
Kind: "add",
Mid: masterId,
Title: md.OneCirclesWatchAdRewardTeamActiveCoin,
@@ -191,12 +193,23 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid
CoinId: oneCirclesPublicPlatoonBasicSetting.TeamActivePointsCoinId,
Uid: vv.Uid,
Amount: vv.RewardValue,
})
if err != nil {
_ = session.Rollback()
fmt.Println("err:::::2222", err)
return err
}
}, md.OneCirclesRoutKeyForSettlementPublicGiveActivityCoin)

//err = DealUserCoin(session, md.DealUserCoinReq{
// Kind: "add",
// Mid: masterId,
// Title: md.OneCirclesWatchAdRewardTeamActiveCoin,
// TransferType: md.OneCirclesWatchAdRewardTeamActiveCoinForUserVirtualCoinFlow,
// OrdId: "",
// CoinId: oneCirclesPublicPlatoonBasicSetting.TeamActivePointsCoinId,
// Uid: vv.Uid,
// Amount: vv.RewardValue,
//})
//if err != nil {
// _ = session.Rollback()
// fmt.Println("err:::::2222", err)
// return err
//}
}
err = session.Commit()
if err != nil {


読み込み中…
キャンセル
保存