system_update_handler.go 838 字节
package department

import (
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/pkg/result"
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/logic/department"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/svc"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-discuss/cmd/discuss/api/internal/types"
)

func SystemUpdateHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		var req types.DepartmentUpdateRequest
		if err := httpx.Parse(r, &req); err != nil {
			result.ParamErrorResult(r, w, err)
			return
		}

		l := department.NewSystemUpdateLogic(r.Context(), svcCtx)
		resp, err := l.SystemUpdate(&req)
		result.HttpResult(r, w, resp, err)
	}
}