⚡ 优化, close #3597 【优化】字典、角色、租户新增时增加唯一性校验

This commit is contained in:
qraddx committed 2022-02-05 17:04:04 +08:00
1 parent 7197203364
commit 048132d912
2 files changed
+22 -2

No files matched your search

@@ -60,6 +60,16 @@ public class SysRoleController {
return R.ok(sysRoleService.getById(id));
}
/**
* 通过角色编码查询角色信息
* @param code 角色Code
* @return 角色信息
*/
@GetMapping("/code/{code}")
public R getByRoleCode(@PathVariable String code) {
return R.ok(sysRoleService.list(Wrappers.<SysRole>lambdaQuery().eq(SysRole::getRoleCode, code)));
}
/**
* 添加角色
* @param sysRole 角色信息
@@ -26,7 +26,7 @@ import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.common.security.annotation.Inner;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -42,7 +42,7 @@ import java.util.stream.Collectors;
* @date 2019-05-15 15:55:41
*/
@RestController
@AllArgsConstructor
@RequiredArgsConstructor
@RequestMapping("/tenant")
@Api(value = "tenant", tags = "租户管理")
public class SysTenantController {
@@ -70,6 +70,16 @@ public class SysTenantController {
return R.ok(sysTenantService.getById(id));
}
/**
* 通过租户编码查询租户信息
* @param code 租户Code
* @return 租户信息
*/
@GetMapping("/code/{code}")
public R getByTenantCode(@PathVariable String code) {
return R.ok(sysTenantService.list(Wrappers.<SysTenant>lambdaQuery().eq(SysTenant::getCode, code)));
}
/**
* 新增租户
* @param sysTenant 租户