|
|
@@ -31,6 +31,7 @@ type WebBriefInfo struct {
|
|
|
FightPower uint32
|
|
|
ActiveCode string
|
|
|
OpenId string
|
|
|
+ Serverid int //所属区服
|
|
|
}
|
|
|
type WebUserDetailInfo struct {
|
|
|
WebBriefInfo
|
|
|
@@ -245,6 +246,125 @@ func WebGmProcessUserInfoGet(c *gin.Context) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 东南亚支付服务使用
|
|
|
+func WebGmProcessUserListGet(c *gin.Context) {
|
|
|
+ if !verifyProcess(c) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var errStr = ""
|
|
|
+ uidStr := c.DefaultQuery("userId", "") ///default ""
|
|
|
+ //uid, _ := model.Str2NumU64(uidStr)
|
|
|
+ if uidStr == "" {
|
|
|
+ errStr = "uid invalid!!!"
|
|
|
+ util.InfoF(errStr)
|
|
|
+ c.JSON(http.StatusOK, gin.H{
|
|
|
+ "err": errStr,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取简介信息
|
|
|
+ bfInfoList := make([]*Uid, 0)
|
|
|
+ if len(service.GetMysqlPay()) > 0 {
|
|
|
+ for _, v := range service.GetMysqlPay() {
|
|
|
+ var bfInfo *WebBriefInfo = nil
|
|
|
+ v.Operate(func(rawClient interface{}) interface{} {
|
|
|
+ wrapper := mysql.NewWrapper(rawClient.(*sql.DB))
|
|
|
+
|
|
|
+ wrapper.Query("select * from role where open_id=?", uidStr).Each(func(wrapper2 *mysql.Wrapper) bool {
|
|
|
+ bfInfo = parseUserInfo(wrapper2)
|
|
|
+
|
|
|
+ return true
|
|
|
+ })
|
|
|
+
|
|
|
+ if wrapper.Err != nil {
|
|
|
+ util.ErrorF("uid=%v WebGmProcessUserGet err=%v", uidStr, wrapper.Err)
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+ })
|
|
|
+ bfInfoList = append(bfInfoList, &Uid{Uid: strconv.FormatUint(bfInfo.Uid, 10), Server: strconv.Itoa(bfInfo.Serverid / 2), CharacterName: bfInfo.NickName})
|
|
|
+ }
|
|
|
+ if len(bfInfoList) == 0 {
|
|
|
+ c.JSON(http.StatusOK, gin.H{
|
|
|
+ "err": "玩家不存在!!!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ c.JSON(http.StatusOK, UserList{UserId: uidStr, Uids: bfInfoList})
|
|
|
+}
|
|
|
+
|
|
|
+// 东南亚支付服务使用
|
|
|
+func WebGmProcessUserListCheck(c *gin.Context) {
|
|
|
+ if !verifyProcess(c) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var errStr = ""
|
|
|
+ uidStr := c.DefaultQuery("uid", "") ///default ""
|
|
|
+ uid, _ := model.Str2NumU64(uidStr)
|
|
|
+ if uidStr == "" || uid == 0 {
|
|
|
+ errStr = "uid invalid!!!"
|
|
|
+ util.InfoF(errStr)
|
|
|
+ c.JSON(http.StatusOK, gin.H{
|
|
|
+ "err": errStr,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取简介信息
|
|
|
+ var bfInfo *WebBriefInfo = nil
|
|
|
+ if len(service.GetMysqlPay()) > 0 {
|
|
|
+ for _, v := range service.GetMysqlPay() {
|
|
|
+ v.Operate(func(rawClient interface{}) interface{} {
|
|
|
+ wrapper := mysql.NewWrapper(rawClient.(*sql.DB))
|
|
|
+
|
|
|
+ wrapper.Query("select * from role where uid=?", uid).Each(func(wrapper2 *mysql.Wrapper) bool {
|
|
|
+ bfInfo = parseUserInfo(wrapper2)
|
|
|
+
|
|
|
+ return true
|
|
|
+ })
|
|
|
+
|
|
|
+ if wrapper.Err != nil {
|
|
|
+ util.ErrorF("uid=%v WebGmProcessUserGet err=%v", uid, wrapper.Err)
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if bfInfo == nil {
|
|
|
+ c.JSON(http.StatusOK, gin.H{
|
|
|
+ "err": "玩家不存在!!!",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ callBackKey := "http://165.154.215.99:80"
|
|
|
+ if bfInfo.Serverid <= 10 {
|
|
|
+ callBackKey = callBackKey + "0" + strconv.Itoa(bfInfo.Serverid-1) + "/pay/hwDn"
|
|
|
+ } else {
|
|
|
+ callBackKey = callBackKey + strconv.Itoa(bfInfo.Serverid-1) + "/pay/hwDn"
|
|
|
+ }
|
|
|
+ c.JSON(http.StatusOK, CheckUser{CharacterName: bfInfo.NickName, Server: strconv.Itoa(bfInfo.Serverid / 2), CallBackKey: callBackKey})
|
|
|
+}
|
|
|
+
|
|
|
+type UserList struct {
|
|
|
+ UserId string `json:"userId"`
|
|
|
+ Uids []*Uid `json:"uids"`
|
|
|
+}
|
|
|
+
|
|
|
+type Uid struct {
|
|
|
+ Uid string `json:"uid"`
|
|
|
+ Server string `json:"server"`
|
|
|
+ CharacterName string `json:"characterName"`
|
|
|
+}
|
|
|
+
|
|
|
+type CheckUser struct {
|
|
|
+ Server string `json:"server"`
|
|
|
+ CharacterName string `json:"characterName"`
|
|
|
+ CallBackKey string `json:"callBackKey"`
|
|
|
+}
|
|
|
+
|
|
|
// 封号
|
|
|
// http://127.0.0.1:8086/gm/ban?uid=1111&ban=1
|
|
|
func WebGmProcessBanUser(c *gin.Context) {
|