// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1

package handler

import (
	"net/http"

	player "juwan-backend/app/player/api/internal/handler/player"
	"juwan-backend/app/player/api/internal/svc"

	"github.com/zeromicro/go-zero/rest"
)

func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
	server.AddRoutes(
		[]rest.Route{
			{
				// 获取打手列表
				Method:  http.MethodGet,
				Path:    "/players",
				Handler: player.ListPlayersHandler(serverCtx),
			},
			{
				// 获取打手详情
				Method:  http.MethodGet,
				Path:    "/players/:id",
				Handler: player.GetPlayerHandler(serverCtx),
			},
			{
				// 获取指定打手的服务列表
				Method:  http.MethodGet,
				Path:    "/players/:id/services",
				Handler: player.ListPlayerServicesHandler(serverCtx),
			},
			{
				// 获取所有服务列表
				Method:  http.MethodGet,
				Path:    "/services",
				Handler: player.ListServicesHandler(serverCtx),
			},
			{
				// 获取服务详情
				Method:  http.MethodGet,
				Path:    "/services/:id",
				Handler: player.GetServiceHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1"),
	)

	server.AddRoutes(
		[]rest.Route{
			{
				// 初始化当前用户的打手资料
				Method:  http.MethodPost,
				Path:    "/players/me",
				Handler: player.InitPlayerHandler(serverCtx),
			},
			{
				// 获取当前用户的打手资料
				Method:  http.MethodGet,
				Path:    "/players/me",
				Handler: player.GetMyPlayerHandler(serverCtx),
			},
			{
				// 更新接单状态
				Method:  http.MethodPut,
				Path:    "/players/me/status",
				Handler: player.UpdatePlayerStatusHandler(serverCtx),
			},
			{
				// 创建服务
				Method:  http.MethodPost,
				Path:    "/services",
				Handler: player.CreateServiceHandler(serverCtx),
			},
			{
				// 更新服务
				Method:  http.MethodPut,
				Path:    "/services/:id",
				Handler: player.UpdateServiceHandler(serverCtx),
			},
			{
				// 删除服务
				Method:  http.MethodDelete,
				Path:    "/services/:id",
				Handler: player.DeleteServiceHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1"),
	)
}
