You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
784 B
31 lines
784 B
2 years ago
|
package controller
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"tyj_admin/api/v1/game"
|
||
|
"tyj_admin/internal/model/entity"
|
||
|
"tyj_admin/internal/service"
|
||
|
"tyj_admin/internal/serviceGame"
|
||
|
)
|
||
|
|
||
|
var GamePub = pubController{}
|
||
|
|
||
|
type pubController struct {
|
||
|
BaseController
|
||
|
}
|
||
|
|
||
|
func (c *pubController) Get(ctx context.Context, req *game.GetGameNoticeReq) (res *game.GetGameNoticeRes, err error) {
|
||
|
res, err = serviceGame.GameNotice().GetGameNotice(ctx, req)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *pubController) GetUpdateUrl(ctx context.Context, req *game.GetGameUpdateUrlReq) (res *game.GetGameUpdateUrlRes, err error) {
|
||
|
config := new(entity.SysConfig)
|
||
|
res = new(game.GetGameUpdateUrlRes)
|
||
|
config, err = service.Config().GetByKey(ctx, req.Channel+"_url")
|
||
|
if err == nil && config != nil {
|
||
|
res.Url = config.ConfigValue
|
||
|
}
|
||
|
return
|
||
|
}
|