hashCat保存添加字段
Former-commit-id: fd1f09aaf66564d75189a9d12a8750a0192bb4f4
This commit is contained in:
parent
1a022a51a1
commit
28a661dc08
|
@ -531,6 +531,19 @@ type SaveHashcatReq {
|
|||
CrackResult string `json:"crackResult"` // 结果
|
||||
Started string `json:"started"` // 开始时间
|
||||
Stopped string `json:"stopped"` // 结束时间
|
||||
KernelFeature string `json:"kernelFeature"`
|
||||
HashMode string `json:"hashMode"`
|
||||
Rejected string `json:"rejected"`
|
||||
Session string `json:"session"`
|
||||
HashTarget string `json:"hashTarget"`
|
||||
Speed string `json:"speed"`
|
||||
Candidates string `json:"candidates"`
|
||||
RestorePoint string `json:"restorePoint"`
|
||||
Recovered string `json:"recovered"`
|
||||
GuessQueue string `json:"guessQueue"`
|
||||
CandidateEngine string `json:"candidateEngine"`
|
||||
GuessMask string `json:"guessMask"`
|
||||
RestoreSub string `json:"restoreSub"`
|
||||
}
|
||||
|
||||
type getHashcatHandlerReq {
|
||||
|
|
|
@ -38,10 +38,10 @@ func NewSaveHashcatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SaveH
|
|||
}
|
||||
|
||||
func (l *SaveHashcatLogic) SaveHashcat(req *types.SaveHashcatReq) error {
|
||||
var hashcat models.THashcat
|
||||
utils.Convert(req, &hashcat)
|
||||
hashcat.Id = utils.GenSnowflakeID()
|
||||
tx := l.svcCtx.DbEngin.Save(hashcat)
|
||||
var hashCat models.THashcat
|
||||
utils.Convert(req, &hashCat)
|
||||
hashCat.Id = utils.GenSnowflakeID()
|
||||
tx := l.svcCtx.DbEngin.Save(hashCat)
|
||||
if tx.Error != nil {
|
||||
return tx.Error
|
||||
}
|
||||
|
|
|
@ -495,6 +495,19 @@ type SaveHashcatReq struct {
|
|||
CrackResult string `json:"crackResult"` // 结果
|
||||
Started string `json:"started"` // 开始时间
|
||||
Stopped string `json:"stopped"` // 结束时间
|
||||
KernelFeature string `json:"kernelFeature"`
|
||||
HashMode string `json:"hashMode"`
|
||||
Rejected string `json:"rejected"`
|
||||
Session string `json:"session"`
|
||||
HashTarget string `json:"hashTarget"`
|
||||
Speed string `json:"speed"`
|
||||
Candidates string `json:"candidates"`
|
||||
RestorePoint string `json:"restorePoint"`
|
||||
Recovered string `json:"recovered"`
|
||||
GuessQueue string `json:"guessQueue"`
|
||||
CandidateEngine string `json:"candidateEngine"`
|
||||
GuessMask string `json:"guessMask"`
|
||||
RestoreSub string `json:"restoreSub"`
|
||||
}
|
||||
|
||||
type GetHashcatHandlerReq struct {
|
||||
|
|
|
@ -26,6 +26,19 @@ type (
|
|||
CreatedBy int64 `db:"created_by"` // 创建人
|
||||
UpdatedBy int64 `db:"updated_by"` // 更新人
|
||||
DeletedFlag int64 `db:"deleted_flag"` // 是否删除(0-否,1-是)
|
||||
KernelFeature string `db:"kernel_feature"`
|
||||
HashMode string `db:"hash_mode"`
|
||||
Rejected string `db:"rejected"`
|
||||
Session string `db:"session"`
|
||||
HashTarget string `db:"hash_target"`
|
||||
Speed string `db:"speed"`
|
||||
Candidates string `db:"candidates"`
|
||||
RestorePoint string `db:"restore_point"`
|
||||
Recovered string `db:"recovered"`
|
||||
GuessQueue string `db:"guess_queue"`
|
||||
CandidateEngine string `db:"candidate_engine"`
|
||||
GuessMask string `db:"guess_mask"`
|
||||
RestoreSub string `db:"restore_sub"`
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -57,14 +57,20 @@ func (l *SyncInfoLogic) SyncInfo(in *pcmCore.SyncInfoReq) (*pcmCore.SyncInfoResp
|
|||
switch kind {
|
||||
case constants.CLOUD:
|
||||
for _, cloudInfo := range in.CloudInfoList {
|
||||
l.svcCtx.DbEngin.Exec("update cloud set status = ?,start_time = ?,result = ? where participant_id = ? and id = ?",
|
||||
tx := l.svcCtx.DbEngin.Exec("update cloud set status = ?,start_time = ?,result = ? where participant_id = ? and id = ?",
|
||||
cloudInfo.Status, cloudInfo.StartTime, cloudInfo.Result, in.ParticipantId, cloudInfo.Id)
|
||||
if tx.Error != nil {
|
||||
logx.Error(tx.Error)
|
||||
}
|
||||
syncTask(l.svcCtx.DbEngin, cloudInfo.TaskId)
|
||||
}
|
||||
case constants.HPC:
|
||||
for _, hpcInfo := range in.HpcInfoList {
|
||||
l.svcCtx.DbEngin.Exec("update hpc set status = ?,start_time = ?,job_id = ? where participant_id = ? and task_id = ? and name = ?",
|
||||
tx := l.svcCtx.DbEngin.Exec("update hpc set status = ?,start_time = ?,job_id = ? where participant_id = ? and task_id = ? and name = ?",
|
||||
hpcInfo.Status, hpcInfo.StartTime, hpcInfo.RunningTime, hpcInfo.JobId, in.ParticipantId, hpcInfo.TaskId, hpcInfo.Name)
|
||||
if tx.Error != nil {
|
||||
logx.Error(tx.Error)
|
||||
}
|
||||
syncTask(l.svcCtx.DbEngin, hpcInfo.TaskId)
|
||||
}
|
||||
case constants.AI:
|
||||
|
|
Loading…
Reference in New Issue