Browse Source

一个橘子

one_orenge
huangjiajun 8 months ago
parent
commit
1f3048adec
1 changed files with 2 additions and 15 deletions
  1. +2
    -15
      consume/zhios_user_integral_exchange.go

+ 2
- 15
consume/zhios_user_integral_exchange.go View File

@@ -41,21 +41,8 @@ func CancalUserIntegralExchange(queue md.MqQueue) {
err = handleCancalUserIntegralExchange(res.Body)
//_ = res.Reject(false)
fmt.Println(err)
if err == nil {
_ = res.Ack(true)
} else {
var canalMsg *md.ZhiosAcquisition
var tmpString string
err := json.Unmarshal(res.Body, &tmpString)
if err == nil {
fmt.Println(tmpString)
err = json.Unmarshal([]byte(tmpString), &canalMsg)
if err == nil {
ch.Publish(queue.ExchangeName, utils.SerializeStr(canalMsg), queue.RoutKey)
}
}
_ = res.Ack(true)

}
} else {
panic(errors.New("error getting message"))
}
@@ -96,7 +83,7 @@ func handleCancalUserIntegralExchange(msg []byte) error {
err := CoinExchange(eg, sess, utils.StrToInt(uid), utils.IntToStr(base.CoinId), "cny", amount.Amount, mid)
if err != nil {
sess.Rollback()
return err
return nil
}
}
sess.Commit()


Loading…
Cancel
Save