|
|
|
@@ -5,7 +5,9 @@ import ( |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/cloud" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/types" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" |
|
|
|
"k8s.io/apimachinery/pkg/util/json" |
|
|
|
"net/http" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -17,8 +19,14 @@ func CommitGeneralTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { |
|
|
|
result.ParamErrorResult(r, w, err) |
|
|
|
return |
|
|
|
} |
|
|
|
// 获取token信息 |
|
|
|
token := r.Header.Get("Authorization") |
|
|
|
req.Token = token |
|
|
|
// 获取用户信息 |
|
|
|
userStr := r.Header.Get("User") |
|
|
|
user := &models.JccUserInfo{} |
|
|
|
json.Unmarshal([]byte(userStr), user) |
|
|
|
req.UserId = user.Id |
|
|
|
l := cloud.NewCommitGeneralTaskLogic(r.Context(), svcCtx) |
|
|
|
err := l.CommitGeneralTask(&req) |
|
|
|
result.HttpResult(r, w, nil, err) |
|
|
|
|