|
|
|
@@ -5,9 +5,8 @@ import ( |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/internal/logic/core" |
|
|
|
"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" |
|
|
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" |
|
|
|
"net/http" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -18,12 +17,15 @@ func PageListTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { |
|
|
|
result.ParamErrorResult(r, w, err) |
|
|
|
return |
|
|
|
} |
|
|
|
token := r.Header.Get("Authorization") |
|
|
|
// 获取用户信息 |
|
|
|
userStr := r.Header.Get("User") |
|
|
|
user := &models.JccUserInfo{} |
|
|
|
json.Unmarshal([]byte(userStr), user) |
|
|
|
req.UserId = user.Id |
|
|
|
req.UserName = user.UserName |
|
|
|
jccUserInfo, err := utils.ParseTokenWithoutVerify(token) |
|
|
|
if err != nil { |
|
|
|
result.ParamErrorResult(r, w, err) |
|
|
|
return |
|
|
|
} |
|
|
|
req.UserId = jccUserInfo.Id |
|
|
|
req.UserName = jccUserInfo.UserName |
|
|
|
l := core.NewPageListTaskLogic(r.Context(), svcCtx) |
|
|
|
resp, err := l.PageListTask(&req) |
|
|
|
result.HttpResult(r, w, resp, err) |
|
|
|
|