// Code scaffolded by goctl. Safe to edit. // goctl 1.10.0 package product import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "perms-system-server/internal/logic/product" "perms-system-server/internal/response" "perms-system-server/internal/svc" "perms-system-server/internal/types" ) // FetchInitialCredentialsHandler 一次性领取 CreateProduct 响应中未带回的 appSecret / adminPassword。 // 审计 M-4:配合 CreateProductHandler 把"敏感凭证落响应体"的老路径替换掉。 func FetchInitialCredentialsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { var req types.FetchInitialCredentialsReq if err := httpx.Parse(r, &req); err != nil { httpx.ErrorCtx(r.Context(), w, response.ErrBadRequest(err.Error())) return } l := product.NewFetchInitialCredentialsLogic(r.Context(), svcCtx) resp, err := l.FetchInitialCredentials(&req) if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.OkJsonCtx(r.Context(), w, resp) } } }