93 lines
2.3 KiB
Go
Raw Permalink Normal View History

2025-01-20 01:55:44 +08:00
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.5
package handler
import (
"net/http"
"time"
app_user "gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/handler/app_user"
douyin "gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/handler/douyin"
game "gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/handler/game"
wechat "gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/handler/wechat"
"gitea.youtukeji.com.cn/xiabin/youtu_server/game_open_api/internal/svc"
2025-01-20 01:55:44 +08:00
"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),
},
},
2025-01-20 10:10:08 +08:00
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
2025-01-20 01:55:44 +08:00
rest.WithPrefix("/v1/app_user"),
rest.WithTimeout(3000*time.Millisecond),
rest.WithMaxBytes(1048576),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
2025-01-20 18:20:25 +08:00
Path: "/code2token",
Handler: douyin.DouyinCode2tokenHandler(serverCtx),
2025-01-20 01:55:44 +08:00
},
2025-01-20 10:10:08 +08:00
},
rest.WithPrefix("/v1/douyin"),
rest.WithTimeout(3000*time.Millisecond),
rest.WithMaxBytes(1048576),
)
server.AddRoutes(
[]rest.Route{
2025-01-20 01:55:44 +08:00
{
Method: http.MethodGet,
Path: "/getEcpm",
Handler: douyin.GetEcpmHandler(serverCtx),
},
},
2025-01-20 10:10:08 +08:00
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
2025-01-20 01:55:44 +08:00
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),
},
},
2025-01-20 10:10:08 +08:00
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
2025-01-20 01:55:44 +08:00
rest.WithPrefix("/v1/game"),
2025-01-22 12:02:12 +08:00
rest.WithTimeout(30000*time.Millisecond),
2025-01-20 01:55:44 +08:00
rest.WithMaxBytes(1048576),
)
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
2025-01-20 18:20:25 +08:00
Path: "/code2token",
2025-01-20 01:55:44 +08:00
Handler: wechat.WechatCode2UserIdHandler(serverCtx),
},
},
rest.WithPrefix("/v1/wechat"),
rest.WithTimeout(3000*time.Millisecond),
rest.WithMaxBytes(1048576),
)
}