修复 「1.2.2 用户管理-用户列表勾选单一用户会全选 」 close #216

This commit is contained in:
dushixiang
2022-01-23 17:53:22 +08:00
parent 29c066ca3a
commit d35b348a33
130 changed files with 5467 additions and 4554 deletions

View File

@ -0,0 +1,29 @@
package repository
import (
"context"
"next-terminal/server/model"
)
type accessTokenRepository struct {
baseRepository
}
func (repo accessTokenRepository) FindByUserId(ctx context.Context, userId string) (o model.AccessToken, err error) {
err = repo.GetDB(ctx).Where("user_id = ?", userId).First(&o).Error
return
}
func (repo accessTokenRepository) DeleteByUserId(ctx context.Context, userId string) error {
return repo.GetDB(ctx).Where("user_id = ?", userId).Delete(&model.AccessToken{}).Error
}
func (repo accessTokenRepository) Create(ctx context.Context, o *model.AccessToken) error {
return repo.GetDB(ctx).Create(o).Error
}
func (repo accessTokenRepository) FindAll(ctx context.Context) (o []model.AccessToken, err error) {
err = repo.GetDB(ctx).Find(&o).Error
return
}