| 1234567891011121314151617181920212223242526272829303132 |
- // Code scaffolded by goctl. Safe to edit.
- // goctl 1.10.2
- package applicationconfig
- import (
- "net/http"
- "github.com/zeromicro/go-zero/rest/httpx"
- "udeServer/internal/logic/applicationconfig"
- "udeServer/internal/svc"
- "udeServer/internal/types"
- )
- // 更新配置(默认配置 edit_flag=1 不允许改配置项名)
- func UpdateConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.ConfigUpdateReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
- l := applicationconfig.NewUpdateConfigLogic(r.Context(), svcCtx)
- resp, err := l.UpdateConfig(&req)
- if err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- } else {
- httpx.OkJsonCtx(r.Context(), w, resp)
- }
- }
- }
|