| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package proto
- import (
- "bet24.com/log"
- "bet24.com/servers/micros/common"
- "context"
- )
- func GoldTransfer(userId, toUserId, amount int, ipAddress string) (bool, string) {
- xclient := getClient()
- //defer xclient.Close()
- args := &Request_Transfer{
- UserId: userId,
- ToUserId: toUserId,
- Amount: amount,
- IpAddress: ipAddress,
- }
- reply := &Response_Transfer{}
- err := xclient.Call(context.Background(), "GoldTransfer", args, reply)
- if err != nil {
- log.Debug("GoldTransfer failed to call: %v", err)
- common.GetClientPool().RemoveClient(ServiceName)
- return false, "server error"
- }
- return reply.Success, reply.ErrMsg
- }
- // 赠送日志
- func GetGoldTransferLog(userId int) string {
- xclient := getClient()
- //defer xclient.Close()
- args := &Request_GoldTransferLog{
- UserId: userId,
- }
- reply := &Response_GoldTransferLog{}
- err := xclient.Call(context.Background(), "GetGoldTransferLog", args, reply)
- if err != nil {
- common.GetClientPool().RemoveClient(ServiceName)
- log.Debug("GetGoldTransferLog failed to call: %v", err)
- return ""
- }
- return reply.Data
- }
- // 赠送配置
- func GetGoldTransferConfig(userId int) string {
- xclient := getClient()
- //defer xclient.Close()
- args := &Request_GoldTransferLog{
- UserId: userId,
- }
- reply := &Response_GoldTransferLog{}
- err := xclient.Call(context.Background(), "GetGoldTransferConfig", args, reply)
- if err != nil {
- common.GetClientPool().RemoveClient(ServiceName)
- log.Debug("GetGoldTransferConfig failed to call: %v", err)
- return ""
- }
- return reply.Data
- }
|