diff --git a/api/desc/core/pcm-core.api b/api/desc/core/pcm-core.api index 7cb5b4e7..5bbf7c1e 100644 --- a/api/desc/core/pcm-core.api +++ b/api/desc/core/pcm-core.api @@ -551,10 +551,6 @@ type getHashcatHandlerReq { } type getHashcatHandlerResp { - HashCatList []HashCat `json:"hashCatList"` -} - -type HashCat { CrackTaskId string `json:"crackTaskId"` // 任务id CrackContainerId string `json:"crackContainerId"` // 容器id CrackStatus string `json:"crackStatus"` // 状态 @@ -579,6 +575,7 @@ type HashCat { RestoreSub string `json:"restoreSub"` } + type participantListResp { Participants []Participant `json:"participants"` } diff --git a/api/internal/logic/core/gethashcatlogic.go b/api/internal/logic/core/gethashcatlogic.go index d40dcb6b..eb26b700 100644 --- a/api/internal/logic/core/gethashcatlogic.go +++ b/api/internal/logic/core/gethashcatlogic.go @@ -39,12 +39,12 @@ func NewGetHashcatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetHas func (l *GetHashcatLogic) GetHashcat(req *types.GetHashcatHandlerReq) (resp *types.GetHashcatHandlerResp, err error) { // todo: add your logic here and delete this line - var hashcatList []*models.THashcat - tx := l.svcCtx.DbEngin.Where("crack_task_id = ?", req.CrackTaskId).Find(&hashcatList) + var hashcat *models.THashcat + tx := l.svcCtx.DbEngin.Where("crack_task_id = ?", req.CrackTaskId).Find(&hashcat) if tx.Error != nil { return nil, tx.Error } result := types.GetHashcatHandlerResp{} - utils.Convert(hashcatList, &result.HashCatList) + utils.Convert(hashcat, &result) return &result, nil } diff --git a/api/internal/types/types.go b/api/internal/types/types.go index 6ec3430b..b1887a56 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -515,10 +515,6 @@ type GetHashcatHandlerReq struct { } type GetHashcatHandlerResp struct { - HashCatList []HashCat `json:"hashCatList"` -} - -type HashCat struct { CrackTaskId string `json:"crackTaskId"` // 任务id CrackContainerId string `json:"crackContainerId"` // 容器id CrackStatus string `json:"crackStatus"` // 状态