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

package handler

import (
	"net/http"

	order "juwan-backend/app/order/api/internal/handler/order"
	"juwan-backend/app/order/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:    "/",
				Handler: order.ListOrdersHandler(serverCtx),
			},
			{
				// 创建订单
				Method:  http.MethodPost,
				Path:    "/",
				Handler: order.CreateOrderHandler(serverCtx),
			},
			{
				// 获取订单详情
				Method:  http.MethodGet,
				Path:    "/:id",
				Handler: order.GetOrderHandler(serverCtx),
			},
			{
				// 接单
				Method:  http.MethodPost,
				Path:    "/:id/accept",
				Handler: order.AcceptOrderHandler(serverCtx),
			},
			{
				// 取消订单
				Method:  http.MethodPost,
				Path:    "/:id/cancel",
				Handler: order.CancelOrderHandler(serverCtx),
			},
			{
				// 确认结算
				Method:  http.MethodPost,
				Path:    "/:id/confirm-close",
				Handler: order.ConfirmCloseOrderHandler(serverCtx),
			},
			{
				// 支付订单
				Method:  http.MethodPost,
				Path:    "/:id/pay",
				Handler: order.PayOrderHandler(serverCtx),
			},
			{
				// 再来一单
				Method:  http.MethodPost,
				Path:    "/:id/reorder",
				Handler: order.ReorderHandler(serverCtx),
			},
			{
				// 申请结算
				Method:  http.MethodPost,
				Path:    "/:id/request-close",
				Handler: order.RequestCloseOrderHandler(serverCtx),
			},
			{
				// 创建并支付订单
				Method:  http.MethodPost,
				Path:    "/paid",
				Handler: order.CreateAndPayOrderHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1/orders"),
	)
}
