fix: unique tenancy and name check

This commit is contained in:
2024-06-25 10:55:07 +08:00
parent 4120483b17
commit e763c50aeb
5 changed files with 97 additions and 25 deletions

View File

@@ -25,6 +25,9 @@ type ISysTenant interface {
// CheckUniqueTenantName 校验同级租户名称是否唯一
CheckUniqueTenantName(tenantName, parentId, tenantId string) bool
// check unique tenancy_type and tenancy_key
IsUniqueTenancy(tenancyType, tenancyKey string) bool
// InsertTenant 新增租户信息
InsertTenant(sysTenant model.SysTenant) string

View File

@@ -73,6 +73,14 @@ func (r *SysTenantImpl) CheckUniqueTenantName(tenantName, parentId, tenantId str
return uniqueId == ""
}
// CheckUniqueTenantName 校验同级部门名称是否唯一
func (r *SysTenantImpl) IsUniqueTenancy(tenancyType, tenancyKey string) bool {
return r.sysTenantRepository.IsUniqueTenancy(model.SysTenant{
TenancyType: tenancyType,
TenancyKey: tenancyKey,
})
}
// InsertTenant 新增部门信息
func (r *SysTenantImpl) InsertTenant(sysTenant model.SysTenant) string {
return r.sysTenantRepository.InsertTenant(sysTenant)