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

package handler

import (
	"net/http"

	review "juwan-backend/app/review/api/internal/handler/review"
	"juwan-backend/app/review/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:    "/orders/:id/review",
				Handler: review.SubmitReviewHandler(serverCtx),
			},
			{
				// 获取订单评价
				Method:  http.MethodGet,
				Path:    "/orders/:id/reviews",
				Handler: review.GetOrderReviewsHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1"),
	)

	server.AddRoutes(
		[]rest.Route{
			{
				// 获取公开评价列表
				Method:  http.MethodGet,
				Path:    "/reviews",
				Handler: review.ListReviewsHandler(serverCtx),
			},
			{
				// 获取用户收到的评价
				Method:  http.MethodGet,
				Path:    "/users/:id/reviews",
				Handler: review.ListUserReviewsHandler(serverCtx),
			},
		},
		rest.WithPrefix("/api/v1"),
	)
}
