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/dao/impl/role_dao_impl.go
2024-09-29 15:46:35 +08:00

26 lines
576 B
Go

package impl
import (
"schisandra-cloud-album/global"
"schisandra-cloud-album/model"
)
type RoleDaoImpl struct{}
// GetRoleListByIds : 通过Id列表获取角色信息列表
func (RoleDaoImpl) 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 (RoleDaoImpl) AddRole(role model.ScaAuthRole) error {
if err := global.DB.Create(&role).Error; err != nil {
return err
}
return nil
}