82 lines
1.8 KiB
Go
82 lines
1.8 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.7.5
|
|
|
|
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
|
|
app_user "youtu_server/game_open_api/internal/handler/app_user"
|
|
douyin "youtu_server/game_open_api/internal/handler/douyin"
|
|
game "youtu_server/game_open_api/internal/handler/game"
|
|
wechat "youtu_server/game_open_api/internal/handler/wechat"
|
|
"youtu_server/game_open_api/internal/svc"
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
)
|
|
|
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/set_app_account",
|
|
Handler: app_user.AppUserSetUserHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/v1/app_user"),
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
rest.WithMaxBytes(1048576),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/code2userId",
|
|
Handler: douyin.DouyinCode2UserIdHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/getEcpm",
|
|
Handler: douyin.GetEcpmHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/v1/douyin"),
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
rest.WithMaxBytes(1048576),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/ranking/list",
|
|
Handler: game.RankingListHandler(serverCtx),
|
|
},
|
|
{
|
|
Method: http.MethodPost,
|
|
Path: "/ranking/set_score",
|
|
Handler: game.RankingSetScoreHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/v1/game"),
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
rest.WithMaxBytes(1048576),
|
|
)
|
|
|
|
server.AddRoutes(
|
|
[]rest.Route{
|
|
{
|
|
Method: http.MethodGet,
|
|
Path: "/code2userId",
|
|
Handler: wechat.WechatCode2UserIdHandler(serverCtx),
|
|
},
|
|
},
|
|
rest.WithPrefix("/v1/wechat"),
|
|
rest.WithTimeout(3000*time.Millisecond),
|
|
rest.WithMaxBytes(1048576),
|
|
)
|
|
}
|