update query
This commit is contained in:
parent
c3faa2a21c
commit
c2a0ba2ac3
@ -85,3 +85,27 @@ func (r *TgRepo) SoftDeleteTgAccount(ctx context.Context, id int64) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *TgRepo) SearchIDByAppIDanAppHash(ctx context.Context, appID int32, appHash string) (*model.TgAccount, error) {
|
||||||
|
row, err := r.queries.SearchIDByAppIDanAppHash(ctx, sqlcgen.SearchIDByAppIDanAppHashParams{
|
||||||
|
Apiid: appID,
|
||||||
|
Apihash: appHash,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var status model.TgAccountStatus
|
||||||
|
s := string(row.Status.([]byte))
|
||||||
|
status = model.TgAccountStatus(s)
|
||||||
|
|
||||||
|
return &model.TgAccount{
|
||||||
|
ID: row.ID,
|
||||||
|
ApiID: row.Apiid,
|
||||||
|
ApiHash: row.Apihash,
|
||||||
|
PhoneNumber: row.Phonenumber,
|
||||||
|
Status: status,
|
||||||
|
Deleted: row.Deleted,
|
||||||
|
CreatedAt: row.Createdat,
|
||||||
|
Password: row.Password,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user