后台面板上线
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package admin_query
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"tyc-server/app/main/api/internal/logic/admin_query"
|
||||
"tyc-server/app/main/api/internal/svc"
|
||||
"tyc-server/app/main/api/internal/types"
|
||||
"tyc-server/common/result"
|
||||
"tyc-server/pkg/lzkit/validator"
|
||||
)
|
||||
|
||||
func AdminGetQueryDetailByOrderIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.AdminGetQueryDetailByOrderIdReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
result.ParamErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
if err := validator.Validate(req); err != nil {
|
||||
result.ParamValidateErrorResult(r, w, err)
|
||||
return
|
||||
}
|
||||
l := admin_query.NewAdminGetQueryDetailByOrderIdLogic(r.Context(), svcCtx)
|
||||
resp, err := l.AdminGetQueryDetailByOrderId(&req)
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
admin_platform_user "tyc-server/app/main/api/internal/handler/admin_platform_user"
|
||||
admin_product "tyc-server/app/main/api/internal/handler/admin_product"
|
||||
admin_promotion "tyc-server/app/main/api/internal/handler/admin_promotion"
|
||||
admin_query "tyc-server/app/main/api/internal/handler/admin_query"
|
||||
admin_role "tyc-server/app/main/api/internal/handler/admin_role"
|
||||
admin_user "tyc-server/app/main/api/internal/handler/admin_user"
|
||||
auth "tyc-server/app/main/api/internal/handler/auth"
|
||||
@@ -327,6 +328,19 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/v1/admin/promotion/stats"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 获取查询详情
|
||||
Method: http.MethodGet,
|
||||
Path: "/detail/:order_id",
|
||||
Handler: admin_query.AdminGetQueryDetailByOrderIdHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),
|
||||
rest.WithPrefix("/api/v1/admin/query"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user