🎨 update project structure

This commit is contained in:
landaiqing
2024-09-29 15:46:35 +08:00
parent 2769467ce2
commit 87f1ff6961
85 changed files with 693 additions and 431 deletions

25
dao/impl/role_dao_impl.go Normal file
View File

@@ -0,0 +1,25 @@
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
}