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.

commithpctaskhandler.go 1.1 kB

12345678910111213141516171819202122232425262728293031323334
  1. package hpc
  2. import (
  3. "github.com/zeromicro/go-zero/rest/httpx"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/hpc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  7. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
  8. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
  9. "k8s.io/apimachinery/pkg/util/json"
  10. "net/http"
  11. )
  12. func CommitHpcTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
  13. return func(w http.ResponseWriter, r *http.Request) {
  14. var req types.CommitHpcTaskReq
  15. if err := httpx.Parse(r, &req); err != nil {
  16. result.ParamErrorResult(r, w, err)
  17. return
  18. }
  19. // 获取token信息
  20. token := r.Header.Get("Authorization")
  21. req.Token = token
  22. // 获取用户信息
  23. userStr := r.Header.Get("User")
  24. user := &models.JccUserInfo{}
  25. json.Unmarshal([]byte(userStr), user)
  26. req.UserId = user.Id
  27. l := hpc.NewCommitHpcTaskLogic(r.Context(), svcCtx)
  28. resp, err := l.CommitHpcTask(&req)
  29. result.HttpResult(r, w, resp, err)
  30. }
  31. }

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.