创建智算任务增加token
This commit is contained in:
parent
16758c05c0
commit
a458c85231
|
@ -157,6 +157,7 @@ type (
|
|||
|
||||
type (
|
||||
GeneralTaskReq {
|
||||
Token string `json:"token"`
|
||||
Name string `json:"name"`
|
||||
AdapterIds []string `json:"adapterIds"`
|
||||
ClusterIds []string `json:"clusterIds"`
|
||||
|
@ -331,7 +332,6 @@ type(
|
|||
Status string `json:"status,optional"`
|
||||
ClusterId int64 `json:"clusterId,optional"`
|
||||
AdapterId string `json:"adapterId,optional"`
|
||||
|
||||
}
|
||||
|
||||
asynCommitAiTaskResp {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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"`
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue