You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

createmodelhandler.go 812 B

1234567891011121314151617181920212223242526272829303132
  1. package ai
  2. import (
  3. "encoding/json"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/ai"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  6. Model "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types/ai"
  7. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
  8. "io"
  9. "net/http"
  10. )
  11. func CreateModelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  12. return func(w http.ResponseWriter, r *http.Request) {
  13. var req Model.CreateModelReq
  14. body, err := io.ReadAll(r.Body)
  15. if err != nil {
  16. result.ParamErrorResult(r, w, err)
  17. return
  18. }
  19. if err = json.Unmarshal(body, &req); err != nil {
  20. result.ParamErrorResult(r, w, err)
  21. return
  22. }
  23. l := ai.NewCreateModelLogic(r.Context(), svcCtx)
  24. resp, err := l.CreateModel(&req)
  25. result.HttpResult(r, w, resp, err)
  26. }
  27. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.