feat: 调整单个数据库资源可配置多个数据库

This commit is contained in:
meilin.huang
2022-05-08 14:10:57 +08:00
parent 483f5b7604
commit 9db3db31be
26 changed files with 329 additions and 143 deletions

View File

@@ -37,7 +37,7 @@ type Project interface {
DeleteMember(projectId, accountId uint64)
// 账号是否有权限访问该项目关联的资源信息
CanAccess(accountId, projectId uint64) bool
CanAccess(accountId, projectId uint64) error
}
type projectAppImpl struct {
@@ -120,6 +120,9 @@ func (p *projectAppImpl) DeleteMember(projectId, accountId uint64) {
p.projectMemberRepo.DeleteByPidMid(projectId, accountId)
}
func (p *projectAppImpl) CanAccess(accountId, projectId uint64) bool {
return p.projectMemberRepo.IsExist(projectId, accountId)
func (p *projectAppImpl) CanAccess(accountId, projectId uint64) error {
if p.projectMemberRepo.IsExist(projectId, accountId) {
return nil
}
return biz.NewBizErr("您无权操作该资源")
}