27 changed files with 914 additions and 750 deletions
@ -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 { |
||||
} |
@ -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"` |
||||
} |
@ -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"` |
||||
} |
@ -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"` |
||||
} |
@ -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:""` |
||||
} |
@ -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"` |
||||
} |
@ -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"` |
||||
} |
@ -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"` |
||||
} |
@ -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 |
||||
} |
@ -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 |
||||
} |
Loading…
Reference in new issue