查询任务排行,新增游戏基本接口
This commit is contained in:
21
internal/controller/game/game_v1_list.go
Normal file
21
internal/controller/game/game_v1_list.go
Normal file
@ -0,0 +1,21 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/game/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
|
||||
out, err := service.Game().GameList(ctx, &model.GameListIn{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &v1.ListRes{
|
||||
List: out.List,
|
||||
Total: out.Total,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user