Browse Source

debug

master
linquan 1 month ago
parent
commit
9195b48d21
  1. 33
      api/v1/game/basicinfo.go
  2. 304
      api/v1/game/ccd.go
  3. 6
      api/v1/game/cdKey.go
  4. 36
      api/v1/game/channel.go
  5. 104
      api/v1/game/gameConfig.go
  6. 123
      api/v1/game/loginUrl.go
  7. 6
      api/v1/game/mail.go
  8. 251
      api/v1/game/manage.go
  9. 85
      api/v1/game/model.go
  10. 7
      api/v1/game/notice.go
  11. 12
      api/v1/game/order.go
  12. 110
      api/v1/game/pub.go
  13. 22
      api/v1/game/rebate.go
  14. 105
      api/v1/game/serverConfig.go
  15. 76
      api/v1/game/set.go
  16. 37
      api/v1/game/version.go
  17. 104
      api/v1/game/whiteList.go
  18. 33
      internal/controller/game_channel.go
  19. 5
      internal/controller/game_login_url.go
  20. 1
      internal/router/router.go
  21. 3
      internal/service/aliyunSms.go
  22. 2
      internal/service/email.go
  23. 22
      internal/service/tencentSms.go
  24. 93
      internal/serviceGame/channel.go
  25. 70
      internal/serviceGame/internal/dbinit.go
  26. 12
      internal/serviceGame/loginUrl.go
  27. 2
      internal/serviceGame/order.go

33
api/v1/game/basicinfo.go

@ -22,17 +22,6 @@ type RoleSearchRes struct {
Total int64 `json:"total"`
}
//type RoleDetailReq struct {
// g.Meta `path:"/basicinfo/detail" tags:"角色详情" method:"get" summary:"详情"`
// Uid int64 `p:"Uid" v:"required#角色ID不能为空"`
// //Channel int `p:"channel" v:"required#渠道不能为空"`
//}
//
//type RoleDetailRes struct {
// g.Meta `mime:"application/json"`
// RoleDetail *entity.Unit `json:"roleDetail"`
//}
type RoleOnlineReq struct {
g.Meta `path:"/basicinfo/online" tags:"留存记录" method:"get" summary:"玩家在线列表"`
ServerId int32 `p:"serverId" `
@ -62,17 +51,6 @@ type RoleOnlineTopRes struct {
Total int `json:"total"`
}
//type AccountListReq struct {
// g.Meta `path:"/basicinfo/accountList" tags:"账号数据" method:"get" summary:"总服账号数据"`
// Ident string `p:"ident"`
// Name string `p:"name"`
//}
//
//type AccountListRes struct {
// g.Meta `mime:"application/json"`
// Accounts []*entity.Account `json:"list"`
//}
type AccountReq struct {
g.Meta `path:"/basicinfo/account" tags:"账号数据" method:"get" summary:"账号数据"`
Id string `p:"id"`
@ -146,6 +124,7 @@ type GetShopItemLogReq struct {
Channel string `p:"channel" `
common.PageReq
}
type GetShopItemLogRes struct {
g.Meta `mime:"application/json"`
Logs []ShopItemLog `json:"logs"`
@ -253,13 +232,3 @@ type UserDelRes struct {
g.Meta `mime:"application/json"`
Data int `p:"data"`
}
type DelAccountReq struct {
g.Meta `path:"/mange/delAccount" tags:"账号" method:"get" summary:"删除账号"`
SrcName string `p:"SrcName"`
ServerId int `p:"serverId"`
Password string `p:"password"`
}
type DelAccountRes struct {
}

304
api/v1/game/ccd.go

@ -2,7 +2,6 @@ package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
@ -46,291 +45,36 @@ type DelCCDReq struct {
type DelCCDRes struct {
}
type GetLoginUrlReq struct {
g.Meta `path:"/loginUrl/getLoginUrl" tags:"登录地址" method:"post" summary:"loginUrl"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
type GetGameCCDReq struct {
g.Meta `path:"/ccd/get" tags:"外部接口" method:"post" summary:"登录地址"`
ChannelType string `p:"channelType"`
Platform string `p:"platform"`
VersionName string `p:"versionName"`
HotfixVersion string `p:"hotfixVersion"`
VersionCode string `p:"versionCode"`
Version string `p:"version"`
}
type GetLoginUrlRes struct {
g.Meta `mime:"application/json"`
LoginUrlList []entity.GameLoginUrl `json:"loginUrlList"`
Total int `json:"total"`
type GetGameCCDRes struct {
g.Meta `mime:"application/json"`
Url string `json:"url"`
Version string `json:"version"`
AuditMode int32 `json:"auditMode"`
EnableHotfix int32 `json:"enableHotfix"`
EnableAccountLogin int32 `json:"enableAccountLogin"`
}
type GetAllLoginUrlReq struct {
g.Meta `path:"/loginUrl/getAllLoginUrl" tags:"登录地址" method:"post" summary:"allLoginUrl"`
type GetGameCCD1Req struct {
g.Meta `path:"/ccd1/get" tags:"外部接口" method:"post" summary:"登录地址"`
ChannelType string `p:"channelType"`
Platform string `p:"platform"`
VersionName string `p:"versionName"`
HotfixVersion string `p:"hotfixVersion"`
VersionCode string `p:"versionCode"`
Version string `p:"version"`
}
type GetAllLoginUrlRes struct {
g.Meta `mime:"application/json"`
LoginUrlList []entity.GameLoginUrl `json:"loginUrlList"`
}
type AddLoginUrlReq struct {
g.Meta `path:"/loginUrl/addLoginUrl" tags:"登录地址" method:"post" summary:"添加loginUrl"`
Id int `p:"id"`
Host string `p:"host"`
Port int `p:"port"`
State string `p:"state"`
Recommend string `p:"recommend"`
IsNew string `p:"isNew"`
}
type AddLoginUrlRes struct {
}
type AddNewLoginUrlReq struct {
g.Meta `path:"/loginUrl/addNewLoginUrl" tags:"登录地址" method:"post" summary:"添加loginUrl"`
Id int `p:"id"`
Host string `p:"host"`
Port int `p:"port"`
State int `p:"state"`
Recommend int `p:"recommend"`
Name string `p:"name"`
RechargeHost string `p:"rechargeHost"`
RechargePort int `p:"rechargePort"`
Area int `p:"area"`
IsShow int `p:"isShow"`
Channel string `p:"channel"`
GameDbUrl string `p:"gameDbUrl"`
GameDbName string `p:"gameDbName"`
Platform int `p:"platform"`
InnerIp string `p:"innerIp"`
CreateTime string `p:"createTime"`
Remark string `p:"remark"`
Difficulty int `p:"difficulty"`
}
type AddNewLoginUrlRes struct {
}
type GetServerConfigGeneralReq struct {
g.Meta `path:"/serverConfig/getGeneral" tags:"系统配置" method:"post" summary:"ServerConfig"`
}
type GetServerConfigGeneralRes struct {
g.Meta `mime:"application/json"`
List []entity.GameServerJsonGeneral `json:"list"`
}
type AddServerConfigGeneralReq struct {
g.Meta `path:"/serverConfig/addGeneral" tags:"系统配置" method:"post" summary:"修改generalServerConfig"`
Id int `p:"id"`
BackstageRechargeUrl string `p:"backstageRechargeUrl"`
GmWhiteListUrl string `p:"gmWhiteListUrl"`
IdentityCheckAddress string `p:"identityCheckAddress"`
RechargeWhiteListIps string `p:"rechargeWhiteListIps"`
SdkAddress string `p:"sdkAddress"`
UniqueAddress string `p:"uniqueAddress"`
}
type AddServerConfigGeneralRes struct {
}
type AddServerConfigReq struct {
g.Meta `path:"/serverConfig/add" tags:"服务器配置" method:"post" summary:"修改ServerConfig"`
Id int `p:"id"`
GameDbUrl string `p:"gameDbUrl"`
GameDbName string `p:"gameDbName"`
Platform int `p:"platform"`
InnerIp string `p:"innerIp"`
CreateTime string `p:"createTime"`
Remark string `p:"remark"`
Difficulty int `p:"difficulty"`
Channel string `p:"channel"`
}
type AddServerConfigRes struct {
}
type GetRouterReq struct {
g.Meta `path:"/serverConfig/getRouter" tags:"服务器配置" method:"post" summary:"router"`
common.PageReq
}
type GetRouterRes struct {
g.Meta `mime:"application/json"`
List []entity.GameRouter `json:"list"`
common.ListRes
}
type AddRouterReq struct {
g.Meta `path:"/serverConfig/updateRouter" tags:"服务器配置" method:"post" summary:"修改ServerConfig"`
Id int `p:"id"`
RealmIp string `p:"realmIp"`
RealmPort int `p:"realmPort"`
RealmStep int `p:"realmStep"`
RealmNum int `p:"realmNum"`
RouterIp string `p:"routerIp"`
RouterPort int `p:"routerPort"`
RouterStep int `p:"routerStep"`
RouterNum int `p:"routerNum"`
}
type AddRouterRes struct {
}
type DelLoginUrlReq struct {
g.Meta `path:"/loginUrl/delLoginUrl" tags:"登录地址" method:"post" summary:"删除loginUrl"`
Id uint64 `p:"id"`
}
type DelLoginUrlRes struct {
}
type GetVersionReq struct {
g.Meta `path:"/version/get" tags:"版本号" method:"post" summary:"获取"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
}
type GetVersionRes struct {
g.Meta `mime:"application/json"`
Version []entity.GameVersion `json:"version"`
Total int `json:"total"`
}
type UpdateVersionReq struct {
g.Meta `path:"/version/update" tags:"版本号" method:"post" summary:"更新"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type UpdateVersionRes struct {
g.Meta `mime:"application/json"`
}
type DelVersionReq struct {
g.Meta `path:"/version/del" tags:"版本号" method:"post" summary:"删除"`
Id int32 `p:"id"`
}
type DelVersionRes struct {
g.Meta `mime:"application/json"`
}
type GetListWhiteListReq struct {
g.Meta `path:"/whiteList/get" tags:"ip白名单" method:"post" summary:"获取ip白名单列表"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
}
type GetListWhiteListRes struct {
g.Meta `mime:"application/json"`
WhiteList []entity.GameWhiteList `json:"whiteList"`
Total int `json:"total"`
}
type GetWhiteStateReq struct {
g.Meta `path:"/whiteState/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetWhiteStateRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type GetWhiteListReq struct {
g.Meta `path:"/whiteList/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetWhiteListRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type WhiteListReq struct {
g.Meta `path:"/whiteList/list" tags:"ip白名单" method:"get" summary:"获取ip白名单列表"`
}
type WhiteListRes struct {
g.Meta `mime:"application/json"`
WhiteList []string `json:"whiteList"`
}
type UpdateWhiteListReq struct {
g.Meta `path:"/whiteList/update" tags:"ip白名单" method:"post" summary:"更新ip白名单"`
//Id int `p:"id"`
Ip string `p:"ip"`
}
type UpdateWhiteListRes struct {
g.Meta `mime:"application/json"`
}
type DelWhiteListReq struct {
g.Meta `path:"/whiteList/del" tags:"ip白名单" method:"post" summary:"删除ip白名单"`
Ip string `p:"ip"`
}
type DelWhiteListRes struct {
g.Meta `mime:"application/json"`
}
type GetListBlackListReq struct {
g.Meta `path:"/blackList/get" tags:"ip白名单" method:"post" summary:"获取ip白名单列表"`
common.PageReq
}
type GetListBlackListRes struct {
g.Meta `mime:"application/json"`
WhiteList []entity.GameBlackList `json:"whiteList"`
common.ListRes
}
type GetBlackListReq struct {
g.Meta `path:"/blackList/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetBlackListRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type UpdateBlackListReq struct {
g.Meta `path:"/blackList/update" tags:"ip白名单" method:"post" summary:"更新ip白名单"`
Id int `p:"id"`
Ip string `p:"ip"`
}
type UpdateBlackListRes struct {
g.Meta `mime:"application/json"`
}
type DelBlackListReq struct {
g.Meta `path:"/blackList/del" tags:"ip白名单" method:"post" summary:"删除ip白名单"`
Ip string `p:"ip"`
}
type DelBlackListRes struct {
g.Meta `mime:"application/json"`
}
type GetAllChannelReq struct {
g.Meta `path:"/loginUrl/getAllChannel" tags:"登录地址" method:"post" summary:"getAllChannel"`
}
type GetAllChannelRes struct {
g.Meta `mime:"application/json"`
List []entity.GameChannelList `json:"List"`
}
type GetAllCcdUrlReq struct {
g.Meta `path:"/loginUrl/getAllCcdUrl" tags:"热更URL" method:"post" summary:"getAllCcdUrl"`
}
type GetAllCcdUrlRes struct {
g.Meta `mime:"application/json"`
List []entity.GameCcdVersion `json:"list"`
}
type GetServerVersionListReq struct {
g.Meta `path:"/server/getVersion" tags:"server" method:"get" summary:"getVersion"`
Server string `json:"serverId"`
}
type GetServerVersionListRes struct {
type GetGameCCD1Res struct {
g.Meta `mime:"application/json"`
Version string `json:"version"`
}

6
api/v1/game/cdKey.go

@ -2,6 +2,7 @@ package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
@ -32,14 +33,13 @@ type GetGiftExchangeListReq struct {
StartTime string `p:"startTime"`
StopTime string `p:"stopTime"`
States int `p:"states"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
common.PageReq
}
type GetGiftExchangeListRes struct {
g.Meta `mime:"application/json"`
List []entity.GameGiftExchange `json:"list"`
Total int `json:"total"`
common.ListRes
}
type UpdateGiftExchangeReq struct {

36
api/v1/game/channel.go

@ -0,0 +1,36 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
type GetChannelReq struct {
g.Meta `path:"/channel/get" tags:"channel" method:"get" summary:"获取channel"`
common.PageReq
}
type GetChannelRes struct {
g.Meta `mime:"application/json"`
List []entity.GameChannelList `json:"list"`
common.ListRes
}
type AddChannelReq struct {
g.Meta `path:"/channel/add" tags:"channel" method:"get" summary:"添加channel"`
Id string `p:"id"`
Name string `p:"label"`
Channel string `p:"value"`
Sort string `p:"sort"`
}
type AddChannelRes struct {
}
type DelChannelReq struct {
g.Meta `path:"/channel/del" tags:"channel" method:"get" summary:"删除热更地址"`
Id uint64 `p:"id"`
}
type DelChannelRes struct {
}

104
api/v1/game/gameConfig.go

@ -0,0 +1,104 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
)
type GetBazaarReq struct {
g.Meta `path:"/bazaar/get" tags:"赶集" method:"get" summary:"获取赶集"`
Year int32 `p:"Year"`
Date int32 `p:"Date"`
ServerId int `p:"serverId"`
}
type GetBazaarRes struct {
g.Meta `mime:"application/json"`
Bazaar []map[string]interface{} `json:"bazaar"`
}
type UpdateBazaarReq struct {
g.Meta `path:"/bazaar/update" tags:"赶集" method:"post" summary:"更新赶集"`
Bazaar map[string]interface{} `p:"bazaar"`
}
type UpdateBazaarRes struct {
}
type InsertBazaarReq struct {
g.Meta `path:"/bazaar/insert" tags:"赶集" method:"post" summary:"添加赶集"`
Bazaar map[string]interface{} `p:"bazaar"`
}
type InsertBazaarRes struct {
}
type InsertBatchBazaarReq struct {
g.Meta `path:"/bazaar/insertBatch" tags:"赶集" method:"post" summary:"添加赶集"`
Bazaars []map[string]interface{} `p:"bazaars"`
}
type InsertBatchBazaarRes struct {
}
type GetMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/get" tags:"每月抽奖" method:"get" summary:"获取每月抽奖 -1为不限次数"`
Date string `p:"Date"`
}
type GetMonthlyLotteryRes struct {
g.Meta `mime:"application/json"`
MonthlyLottery []map[string]interface{} `json:"monthlyEvent"`
}
type UpdateMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/update" tags:"每月抽奖" method:"get" summary:"更新每月抽奖"`
MonthlyLottery map[string]interface{} `p:"monthlyLottery"`
}
type UpdateMonthlyLotteryRes struct {
}
type InsertMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/insert" tags:"每月抽奖" method:"get" summary:"添加每月抽奖"`
MonthlyLottery map[string]interface{} `p:"monthlyLottery"`
}
type InsertMonthlyLotteryRes struct {
}
type GetPropExchangeReq struct {
g.Meta `path:"/propExchange/get" tags:"道具兑换" method:"get" summary:"获取道具兑换"`
Id int64 `p:"id"`
Year string `p:"year"`
}
type GetPropExchangeRes struct {
g.Meta `mime:"application/json"`
PropExchange []map[string]interface{} `json:"propExchange"`
}
type UpdatePropExchangeReq struct {
g.Meta `path:"/propExchange/update" tags:"道具兑换" method:"get" summary:"更新道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type UpdatePropExchangeRes struct {
}
type InsertPropExchangeReq struct {
g.Meta `path:"/propExchange/insert" tags:"道具兑换" method:"get" summary:"添加道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type InsertPropExchangeRes struct {
}
type CheckPropExchangeReq struct {
g.Meta `path:"/propExchange/check" tags:"道具兑换" method:"get" summary:"查询道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type CheckPropExchangeRes struct {
g.Meta `mime:"application/json"`
PropExchange int64 `json:"propExchange"`
}

123
api/v1/game/loginUrl.go

@ -0,0 +1,123 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
type GetLoginUrlReq struct {
g.Meta `path:"/loginUrl/getLoginUrl" tags:"登录地址" method:"post" summary:"loginUrl"`
common.PageReq
}
type GetLoginUrlRes struct {
g.Meta `mime:"application/json"`
LoginUrlList []entity.GameLoginUrl `json:"loginUrlList"`
common.ListRes
}
type GetAllLoginUrlReq struct {
g.Meta `path:"/loginUrl/getAllLoginUrl" tags:"登录地址" method:"post" summary:"allLoginUrl"`
}
type GetAllLoginUrlRes struct {
g.Meta `mime:"application/json"`
LoginUrlList []entity.GameLoginUrl `json:"loginUrlList"`
}
type AddLoginUrlReq struct {
g.Meta `path:"/loginUrl/addLoginUrl" tags:"登录地址" method:"post" summary:"添加loginUrl"`
Id int `p:"id"`
Host string `p:"host"`
Port int `p:"port"`
State string `p:"state"`
Recommend string `p:"recommend"`
IsNew string `p:"isNew"`
}
type AddLoginUrlRes struct {
}
type AddNewLoginUrlReq struct {
g.Meta `path:"/loginUrl/addNewLoginUrl" tags:"登录地址" method:"post" summary:"添加loginUrl"`
Id int `p:"id"`
Host string `p:"host"`
Port int `p:"port"`
State int `p:"state"`
Recommend int `p:"recommend"`
Name string `p:"name"`
RechargeHost string `p:"rechargeHost"`
RechargePort int `p:"rechargePort"`
Area int `p:"area"`
IsShow int `p:"isShow"`
Channel string `p:"channel"`
GameDbUrl string `p:"gameDbUrl"`
GameDbName string `p:"gameDbName"`
Platform int `p:"platform"`
InnerIp string `p:"innerIp"`
CreateTime string `p:"createTime"`
Remark string `p:"remark"`
Difficulty int `p:"difficulty"`
}
type AddNewLoginUrlRes struct {
}
type DelLoginUrlReq struct {
g.Meta `path:"/loginUrl/delLoginUrl" tags:"登录地址" method:"post" summary:"删除loginUrl"`
Id uint64 `p:"id"`
}
type DelLoginUrlRes struct {
}
type GetAllChannelReq struct {
g.Meta `path:"/loginUrl/getAllChannel" tags:"登录地址" method:"post" summary:"getAllChannel"`
}
type GetAllChannelRes struct {
g.Meta `mime:"application/json"`
List []entity.GameChannelList `json:"List"`
}
type GetAllCcdUrlReq struct {
g.Meta `path:"/loginUrl/getAllCcdUrl" tags:"热更URL" method:"post" summary:"getAllCcdUrl"`
}
type GetAllCcdUrlRes struct {
g.Meta `mime:"application/json"`
List []entity.GameCcdVersion `json:"list"`
}
type GetGameLoginUrlReq struct {
g.Meta `path:"/loginUrl/get" tags:"外部接口" method:"get" summary:"登录地址"`
Account string `p:"account" `
Channel string `p:"channel" `
Version string `p:"version" ` // 旧版本使用
VersionName string `p:"versionName" ` // 新版新增
VersionCode string `p:"versionCode" `
}
type LoginUrlData struct {
Id int `json:"server_id" description:"服务器编号"`
Host string `json:"host" description:""`
Port int `json:"port" description:""`
State int `json:"state" description:"服务器状态,1-正常,2-维护,3-白名单ip优先+渠道,4-黑名单渠道优先+ip白名单"`
Area int `json:"area" description:"服务器区服"`
Name string `json:"name" description:"服务器名称"`
Difficulty int `json:"difficulty" description:"难度标识"`
Recommend int `json:"recommend" description:"推荐标识,1-推荐" `
Last int `json:"last" description:"上次登录标识,1-登录"`
Scale int `json:"scale" description:"玩家规模等级"`
AccountName string `json:"accountName" description:"玩家名称"`
CreateTime int64 `json:"createTime" description:"创建时间"`
IsNew int `json:"isNew" description:"是否新服"`
}
type GetGameLoginUrlRes struct {
g.Meta `mime:"application/json"`
UrlStr []LoginUrlData `json:"serverList"`
}

6
api/v1/game/mail.go

@ -2,6 +2,7 @@ package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
@ -11,14 +12,13 @@ type MailsSearchReq struct {
Uid string `p:"uid"`
LowTime int64 `p:"lowTime"`
UpperTime int64 `p:"upperTime"`
PageNum int64 `p:"pageNum"`
PageSize int64 `p:"pageSize"`
common.Page64Req
}
type MailsSearchRes struct {
g.Meta `mime:"application/json"`
Mails []*entity.Mail `json:"mails"`
Total int64 `json:"total"`
common.List64Res
}
type MailSendReq struct {

251
api/v1/game/manage.go

@ -2,7 +2,6 @@ package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
@ -234,250 +233,12 @@ type FinishGatherReq struct {
type FinishGatherRes struct {
}
type GetBazaarReq struct {
g.Meta `path:"/bazaar/get" tags:"赶集" method:"get" summary:"获取赶集"`
Year int32 `p:"Year"`
Date int32 `p:"Date"`
ServerId int `p:"serverId"`
}
type GetBazaarRes struct {
g.Meta `mime:"application/json"`
Bazaar []map[string]interface{} `json:"bazaar"`
}
type UpdateBazaarReq struct {
g.Meta `path:"/bazaar/update" tags:"赶集" method:"post" summary:"更新赶集"`
Bazaar map[string]interface{} `p:"bazaar"`
}
type UpdateBazaarRes struct {
}
type InsertBazaarReq struct {
g.Meta `path:"/bazaar/insert" tags:"赶集" method:"post" summary:"添加赶集"`
Bazaar map[string]interface{} `p:"bazaar"`
}
type InsertBazaarRes struct {
}
type InsertBatchBazaarReq struct {
g.Meta `path:"/bazaar/insertBatch" tags:"赶集" method:"post" summary:"添加赶集"`
Bazaars []map[string]interface{} `p:"bazaars"`
}
type InsertBatchBazaarRes struct {
}
type GetMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/get" tags:"每月抽奖" method:"get" summary:"获取每月抽奖 -1为不限次数"`
Date string `p:"Date"`
}
type GetMonthlyLotteryRes struct {
g.Meta `mime:"application/json"`
MonthlyLottery []map[string]interface{} `json:"monthlyEvent"`
}
type UpdateMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/update" tags:"每月抽奖" method:"get" summary:"更新每月抽奖"`
MonthlyLottery map[string]interface{} `p:"monthlyLottery"`
}
type UpdateMonthlyLotteryRes struct {
}
type InsertMonthlyLotteryReq struct {
g.Meta `path:"/monthlyLottery/insert" tags:"每月抽奖" method:"get" summary:"添加每月抽奖"`
MonthlyLottery map[string]interface{} `p:"monthlyLottery"`
}
type InsertMonthlyLotteryRes struct {
}
type GetPropExchangeReq struct {
g.Meta `path:"/propExchange/get" tags:"道具兑换" method:"get" summary:"获取道具兑换"`
Id int64 `p:"id"`
Year string `p:"year"`
}
type GetPropExchangeRes struct {
g.Meta `mime:"application/json"`
PropExchange []map[string]interface{} `json:"propExchange"`
}
type UpdatePropExchangeReq struct {
g.Meta `path:"/propExchange/update" tags:"道具兑换" method:"get" summary:"更新道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type UpdatePropExchangeRes struct {
}
type InsertPropExchangeReq struct {
g.Meta `path:"/propExchange/insert" tags:"道具兑换" method:"get" summary:"添加道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type InsertPropExchangeRes struct {
}
type CheckPropExchangeReq struct {
g.Meta `path:"/propExchange/check" tags:"道具兑换" method:"get" summary:"查询道具兑换"`
PropExchange map[string]interface{} `p:"propExchange"`
}
type CheckPropExchangeRes struct {
g.Meta `mime:"application/json"`
PropExchange int64 `json:"propExchange"`
}
type GetModelReq struct {
g.Meta `path:"/model/get" tags:"模板" method:"get" summary:"获取模板"`
MType int64 `p:"mType"`
Id int64 `p:"id"`
}
type GetModelRes struct {
g.Meta `mime:"application/json"`
Model []map[string]interface{} `json:"model"`
}
type UpdateModelReq struct {
g.Meta `path:"/model/update" tags:"模板" method:"get" summary:"更新模板"`
Model map[string]interface{} `p:"model"`
}
type UpdateModelRes struct {
}
type InsertModelReq struct {
g.Meta `path:"/model/insert" tags:"模板" method:"get" summary:"添加模板"`
Model map[string]interface{} `p:"model"`
}
type InsertModelRes struct {
}
type DelModelReq struct {
g.Meta `path:"/model/del" tags:"模板" method:"get" summary:"删除模板"`
Id int64 `p:"id"`
StallId int32 `p:"stallId"`
}
type DelModelRes struct {
}
type SetAuditModeReq struct {
g.Meta `path:"/set/auditMode" tags:"set接口" method:"post" summary:"审核模式"`
AuditMode int `p:"auditMode" ` // 1-不需要走热更新; 0-需要走热更新
Channel string `p:"channel"`
Version string `p:"version"`
Name string `p:"name"`
}
type SetAuditModeRes struct {
g.Meta `mime:"application/json"`
}
type DelAuditModeReq struct {
g.Meta `path:"/set/delAuditMode" tags:"set接口" method:"post" summary:"审核模式"`
Label string `p:"label"`
Name string `p:"name"`
}
type DelAuditModeRes struct {
g.Meta `mime:"application/json"`
}
type AuditModeReq struct {
g.Meta `path:"/set/checkAuditMode" tags:"set接口" method:"get" summary:"auditMode"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type AuditModeRes struct {
g.Meta `mime:"application/json"`
AuditMode int32 `json:"auditMode"`
}
type GetAllAuditModeReq struct {
g.Meta `path:"/set/getAllAuditMode" tags:"set接口" method:"get" summary:"getAllAuditMode"`
Name string `p:"name"`
}
type GetAllAuditModeRes struct {
g.Meta `mime:"application/json"`
List map[string]string `json:"list"`
}
type GetAllowChannelReq struct {
g.Meta `path:"/set/getAllowChannel" tags:"set接口" method:"get" summary:"getAllowChannel"`
}
type GetAllowChannelRes struct {
g.Meta `mime:"application/json"`
List map[string]string `json:"list"`
}
type SetAllowChannelReq struct {
g.Meta `path:"/set/allowChannel" tags:"set接口" method:"post" summary:"审核模式"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type SetAllowChannelRes struct {
g.Meta `mime:"application/json"`
}
type DelAllowChannelReq struct {
g.Meta `path:"/set/delAllowChannel" tags:"set接口" method:"post" summary:"审核模式"`
Label string `p:"label"`
}
type DelAllowChannelRes struct {
g.Meta `mime:"application/json"`
}
type GetOperLogReq struct {
g.Meta `path:"/log/getOperLog" tags:"log接口" method:"get" summary:"操作日志"`
Label string `p:"label"`
common.PageReq
}
type GetOperLogRes struct {
g.Meta `mime:"application/json"`
List []entity.SysOperLog `json:"list"`
common.ListRes
}
type GetLoginOutGmReq struct {
g.Meta `path:"/loginOut/getGm" tags:"log接口" method:"get" summary:"操作日志"`
UnitId int64 `p:"uid"`
Uid string `p:"id"`
Account string `p:"account"`
State int `p:"state"`
CompareType int `p:"compareType"`
RechargeTotal int `p:"rechargeTotal"`
ServerId int `p:"serverId"`
StoneAmount int `p:"stoneAmount"`
VouchersNum int `p:"vouchersNum"`
CDate int64 `p:"cDate"`
common.PageReq
}
type GetLoginOutGmRes struct {
g.Meta `mime:"application/json"`
Logs []entity.LoginLogoutInfoGm `json:"logs"`
common.ListRes
}
type ReConfigServerReq struct {
g.Meta `path:"/reloadServer" tags:"外部接口" method:"get" summary:"重置服务器列表"`
SType int32 `p:"sType"`
type DelAccountReq struct {
g.Meta `path:"/mange/delAccount" tags:"账号" method:"get" summary:"删除账号"`
SrcName string `p:"SrcName"`
ServerId int `p:"serverId"`
Password string `p:"password"`
}
type ReConfigServerRes struct {
g.Meta `mime:"application/json"`
type DelAccountRes struct {
}

85
api/v1/game/model.go

@ -0,0 +1,85 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
type GetModelReq struct {
g.Meta `path:"/model/get" tags:"模板" method:"get" summary:"获取模板"`
MType int64 `p:"mType"`
Id int64 `p:"id"`
}
type GetModelRes struct {
g.Meta `mime:"application/json"`
Model []map[string]interface{} `json:"model"`
}
type UpdateModelReq struct {
g.Meta `path:"/model/update" tags:"模板" method:"get" summary:"更新模板"`
Model map[string]interface{} `p:"model"`
}
type UpdateModelRes struct {
}
type InsertModelReq struct {
g.Meta `path:"/model/insert" tags:"模板" method:"get" summary:"添加模板"`
Model map[string]interface{} `p:"model"`
}
type InsertModelRes struct {
}
type DelModelReq struct {
g.Meta `path:"/model/del" tags:"模板" method:"get" summary:"删除模板"`
Id int64 `p:"id"`
StallId int32 `p:"stallId"`
}
type DelModelRes struct {
}
type GetOperLogReq struct {
g.Meta `path:"/log/getOperLog" tags:"log接口" method:"get" summary:"操作日志"`
Label string `p:"label"`
common.PageReq
}
type GetOperLogRes struct {
g.Meta `mime:"application/json"`
List []entity.SysOperLog `json:"list"`
common.ListRes
}
type GetLoginOutGmReq struct {
g.Meta `path:"/loginOut/getGm" tags:"log接口" method:"get" summary:"操作日志"`
UnitId int64 `p:"uid"`
Uid string `p:"id"`
Account string `p:"account"`
State int `p:"state"`
CompareType int `p:"compareType"`
RechargeTotal int `p:"rechargeTotal"`
ServerId int `p:"serverId"`
StoneAmount int `p:"stoneAmount"`
VouchersNum int `p:"vouchersNum"`
CDate int64 `p:"cDate"`
common.PageReq
}
type GetLoginOutGmRes struct {
g.Meta `mime:"application/json"`
Logs []entity.LoginLogoutInfoGm `json:"logs"`
common.ListRes
}
type ReConfigServerReq struct {
g.Meta `path:"/reloadServer" tags:"内部接口" method:"get" summary:"重置服务器列表"`
SType int32 `p:"sType"`
}
type ReConfigServerRes struct {
g.Meta `mime:"application/json"`
}

7
api/v1/game/notice.go

@ -160,9 +160,8 @@ type GetGameNoticeListRes struct {
}
type GetGameNoticeLogReq struct {
g.Meta `path:"/notice/log" tags:"公告" method:"post" summary:"历史公告"`
PageSize int `json:"pageSize"`
PageNum int `json:"pageNum"`
g.Meta `path:"/notice/log" tags:"公告" method:"post" summary:"历史公告"`
common.PageReq
Content string `json:"content"`
NoticeType int `json:"noticeType"`
BeginTime int64 `json:"beginTime"`
@ -172,7 +171,7 @@ type GetGameNoticeLogReq struct {
type GetGameNoticeLogRes struct {
g.Meta `mime:"application/json"`
NoticeLog []entity.GameNoticeLog `json:"noticeLog"`
Total int `json:"total"`
common.ListRes
}
type GetNoticeModelReq struct {

12
api/v1/game/order.go

@ -7,9 +7,8 @@ import (
)
type OrderSearchReq struct {
g.Meta `path:"/order/list" tags:"订单" method:"get" summary:"订单列表"`
PageNum int64 `p:"pageNum"`
PageSize int64 `p:"pageSize"`
g.Meta `path:"/order/list" tags:"订单" method:"get" summary:"订单列表"`
common.Page64Req
Account string `p:"account"`
Uid int32 `p:"uid"`
Status int32 `p:"status"`
@ -21,7 +20,7 @@ type OrderSearchReq struct {
type OrderSearchRes struct {
g.Meta `mime:"application/json"`
Orders []*entity.Order `json:"list"`
Total int `json:"total"`
common.ListRes
}
type OrderCountReq struct {
@ -31,14 +30,13 @@ type OrderCountReq struct {
CompareType int `p:"compareType"`
GM int `p:"GM"`
Server int `p:"server"`
PageNo int `p:"pageNo"`
PageSize int `p:"pageSize"`
common.PageReq
}
type OrderCountRes struct {
g.Meta `mime:"application/json"`
Orders []*entity.OrderCount `json:"list"`
Total int `json:"total"`
common.ListRes
}
type OrderLogReq struct {

110
api/v1/game/pub.go

@ -16,72 +16,6 @@ type GetGameUpdateUrlRes struct {
/*v:"required#版本不能为空"*/
type GetGameLoginUrlReq struct {
g.Meta `path:"/loginUrl/get" tags:"外部接口" method:"get" summary:"登录地址"`
Account string `p:"account" `
Channel string `p:"channel" `
Version string `p:"version" ` // 旧版本使用
VersionName string `p:"versionName" ` // 新版新增
VersionCode string `p:"versionCode" `
}
type LoginUrlData struct {
Id int `json:"server_id" description:"服务器编号"`
Host string `json:"host" description:""`
Port int `json:"port" description:""`
State int `json:"state" description:"服务器状态,1-正常,2-维护,3-白名单ip优先+渠道,4-黑名单渠道优先+ip白名单"`
Area int `json:"area" description:"服务器区服"`
Name string `json:"name" description:"服务器名称"`
Difficulty int `json:"difficulty" description:"难度标识"`
Recommend int `json:"recommend" description:"推荐标识,1-推荐" `
Last int `json:"last" description:"上次登录标识,1-登录"`
Scale int `json:"scale" description:"玩家规模等级"`
AccountName string `json:"accountName" description:"玩家名称"`
CreateTime int64 `json:"createTime" description:"创建时间"`
IsNew int `json:"isNew" description:"是否新服"`
}
type GetGameLoginUrlRes struct {
g.Meta `mime:"application/json"`
UrlStr []LoginUrlData `json:"serverList"`
}
type GetGameCCDReq struct {
g.Meta `path:"/ccd/get" tags:"外部接口" method:"post" summary:"登录地址"`
ChannelType string `p:"channelType"`
Platform string `p:"platform"`
VersionName string `p:"versionName"`
HotfixVersion string `p:"hotfixVersion"`
VersionCode string `p:"versionCode"`
Version string `p:"version"`
}
type GetGameCCDRes struct {
g.Meta `mime:"application/json"`
Url string `json:"url"`
Version string `json:"version"`
AuditMode int32 `json:"auditMode"`
EnableHotfix int32 `json:"enableHotfix"`
EnableAccountLogin int32 `json:"enableAccountLogin"`
}
type GetGameCCD1Req struct {
g.Meta `path:"/ccd1/get" tags:"外部接口" method:"post" summary:"登录地址"`
ChannelType string `p:"channelType"`
Platform string `p:"platform"`
VersionName string `p:"versionName"`
HotfixVersion string `p:"hotfixVersion"`
VersionCode string `p:"versionCode"`
Version string `p:"version"`
}
type GetGameCCD1Res struct {
g.Meta `mime:"application/json"`
Version string `json:"version"`
}
type GetOutIdReq struct {
g.Meta `path:"/outId/get" tags:"外部接口" method:"get" summary:"获取uid"`
Uid int64 `p:"uid"`
@ -217,47 +151,3 @@ type GetOpenIdRes struct {
g.Meta `mime:"application/json"`
State int `json:"state"`
}
type GetServerConfigReq struct {
g.Meta `path:"/getServerConfig" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"serverId"`
}
type GetServerConfigRes struct {
g.Meta `mime:"application/json"`
Id int `json:"serverId" description:""`
SdkAddress string `json:"sdkAddress" description:""`
UniqueAddress string `json:"uniqueAddress" description:""`
IdentityCheckAddress string `json:"identityCheckAddress" description:""`
RechargeWhiteListIps string `json:"rechargeWhiteListIps" description:""`
GmWhiteListUrl string `json:"gmWhiteListUrl" description:""`
BackstageRechargeUrl string `json:"backstageRechargeUrl" description:""`
GameDifficulty int `json:"gameDifficulty" description:""`
GameDbUrl string `json:"gameDbUrl" description:""`
GameDbName string `json:"gameDbName" description:""`
Platform int `json:"platform" description:""`
InnerIp string `json:"innerIp" description:""`
CreateTime int64 `json:"createTime" description:""`
}
type CheckFirstRebateReq struct {
g.Meta `path:"/checkFirstRebate" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"server"`
Id int64 `p:"id"`
}
type CheckFirstRebateRes struct {
g.Meta `mime:"application/json"`
Amount int `json:"Amount" description:""`
}
type CheckSecondRebateReq struct {
g.Meta `path:"/checkSecondRebate" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"server"`
Id int64 `p:"id"`
}
type CheckSecondRebateRes struct {
g.Meta `mime:"application/json"`
Amount int `json:"Amount" description:""`
}

22
api/v1/game/rebate.go

@ -26,3 +26,25 @@ type GetRechargeValueRes struct {
g.Meta `mime:"application/json"`
Amount int `json:"amount"`
}
type CheckFirstRebateReq struct {
g.Meta `path:"/checkFirstRebate" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"server"`
Id int64 `p:"id"`
}
type CheckFirstRebateRes struct {
g.Meta `mime:"application/json"`
Amount int `json:"Amount" description:""`
}
type CheckSecondRebateReq struct {
g.Meta `path:"/checkSecondRebate" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"server"`
Id int64 `p:"id"`
}
type CheckSecondRebateRes struct {
g.Meta `mime:"application/json"`
Amount int `json:"Amount" description:""`
}

105
api/v1/game/serverConfig.go

@ -0,0 +1,105 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
type GetServerVersionListReq struct {
g.Meta `path:"/server/getVersion" tags:"server" method:"get" summary:"getVersion"`
Server string `json:"serverId"`
}
type GetServerVersionListRes struct {
g.Meta `mime:"application/json"`
Version string `json:"version"`
}
type GetServerConfigGeneralReq struct {
g.Meta `path:"/serverConfig/getGeneral" tags:"系统配置" method:"post" summary:"ServerConfig"`
}
type GetServerConfigGeneralRes struct {
g.Meta `mime:"application/json"`
List []entity.GameServerJsonGeneral `json:"list"`
}
type AddServerConfigGeneralReq struct {
g.Meta `path:"/serverConfig/addGeneral" tags:"系统配置" method:"post" summary:"修改generalServerConfig"`
Id int `p:"id"`
BackstageRechargeUrl string `p:"backstageRechargeUrl"`
GmWhiteListUrl string `p:"gmWhiteListUrl"`
IdentityCheckAddress string `p:"identityCheckAddress"`
RechargeWhiteListIps string `p:"rechargeWhiteListIps"`
SdkAddress string `p:"sdkAddress"`
UniqueAddress string `p:"uniqueAddress"`
}
type AddServerConfigGeneralRes struct {
}
type AddServerConfigReq struct {
g.Meta `path:"/serverConfig/add" tags:"服务器配置" method:"post" summary:"修改ServerConfig"`
Id int `p:"id"`
GameDbUrl string `p:"gameDbUrl"`
GameDbName string `p:"gameDbName"`
Platform int `p:"platform"`
InnerIp string `p:"innerIp"`
CreateTime string `p:"createTime"`
Remark string `p:"remark"`
Difficulty int `p:"difficulty"`
Channel string `p:"channel"`
}
type AddServerConfigRes struct {
}
type GetRouterReq struct {
g.Meta `path:"/serverConfig/getRouter" tags:"服务器配置" method:"post" summary:"router"`
common.PageReq
}
type GetRouterRes struct {
g.Meta `mime:"application/json"`
List []entity.GameRouter `json:"list"`
common.ListRes
}
type AddRouterReq struct {
g.Meta `path:"/serverConfig/updateRouter" tags:"服务器配置" method:"post" summary:"修改ServerConfig"`
Id int `p:"id"`
RealmIp string `p:"realmIp"`
RealmPort int `p:"realmPort"`
RealmStep int `p:"realmStep"`
RealmNum int `p:"realmNum"`
RouterIp string `p:"routerIp"`
RouterPort int `p:"routerPort"`
RouterStep int `p:"routerStep"`
RouterNum int `p:"routerNum"`
}
type AddRouterRes struct {
}
type GetServerConfigReq struct {
g.Meta `path:"/getServerConfig" tags:"外部接口" method:"get" summary:"获取服务器配置"`
ServerId int `p:"serverId"`
}
type GetServerConfigRes struct {
g.Meta `mime:"application/json"`
Id int `json:"serverId" description:""`
SdkAddress string `json:"sdkAddress" description:""`
UniqueAddress string `json:"uniqueAddress" description:""`
IdentityCheckAddress string `json:"identityCheckAddress" description:""`
RechargeWhiteListIps string `json:"rechargeWhiteListIps" description:""`
GmWhiteListUrl string `json:"gmWhiteListUrl" description:""`
BackstageRechargeUrl string `json:"backstageRechargeUrl" description:""`
GameDifficulty int `json:"gameDifficulty" description:""`
GameDbUrl string `json:"gameDbUrl" description:""`
GameDbName string `json:"gameDbName" description:""`
Platform int `json:"platform" description:""`
InnerIp string `json:"innerIp" description:""`
CreateTime int64 `json:"createTime" description:""`
}

76
api/v1/game/set.go

@ -0,0 +1,76 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
)
type SetAuditModeReq struct {
g.Meta `path:"/set/auditMode" tags:"set接口" method:"post" summary:"审核模式"`
AuditMode int `p:"auditMode" ` // 1-不需要走热更新; 0-需要走热更新
Channel string `p:"channel"`
Version string `p:"version"`
Name string `p:"name"`
}
type SetAuditModeRes struct {
g.Meta `mime:"application/json"`
}
type DelAuditModeReq struct {
g.Meta `path:"/set/delAuditMode" tags:"set接口" method:"post" summary:"审核模式"`
Label string `p:"label"`
Name string `p:"name"`
}
type DelAuditModeRes struct {
g.Meta `mime:"application/json"`
}
type AuditModeReq struct {
g.Meta `path:"/set/checkAuditMode" tags:"set接口" method:"get" summary:"auditMode"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type AuditModeRes struct {
g.Meta `mime:"application/json"`
AuditMode int32 `json:"auditMode"`
}
type GetAllAuditModeReq struct {
g.Meta `path:"/set/getAllAuditMode" tags:"set接口" method:"get" summary:"getAllAuditMode"`
Name string `p:"name"`
}
type GetAllAuditModeRes struct {
g.Meta `mime:"application/json"`
List map[string]string `json:"list"`
}
type GetAllowChannelReq struct {
g.Meta `path:"/set/getAllowChannel" tags:"set接口" method:"get" summary:"getAllowChannel"`
}
type GetAllowChannelRes struct {
g.Meta `mime:"application/json"`
List map[string]string `json:"list"`
}
type SetAllowChannelReq struct {
g.Meta `path:"/set/allowChannel" tags:"set接口" method:"post" summary:"审核模式"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type SetAllowChannelRes struct {
g.Meta `mime:"application/json"`
}
type DelAllowChannelReq struct {
g.Meta `path:"/set/delAllowChannel" tags:"set接口" method:"post" summary:"审核模式"`
Label string `p:"label"`
}
type DelAllowChannelRes struct {
g.Meta `mime:"application/json"`
}

37
api/v1/game/version.go

@ -0,0 +1,37 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/internal/model/entity"
)
type GetVersionReq struct {
g.Meta `path:"/version/get" tags:"版本号" method:"post" summary:"获取"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
}
type GetVersionRes struct {
g.Meta `mime:"application/json"`
Version []entity.GameVersion `json:"version"`
Total int `json:"total"`
}
type UpdateVersionReq struct {
g.Meta `path:"/version/update" tags:"版本号" method:"post" summary:"更新"`
Channel string `p:"channel"`
Version string `p:"version"`
}
type UpdateVersionRes struct {
g.Meta `mime:"application/json"`
}
type DelVersionReq struct {
g.Meta `path:"/version/del" tags:"版本号" method:"post" summary:"删除"`
Id int32 `p:"id"`
}
type DelVersionRes struct {
g.Meta `mime:"application/json"`
}

104
api/v1/game/whiteList.go

@ -0,0 +1,104 @@
package game
import (
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/common"
"tyj_admin/internal/model/entity"
)
type GetListWhiteListReq struct {
g.Meta `path:"/whiteList/get" tags:"ip白名单" method:"post" summary:"获取ip白名单列表"`
PageNum int `p:"pageNum"`
PageSize int `p:"pageSize"`
}
type GetListWhiteListRes struct {
g.Meta `mime:"application/json"`
WhiteList []entity.GameWhiteList `json:"whiteList"`
Total int `json:"total"`
}
type GetWhiteStateReq struct {
g.Meta `path:"/whiteState/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetWhiteStateRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type GetWhiteListReq struct {
g.Meta `path:"/whiteList/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetWhiteListRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type WhiteListReq struct {
g.Meta `path:"/whiteList/list" tags:"ip白名单" method:"get" summary:"获取ip白名单列表"`
}
type WhiteListRes struct {
g.Meta `mime:"application/json"`
WhiteList []string `json:"whiteList"`
}
type UpdateWhiteListReq struct {
g.Meta `path:"/whiteList/update" tags:"ip白名单" method:"post" summary:"更新ip白名单"`
//Id int `p:"id"`
Ip string `p:"ip"`
}
type UpdateWhiteListRes struct {
g.Meta `mime:"application/json"`
}
type DelWhiteListReq struct {
g.Meta `path:"/whiteList/del" tags:"ip白名单" method:"post" summary:"删除ip白名单"`
Ip string `p:"ip"`
}
type DelWhiteListRes struct {
g.Meta `mime:"application/json"`
}
type GetListBlackListReq struct {
g.Meta `path:"/blackList/get" tags:"ip白名单" method:"post" summary:"获取ip白名单列表"`
common.PageReq
}
type GetListBlackListRes struct {
g.Meta `mime:"application/json"`
WhiteList []entity.GameBlackList `json:"whiteList"`
common.ListRes
}
type GetBlackListReq struct {
g.Meta `path:"/blackList/get" tags:"ip白名单" method:"get" summary:"判断ip白名单"`
}
type GetBlackListRes struct {
g.Meta `mime:"application/json"`
Count int `json:"count"`
}
type UpdateBlackListReq struct {
g.Meta `path:"/blackList/update" tags:"ip白名单" method:"post" summary:"更新ip白名单"`
Id int `p:"id"`
Ip string `p:"ip"`
}
type UpdateBlackListRes struct {
g.Meta `mime:"application/json"`
}
type DelBlackListReq struct {
g.Meta `path:"/blackList/del" tags:"ip白名单" method:"post" summary:"删除ip白名单"`
Ip string `p:"ip"`
}
type DelBlackListRes struct {
g.Meta `mime:"application/json"`
}

33
internal/controller/game_channel.go

@ -0,0 +1,33 @@
package controller
import (
"context"
"tyj_admin/api/v1/game"
"tyj_admin/internal/serviceGame"
)
var GameChannel = channelController{}
type channelController struct {
BaseController
}
func (c *channelController) GetChannel(ctx context.Context, req *game.GetChannelReq) (res *game.GetChannelRes, err error) {
res, err = serviceGame.Channel().GetChannel(ctx, req)
return
}
func (c *channelController) AddChannel(ctx context.Context, req *game.AddChannelReq) (res *game.AddChannelRes, err error) {
res, err = serviceGame.Channel().AddChannel(ctx, req)
return
}
func (c *channelController) DelChannel(ctx context.Context, req *game.DelChannelReq) (res *game.DelChannelRes, err error) {
res, err = serviceGame.Channel().DelChannel(ctx, req)
return
}
func (c *channelController) GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error) {
res, err = serviceGame.Channel().GetAllChannel(ctx, req)
return
}

5
internal/controller/game_login_url.go

@ -27,11 +27,6 @@ func (c *loginUrlController) GetAll(ctx context.Context, req *game.GetAllLoginUr
return
}
func (c *loginUrlController) GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error) {
res, err = serviceGame.GameLoginUrl().GetAllChannel(ctx, req)
return
}
func (c *loginUrlController) GetAllCcdUrl(ctx context.Context, req *game.GetAllCcdUrlReq) (res *game.GetAllCcdUrlRes, err error) {
res, err = serviceGame.GameLoginUrl().GetAllCcdUrl(ctx, req)
return

1
internal/router/router.go

@ -174,6 +174,7 @@ func GameBindController(group *ghttp.RouterGroup) {
controller.GameSet,
controller.Advertisement,
controller.GameBug,
controller.GameChannel,
)
})
}

3
internal/service/aliyunSms.go

@ -55,8 +55,9 @@ func (a *aliYunSmsServiceTmpl) ConfigInit() {
smsConfig.AccessSecret = g.Cfg().MustGet(ctx, "game.sms.accessSecret").String()
smsConfig.RegionId = g.Cfg().MustGet(ctx, "game.sms.regionId").String()
smsConfig.CodeSignName = g.Cfg().MustGet(ctx, "game.sms.codeSignName").String()
smsConfig.TemplateCode = g.Cfg().MustGet(ctx, "game.sms.templateCodePass").String()
smsConfig.TemplateCode = g.Cfg().MustGet(ctx, "game.sms.templateCode").String()
log.Printf("aliyunsms init")
}
/*

2
internal/service/email.go

@ -54,7 +54,7 @@ func (a *emailServiceTmpl) ConfigInit() {
emailConfig.Port = g.Cfg().MustGet(ctx, "game.email.port").String()
emailConfig.Subject = g.Cfg().MustGet(ctx, "game.email.subject").String()
emailConfig.HTML = g.Cfg().MustGet(ctx, "game.email.html").String()
log.Printf("email init")
}
/*

22
internal/service/tencentSms.go

@ -8,6 +8,7 @@ import (
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
sms "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111"
"log"
)
type ITencentSms interface {
@ -33,7 +34,7 @@ type TencentSmsData struct {
}
var (
tencnetSmsConfig TencentSmsData
tencentSmsConfig TencentSmsData
)
func init() {
@ -44,17 +45,18 @@ func (a *tencentSmsServiceTmpl) ConfigInit() {
//加载游戏相关配置
ctx := gctx.New()
tencnetSmsConfig.AccessKeyId = g.Cfg().MustGet(ctx, "game.tencentSms.accessKeyId").String() // 替换为你的 SecretId
tencnetSmsConfig.AccessSecret = g.Cfg().MustGet(ctx, "game.tencentSms.accessSecret").String() // 替换为你的 SecretKey
tencnetSmsConfig.AppId = g.Cfg().MustGet(ctx, "game.tencentSms.appId").String() // 短信应用ID (SdkAppId)
tencnetSmsConfig.CodeSignName = g.Cfg().MustGet(ctx, "game.tencentSms.codeSignName").String() // 已审核通过的短信签名内容
tencnetSmsConfig.TemplateCode = g.Cfg().MustGet(ctx, "game.tencentSms.templateCodePass").String() // 已审核通过的模板ID
tencentSmsConfig.AccessKeyId = g.Cfg().MustGet(ctx, "game.tencentSms.accessKeyId").String() // 替换为你的 SecretId
tencentSmsConfig.AccessSecret = g.Cfg().MustGet(ctx, "game.tencentSms.accessSecret").String() // 替换为你的 SecretKey
tencentSmsConfig.AppId = g.Cfg().MustGet(ctx, "game.tencentSms.appId").String() // 短信应用ID (SdkAppId)
tencentSmsConfig.CodeSignName = g.Cfg().MustGet(ctx, "game.tencentSms.codeSignName").String() // 已审核通过的短信签名内容
tencentSmsConfig.TemplateCode = g.Cfg().MustGet(ctx, "game.tencentSms.templateCode").String() // 已审核通过的模板ID
log.Println("tencentSms init", tencentSmsConfig)
}
func (a *tencentSmsServiceTmpl) Main(args []string) (_err error) {
// 初始化认证对象
credential := common.NewCredential(tencnetSmsConfig.AccessKeyId, tencnetSmsConfig.AccessSecret)
credential := common.NewCredential(tencentSmsConfig.AccessKeyId, tencentSmsConfig.AccessSecret)
// 初始化客户端配置
cpf := profile.NewClientProfile()
@ -65,9 +67,9 @@ func (a *tencentSmsServiceTmpl) Main(args []string) (_err error) {
// 构建请求
request := sms.NewSendSmsRequest()
request.SmsSdkAppId = common.StringPtr(tencnetSmsConfig.AppId)
request.SignName = common.StringPtr(tencnetSmsConfig.CodeSignName)
request.TemplateId = common.StringPtr(tencnetSmsConfig.TemplateCode)
request.SmsSdkAppId = common.StringPtr(tencentSmsConfig.AppId)
request.SignName = common.StringPtr(tencentSmsConfig.CodeSignName)
request.TemplateId = common.StringPtr(tencentSmsConfig.TemplateCode)
request.PhoneNumberSet = common.StringPtrs([]string{"+86" + args[0]})
// 模板参数(根据模板要求填写,若无参数则留空)

93
internal/serviceGame/channel.go

@ -0,0 +1,93 @@
package serviceGame
import (
"context"
"github.com/gogf/gf/v2/frame/g"
"tyj_admin/api/v1/game"
"tyj_admin/internal/dao"
"tyj_admin/internal/model/do"
"tyj_admin/internal/model/entity"
"tyj_admin/internal/serviceGame/internal"
"tyj_admin/library/liberr"
)
type IChannel interface {
GetChannel(ctx context.Context, req *game.GetChannelReq) (res *game.GetChannelRes, err error)
AddChannel(ctx context.Context, req *game.AddChannelReq) (res *game.AddChannelRes, err error)
DelChannel(ctx context.Context, req *game.DelChannelReq) (res *game.DelChannelRes, err error)
GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error)
}
type channelImpl struct {
}
var channelService = channelImpl{}
func Channel() IChannel {
return &channelService
}
func (c *channelImpl) GetChannel(ctx context.Context, req *game.GetChannelReq) (res *game.GetChannelRes, err error) {
g.Try(ctx, func(ctx context.Context) {
res = new(game.GetChannelRes)
model := dao.GameChannelList.Ctx(ctx)
res.Total, err = model.Count()
liberr.ErrIsNil(ctx, err, "mysql err")
model = model.OrderAsc("sort").Page(req.PageNum, req.PageSize)
err = model.Scan(&res.List)
})
return
}
func (c *channelImpl) AddChannel(ctx context.Context, req *game.AddChannelReq) (res *game.AddChannelRes, err error) {
res = new(game.AddChannelRes)
err = g.Try(ctx, func(ctx context.Context) {
server := []entity.GameChannelList{}
model := dao.GameChannelList.Ctx(ctx)
model.WherePri(req.Id).Scan(&server)
if len(server) > 0 {
data := g.Map{
dao.GameLoginUrl.Columns().Id: req.Id,
}
if req.Channel != "" {
data[dao.GameChannelList.Columns().Value] = req.Channel
}
if req.Name != "" {
data[dao.GameChannelList.Columns().Label] = req.Name
}
if req.Sort != "" {
data[dao.GameChannelList.Columns().Sort] = req.Sort
}
_, err = model.WherePri(req.Id).Update(data)
} else {
_, err = model.Insert(do.GameChannelList{
Label: req.Name,
Value: req.Channel,
Sort: req.Sort,
})
}
})
return
}
func (c *channelImpl) DelChannel(ctx context.Context, req *game.DelChannelReq) (res *game.DelChannelRes, err error) {
err = g.Try(ctx, func(ctx context.Context) {
if req.Id == 0 {
liberr.ErrIsNil(ctx, err, "错误的id")
}
_, e := dao.GameChannelList.Ctx(ctx).Where("id=", req.Id).Delete()
if e != nil {
liberr.ErrIsNil(ctx, e, "删除失败")
}
})
return
}
func (c *channelImpl) GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error) {
g.Try(ctx, func(ctx context.Context) {
res = new(game.GetAllChannelRes)
res.List = internal.ChannelList
})
return
}

70
internal/serviceGame/internal/dbinit.go

@ -8,6 +8,7 @@ import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
"github.com/qiniu/qmgo"
"log"
"time"
"tyj_admin/internal/dao"
"tyj_admin/internal/model/entity"
@ -42,6 +43,8 @@ func init() {
// return
//}
MongoInit(ctx)
InitServer(ctx)
InitChannel(ctx)
redisCfg, err := g.Cfg().Get(ctx, "game.redis")
if err != nil {
@ -71,28 +74,6 @@ func init() {
}
func MongoInit(ctx context.Context) {
mongoCfg, err := g.Cfg().Get(ctx, "game.mongo")
if err != nil {
return
}
config := mongoCfg.Maps()
fmt.Println("MongoInit: ", gjson.MustEncodeString(config))
MongoDatabaseList = map[string]*qmgo.Database{}
MongoConfigs = map[string]MongoType{}
for _, v := range config {
mongoclient, err := qmgo.NewClient(ctx, &qmgo.Config{Uri: v["link"].(string)})
if err != nil {
continue
}
db := mongoclient.Database(v["name"].(string))
MongoDatabaseList[v["id"].(string)] = db
MongoConfigs[v["id"].(string)] = MongoType{Link: v["link"].(string), Link1: v["link1"].(string), Id: v["id"].(string), Name: v["name"].(string), Auth: v["auth"].(string)}
}
}
func RedisInit(config []map[string]interface{}) {
for _, v := range config {
rdb := redis.NewClient(&redis.Options{
@ -109,13 +90,6 @@ func RedisInit(config []map[string]interface{}) {
ctx := context.Background()
InitRedis(ctx)
Test(ctx)
InitServer(ctx)
InitChannel(ctx)
}
func Test(ctx context.Context) {
}
func InitRedis(ctx context.Context) {
@ -125,6 +99,28 @@ func InitRedis(ctx context.Context) {
rdbTop.SetNX(ctx, "public_unit_id", 1000000000, 0)
}
func MongoInit(ctx context.Context) {
mongoCfg, err := g.Cfg().Get(ctx, "game.mongo")
if err != nil {
return
}
config := mongoCfg.Maps()
log.Println("MongoInit: ", gjson.MustEncodeString(config))
MongoDatabaseList = map[string]*qmgo.Database{}
MongoConfigs = map[string]MongoType{}
for _, v := range config {
mongoclient, err := qmgo.NewClient(ctx, &qmgo.Config{Uri: v["link"].(string)})
if err != nil {
continue
}
db := mongoclient.Database(v["name"].(string))
MongoDatabaseList[v["id"].(string)] = db
MongoConfigs[v["id"].(string)] = MongoType{Link: v["link"].(string), Link1: v["link1"].(string), Id: v["id"].(string), Name: v["name"].(string), Auth: v["auth"].(string)}
}
}
func InitServer(ctx context.Context) {
err := g.Try(ctx, func(ctx context.Context) {
ServerList = []entity.GameLoginUrl{}
@ -135,10 +131,10 @@ func InitServer(ctx context.Context) {
ServerConfig[fmt.Sprint(v.Id)] = fmt.Sprintf("%s:%d", v.RechargeHost, v.RechargePort)
}
fmt.Println("InitServer: ", ServerConfig, ServerList)
log.Println("InitServer: ", ServerConfig, ServerList)
})
if err != nil {
fmt.Println("InitServer: ", err)
log.Println("InitServer: ", err)
}
}
@ -146,10 +142,10 @@ func InitChannel(ctx context.Context) {
err := g.Try(ctx, func(ctx context.Context) {
ChannelList = []entity.GameChannelList{}
dao.GameChannelList.Ctx(ctx).OrderAsc(dao.GameChannelList.Columns().Value).Scan(&ChannelList)
fmt.Println("InitChannel: ", ChannelList)
log.Println("channel Init: ", ChannelList)
})
if err != nil {
fmt.Println("InitChannel: ", err)
log.Println("channel Init: ", err)
}
}
@ -157,11 +153,11 @@ func InitRechargeServer(ctx context.Context) {
err := g.Try(ctx, func(ctx context.Context) {
url := RechargeServer + "/serverInit"
bytes := g.Client().PostBytes(ctx, url)
fmt.Printf("InitRechargeServer: %s, res: %v/n", RechargeServer, string(bytes))
log.Printf("InitRechargeServer: %s, res: %v/n", RechargeServer, string(bytes))
})
if err != nil {
fmt.Println("InitRechargeServer: ", err)
log.Println("InitRechargeServer: ", err)
}
}
@ -169,10 +165,10 @@ func InitRouterServer(ctx context.Context) {
err := g.Try(ctx, func(ctx context.Context) {
url := RouterServer + "/resetRouter?md5=erweita0726"
bytes := g.Client().GetBytes(ctx, url)
fmt.Printf("InitRechargeServer: %s, res: %v/n", RechargeServer, string(bytes))
log.Printf("InitRechargeServer: %s, res: %v/n", RechargeServer, string(bytes))
})
if err != nil {
fmt.Println("InitRechargeServer: ", err)
log.Println("InitRechargeServer: ", err)
}
}

12
internal/serviceGame/loginUrl.go

@ -28,7 +28,6 @@ type IGameLoginUrl interface {
DelLoginUrl(ctx context.Context, req *game.DelLoginUrlReq) (res *game.DelLoginUrlRes, err error)
GetGameLoginUrl(ctx context.Context, req *game.GetGameLoginUrlReq) (res *game.GetGameLoginUrlRes, err error)
ReConfigServer(ctx context.Context, req *game.ReConfigServerReq) (res *game.ReConfigServerRes, err error)
GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error)
GetAllCcdUrl(ctx context.Context, req *game.GetAllCcdUrlReq) (res *game.GetAllCcdUrlRes, err error)
AddServerConfig(ctx context.Context, req *game.AddServerConfigReq) (res *game.AddServerConfigRes, err error)
GetRouter(ctx context.Context, req *game.GetRouterReq) (res *game.GetRouterRes, err error)
@ -229,11 +228,10 @@ func (c *gameLoginUrlImpl) GetGameLoginUrl(ctx context.Context, req *game.GetGam
}
func (c *gameLoginUrlImpl) ReConfigServer(ctx context.Context, req *game.ReConfigServerReq) (res *game.ReConfigServerRes, err error) {
if req.SType == 1 {
if req.SType == 2 {
service.AliYunSms().ConfigInit()
service.Email().ConfigInit()
service.TencentSms().ConfigInit()
} else if req.SType == 2 {
internal.InitChannel(ctx)
} else {
internal.InitServer(ctx)
@ -244,14 +242,6 @@ func (c *gameLoginUrlImpl) ReConfigServer(ctx context.Context, req *game.ReConfi
return
}
func (c *gameLoginUrlImpl) GetAllChannel(ctx context.Context, req *game.GetAllChannelReq) (res *game.GetAllChannelRes, err error) {
g.Try(ctx, func(ctx context.Context) {
res = new(game.GetAllChannelRes)
res.List = internal.ChannelList
})
return
}
func (c *gameLoginUrlImpl) GetAllCcdUrl(ctx context.Context, req *game.GetAllCcdUrlReq) (res *game.GetAllCcdUrlRes, err error) {
res = new(game.GetAllCcdUrlRes)
g.Try(ctx, func(ctx context.Context) {

2
internal/serviceGame/order.go

@ -275,7 +275,7 @@ func (o gameOrderImpl) GetOrderCount(ctx context.Context, req *game.OrderCountRe
log.Println("GetOrderCount 1 : ", err.Error())
return
}
err = g.Model().Raw(sql).Page(req.PageNo, req.PageSize).OrderAsc("u.account").Scan(&res.Orders)
err = g.Model().Raw(sql).Page(req.PageNum, req.PageSize).OrderAsc("u.account").Scan(&res.Orders)
if err != nil {
log.Println("GetOrderCount 2 : ", err.Error())
return

Loading…
Cancel
Save