🔒 token encryption

This commit is contained in:
landaiqing
2024-08-14 19:57:37 +08:00
parent 368adadf52
commit 55759a33db
19 changed files with 241 additions and 39 deletions

View File

@@ -5,11 +5,11 @@ import (
"schisandra-cloud-album/model"
)
// GetRoleById : 通过Id获取角色信息
func (RoleService) GetRoleById(id int64) (model.ScaAuthRole, error) {
var role model.ScaAuthRole
if err := global.DB.Where("id = ? and deleted = 0", id).First(&role).Error; err != nil {
return model.ScaAuthRole{}, err
// GetRoleListByIds : 通过Id列表获取角色信息列表
func (RoleService) GetRoleListByIds(id []*int64) ([]model.ScaAuthRole, error) {
var roles []model.ScaAuthRole
if err := global.DB.Where("id IN ?", id).Find(&roles).Error; err != nil {
return nil, err
}
return role, nil
return roles, nil
}