创建智算任务增加token

This commit is contained in:
zhangwei 2025-01-02 17:47:36 +08:00
parent 16758c05c0
commit a458c85231
5 changed files with 17 additions and 12 deletions

View File

@ -157,6 +157,7 @@ type (
type (
GeneralTaskReq {
Token string `json:"token"`
Name string `json:"name"`
AdapterIds []string `json:"adapterIds"`
ClusterIds []string `json:"clusterIds"`
@ -317,8 +318,8 @@ type (
}
)
type(
asynCommitAiTaskReq{
type (
asynCommitAiTaskReq {
Name string `json:"name,optional"`
AdapterIds []string `json:"adapterIds,optional"`
ClusterIds []string `json:"clusterIds,optional"`
@ -329,15 +330,14 @@ type(
Command string `json:"command,optional"`
FlavorId string `json:"flavorId,optional"`
Status string `json:"status,optional"`
ClusterId int64 `json:"clusterId,optional"`
AdapterId string `json:"adapterId,optional"`
ClusterId int64 `json:"clusterId,optional"`
AdapterId string `json:"adapterId,optional"`
}
asynCommitAiTaskResp{
Code int32 `json:"code"`
Msg string `json:"msg"`
TaskId int64 `json:"taskId"`
asynCommitAiTaskResp {
Code int32 `json:"code"`
Msg string `json:"msg"`
TaskId int64 `json:"taskId"`
}
)
@ -991,7 +991,7 @@ type adapterInfoNameReqResp {
Code int32 `json:"code,omitempty"`
Msg string `json:"msg,omitempty"`
ErrorMsg string `json:"errorMsg,omitempty"`
InfoList InfoList `json:"infoList,omitempty"`
InfoList InfoList `json:"infoList,omitempty"`
}
type InfoList {
@ -1279,7 +1279,7 @@ type (
TaskName string `json:"taskName"`
Incident string `json:"incident"`
}
ListNoticeReq{
ListNoticeReq {
}
ListNoticeResp {

View File

@ -11,12 +11,14 @@ import (
func CommitGeneralTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GeneralTaskReq
if err := httpx.Parse(r, &req); err != nil {
result.ParamErrorResult(r, w, err)
return
}
token := r.Header.Get("Authorization")
req.Token = token
l := cloud.NewCommitGeneralTaskLogic(r.Context(), svcCtx)
err := l.CommitGeneralTask(&req)
result.HttpResult(r, w, nil, err)

View File

@ -144,6 +144,7 @@ func (l *CommitGeneralTaskLogic) CommitGeneralTask(req *types.GeneralTaskReq) er
FunctionName: l.svcCtx.Config.BlockChain.FunctionName,
MemberName: l.svcCtx.Config.BlockChain.MemberName,
Type: l.svcCtx.Config.BlockChain.Type,
Token: req.Token,
Args: []string{strconv.FormatInt(taskModel.Id, 10), string(bytes)},
})
if db.Error != nil {

View File

@ -141,6 +141,7 @@ type Region struct {
}
type GeneralTaskReq struct {
Token string `json:"token"`
Name string `json:"name"`
AdapterIds []string `json:"adapterIds"`
ClusterIds []string `json:"clusterIds"`

View File

@ -11,6 +11,7 @@ type EvidenceParam struct {
ContractAddress string `json:"contractAddress"`
FunctionName string `json:"functionName"`
Args []string `json:"args"`
Token string `json:"token"`
}
func Evidence(EvidenceParam EvidenceParam) error {