You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package department_admin
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.noahlan.cn/noahlan/ntool-biz/zero/statusz"
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
|
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/logic/department_admin"
|
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/svc"
|
|
"git.noahlan.cn/n-admin/n-admin-server/api/internal/types"
|
|
)
|
|
|
|
// swagger:route post /api/admin/department/update department_admin UpdateDepartmentAdmin
|
|
//
|
|
// Update department info | 更新部门信息
|
|
//
|
|
// Update department info | 更新部门信息
|
|
//
|
|
// Parameters:
|
|
// + name: body
|
|
// require: true
|
|
// in: body
|
|
// type: DepartmentInfo
|
|
//
|
|
|
|
func UpdateDepartmentAdminHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
const transErr = true
|
|
var req types.DepartmentInfo
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
statusz.ResponseHandler(r, w, transErr, nil, err)
|
|
return
|
|
}
|
|
|
|
l := department_admin.NewUpdateDepartmentAdminLogic(r, r.Context(), svcCtx)
|
|
err := l.UpdateDepartmentAdmin(&req)
|
|
|
|
statusz.ResponseHandler(r, w, transErr, nil, err)
|
|
|
|
}
|
|
}
|