feat: 添加争议微服务,支持订单争议流程
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
dispute "juwan-backend/app/dispute/api/internal/handler/dispute"
|
||||
"juwan-backend/app/dispute/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: "/disputes",
|
||||
Handler: dispute.ListDisputesHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 申诉
|
||||
Method: http.MethodPost,
|
||||
Path: "/disputes/:id/appeal",
|
||||
Handler: dispute.AppealDisputeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 回应争议
|
||||
Method: http.MethodPost,
|
||||
Path: "/disputes/:id/response",
|
||||
Handler: dispute.RespondDisputeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 获取订单争议
|
||||
Method: http.MethodGet,
|
||||
Path: "/orders/:id/dispute",
|
||||
Handler: dispute.GetOrderDisputeHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 发起争议
|
||||
Method: http.MethodPost,
|
||||
Path: "/orders/:id/dispute",
|
||||
Handler: dispute.CreateDisputeHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user