diff --git a/configs/registry.go b/configs/registry.go deleted file mode 100644 index a763a73..0000000 --- a/configs/registry.go +++ /dev/null @@ -1,39 +0,0 @@ -package configs - -import ( - "apigame/configs/confroomrank" - "apigame/service-common/svmysql" - "apigame/service-common/svredis" - "apigame/util/util-lx/lxalilog" - "fmt" -) - -// GetRoomRankConfig 获取 房间排行活动配置 -func GetRoomRankConfig(gameId string) (conf *confroomrank.ActivityConfig, has bool) { - var err error - conf = new(confroomrank.ActivityConfig) - has = svredis.LoadData(gameId, conf) - if has { - fmt.Println("dwjw GetRoomRankConfig use cache") - return - } - confRaw := new(confroomrank.ActivityConfigRaw) - has, err = svmysql.First(confRaw, gameId) - if err != nil { - lxalilog.Errors(err, "configs.GetRoomRankConfig error", gameId) - return - } - if !has { - - return - } - - conf.Decode(gameId, confRaw) - - fmt.Println("dwjw GetRoomRankConfig save cache") - fmt.Println("dwjw🐸", conf.Robot) - fmt.Println("dwjw🐸", conf.Room) - svredis.SaveData(gameId, conf) - - return -} diff --git a/service/roomrank/handle.go b/service/roomrank/handle.go index 380f962..2015fbc 100644 --- a/service/roomrank/handle.go +++ b/service/roomrank/handle.go @@ -1,7 +1,6 @@ package roomrank import ( - "apigame/configs" "apigame/configs/confroomrank" "apigame/models" "apigame/service/code-msg" @@ -30,7 +29,7 @@ func HandleInfo(req *models.ReqRoomRankInfo) (code string, rsp models.RspRoomRan playerUid := req.UID // 尝试更新配置 - config, hasConfig := configs.GetRoomRankConfig(gameId) + config, hasConfig := confroomrank.GetCurrent(gameId) if !hasConfig { code = code_msg.RECODE_MERGE_ROOMRANK_NOTOPEN_ERROR return -- libgit2 0.21.0