From 347313fb14eda666f925c7b0e276710199103e4c Mon Sep 17 00:00:00 2001 From: zhangwei <894646498@qq.com> Date: Thu, 14 Dec 2023 17:00:48 +0800 Subject: [PATCH] =?UTF-8?q?hashCat=E5=B1=95=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 9d8eb73a9398431b66e18415173411b65b6643e0 --- api/desc/core/pcm-core.api | 5 +---- api/internal/logic/core/gethashcatlogic.go | 6 +++--- api/internal/types/types.go | 4 ---- 3 files changed, 4 insertions(+), 11 deletions(-) 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"` // 状态