fix []byte implimentation
This commit is contained in:
parent
5c863f56bd
commit
bf14e74520
@ -5,7 +5,6 @@ import (
|
||||
"database/sql"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/dal/sqlcgen"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
|
||||
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/pj_errors"
|
||||
)
|
||||
|
||||
type TgRepo struct {
|
||||
@ -42,19 +41,19 @@ func (r *TgRepo) CreateTgAccount(ctx context.Context, data model.TgAccount) (int
|
||||
func (r *TgRepo) GetAllTgAccounts(ctx context.Context) ([]model.TgAccount, error) {
|
||||
rows, err := r.queries.GetAllTgAccounts(ctx)
|
||||
if err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, pj_errors.ErrNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
var result []model.TgAccount
|
||||
for _, row := range rows {
|
||||
var status model.TgAccountStatus
|
||||
s := string(row.Status.([]byte))
|
||||
status = model.TgAccountStatus(s)
|
||||
result = append(result, model.TgAccount{
|
||||
ID: row.ID,
|
||||
ApiID: row.Apiid,
|
||||
ApiHash: row.Apihash,
|
||||
PhoneNumber: row.Phonenumber,
|
||||
Status: row.Status.(model.TgAccountStatus),
|
||||
Status: status,
|
||||
Deleted: row.Deleted,
|
||||
CreatedAt: row.Createdat,
|
||||
Password: row.Password,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user