|
12345678910111213141516171819202122232425262728 |
- package ai
-
- import (
- "net/http"
-
- "github.com/zeromicro/go-zero/rest/httpx"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/logic/ai"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
- )
-
- func ListServicesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.ListServicesReq
- if err := httpx.Parse(r, &req); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
-
- l := ai.NewListServicesLogic(r.Context(), svcCtx)
- resp, err := l.ListServices(&req)
- if err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- } else {
- httpx.OkJsonCtx(r.Context(), w, resp)
- }
- }
- }
|