|
@@ -32,6 +32,7 @@ import (
|
|
|
credit_balance "wechat-api/internal/handler/credit_balance"
|
|
|
credit_usage "wechat-api/internal/handler/credit_usage"
|
|
|
dashboard "wechat-api/internal/handler/dashboard"
|
|
|
+ department "wechat-api/internal/handler/department"
|
|
|
employee "wechat-api/internal/handler/employee"
|
|
|
employee_config "wechat-api/internal/handler/employee_config"
|
|
|
label "wechat-api/internal/handler/label"
|
|
@@ -52,7 +53,6 @@ import (
|
|
|
wxcarduser "wechat-api/internal/handler/wxcarduser"
|
|
|
wxcardvisit "wechat-api/internal/handler/wxcardvisit"
|
|
|
xiaoice "wechat-api/internal/handler/xiaoice"
|
|
|
-
|
|
|
"wechat-api/internal/svc"
|
|
|
|
|
|
"github.com/zeromicro/go-zero/rest"
|
|
@@ -876,7 +876,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
},
|
|
|
}...,
|
|
|
),
|
|
|
-
|
|
|
rest.WithPrefix("/v1"),
|
|
|
)
|
|
|
|
|
@@ -2097,4 +2096,38 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|
|
),
|
|
|
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
)
|
|
|
+
|
|
|
+ server.AddRoutes(
|
|
|
+ rest.WithMiddlewares(
|
|
|
+ []rest.Middleware{serverCtx.Authority},
|
|
|
+ []rest.Route{
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/department/create",
|
|
|
+ Handler: department.CreateDepartmentHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/department/update",
|
|
|
+ Handler: department.UpdateDepartmentHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/department/delete",
|
|
|
+ Handler: department.DeleteDepartmentHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/department/list",
|
|
|
+ Handler: department.GetDepartmentListHandler(serverCtx),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Method: http.MethodPost,
|
|
|
+ Path: "/department",
|
|
|
+ Handler: department.GetDepartmentByIdHandler(serverCtx),
|
|
|
+ },
|
|
|
+ }...,
|
|
|
+ ),
|
|
|
+ rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
|
|
+ )
|
|
|
}
|