hashCat展示修改

Former-commit-id: 9d8eb73a9398431b66e18415173411b65b6643e0
This commit is contained in:
zhangwei 2023-12-14 17:00:48 +08:00
parent 42fc9e7f39
commit 347313fb14
3 changed files with 4 additions and 11 deletions

View File

@ -551,10 +551,6 @@ type getHashcatHandlerReq {
} }
type getHashcatHandlerResp { type getHashcatHandlerResp {
HashCatList []HashCat `json:"hashCatList"`
}
type HashCat {
CrackTaskId string `json:"crackTaskId"` // 任务id CrackTaskId string `json:"crackTaskId"` // 任务id
CrackContainerId string `json:"crackContainerId"` // 容器id CrackContainerId string `json:"crackContainerId"` // 容器id
CrackStatus string `json:"crackStatus"` // 状态 CrackStatus string `json:"crackStatus"` // 状态
@ -579,6 +575,7 @@ type HashCat {
RestoreSub string `json:"restoreSub"` RestoreSub string `json:"restoreSub"`
} }
type participantListResp { type participantListResp {
Participants []Participant `json:"participants"` Participants []Participant `json:"participants"`
} }

View File

@ -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) { func (l *GetHashcatLogic) GetHashcat(req *types.GetHashcatHandlerReq) (resp *types.GetHashcatHandlerResp, err error) {
// todo: add your logic here and delete this line // todo: add your logic here and delete this line
var hashcatList []*models.THashcat var hashcat *models.THashcat
tx := l.svcCtx.DbEngin.Where("crack_task_id = ?", req.CrackTaskId).Find(&hashcatList) tx := l.svcCtx.DbEngin.Where("crack_task_id = ?", req.CrackTaskId).Find(&hashcat)
if tx.Error != nil { if tx.Error != nil {
return nil, tx.Error return nil, tx.Error
} }
result := types.GetHashcatHandlerResp{} result := types.GetHashcatHandlerResp{}
utils.Convert(hashcatList, &result.HashCatList) utils.Convert(hashcat, &result)
return &result, nil return &result, nil
} }

View File

@ -515,10 +515,6 @@ type GetHashcatHandlerReq struct {
} }
type GetHashcatHandlerResp struct { type GetHashcatHandlerResp struct {
HashCatList []HashCat `json:"hashCatList"`
}
type HashCat struct {
CrackTaskId string `json:"crackTaskId"` // 任务id CrackTaskId string `json:"crackTaskId"` // 任务id
CrackContainerId string `json:"crackContainerId"` // 容器id CrackContainerId string `json:"crackContainerId"` // 容器id
CrackStatus string `json:"crackStatus"` // 状态 CrackStatus string `json:"crackStatus"` // 状态