This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Files
schisandra-cloud-album/service/role_service/role_service.go
2024-08-24 16:31:40 +08:00

24 lines
557 B
Go

package role_service
import (
"schisandra-cloud-album/global"
"schisandra-cloud-album/model"
)
// 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 roles, nil
}
// AddRole 新增角色
func (RoleService) AddRole(role model.ScaAuthRole) error {
if err := global.DB.Create(&role).Error; err != nil {
return err
}
return nil
}