| 1234567891011121314151617181920212223242526272829303132 |
- // Code scaffolded by goctl. Safe to edit.
- // goctl 1.10.2
- package application
- import (
- "net/http"
- "github.com/zeromicro/go-zero/rest/httpx"
- "udeServer/internal/logic/application"
- "udeServer/internal/svc"
- "udeServer/internal/types"
- )
- // 添加应用凭证
- func AddApplicationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.ApplicationCredentialsAddReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
- l := application.NewAddApplicationLogic(r.Context(), svcCtx)
- resp, err := l.AddApplication(&req)
- if err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- } else {
- httpx.OkJsonCtx(r.Context(), w, resp)
- }
- }
- }
|