|
|
@@ -1,15 +1,15 @@
|
|
|
package cn.tr.module.sys.tenant.controller;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import cn.dev33.satoken.annotation.SaIgnore;
|
|
|
import cn.tr.core.annotation.TenantIgnore;
|
|
|
-import cn.tr.core.enums.CreateEnum;
|
|
|
import cn.tr.core.pojo.CommonResult;
|
|
|
+import cn.tr.core.strategy.LoginUserStrategy;
|
|
|
import cn.tr.core.validation.Insert;
|
|
|
import cn.tr.core.validation.Update;
|
|
|
import cn.tr.module.api.sys.log.annotation.OperateLog;
|
|
|
import cn.tr.module.sys.tenant.dto.*;
|
|
|
import cn.tr.module.sys.tenant.service.ISysTenantService;
|
|
|
+import cn.tr.module.sys.tenant.vo.SysTenantCommonVO;
|
|
|
import cn.tr.plugin.mybatis.base.BaseController;
|
|
|
import cn.tr.plugin.security.context.LoginUserContextHolder;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
@@ -22,12 +22,12 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
/**
|
|
|
- * 租户列表控制器
|
|
|
+ * 医院列表控制器
|
|
|
*
|
|
|
* @author lf
|
|
|
* @date 2023/04/15 15:27
|
|
|
*/
|
|
|
-@Api(tags = "租户列表")
|
|
|
+@Api(tags = "医院列表")
|
|
|
@RestController
|
|
|
@RequestMapping("/sys/tenant")
|
|
|
@AllArgsConstructor
|
|
|
@@ -36,54 +36,44 @@ public class SysTenantController extends BaseController{
|
|
|
private final ISysTenantService sysTenantService;
|
|
|
|
|
|
@ApiOperationSupport(author = "lf",order = 1)
|
|
|
- @ApiOperation(value="根据条件查询租户列表",notes = "权限: 无")
|
|
|
+ @ApiOperation(value="根据条件查询医院列表",notes = "权限: 无")
|
|
|
@PostMapping("/query/page")
|
|
|
- public CommonResult<List<SysTenantCommonDTO>> selectList(@RequestBody SysTenantQueryDTO query) {
|
|
|
+ @TenantIgnore
|
|
|
+ public CommonResult<List<SysTenantCommonVO>> selectList(@RequestBody SysTenantQueryDTO query) {
|
|
|
startPage();
|
|
|
return CommonResult.success(sysTenantService.selectSysTenantList(query));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperationSupport(author = "lf",order = 2)
|
|
|
- @ApiOperation(value = "根据id查询租户列表",notes = "权限: sys:tenant:query")
|
|
|
+ @ApiOperation(value = "根据id查询医院详情",notes = "权限: sys:tenant:query")
|
|
|
@GetMapping("/detail/{id}")
|
|
|
@SaCheckPermission("sys:tenant:query")
|
|
|
- public CommonResult<SysTenantCommonDTO> findById(@PathVariable("id") String id){
|
|
|
+ public CommonResult<SysTenantCommonVO> findById(@PathVariable("id") String id){
|
|
|
return CommonResult.success(sysTenantService.selectSysTenantById(id));
|
|
|
}
|
|
|
|
|
|
@ApiOperationSupport(author = "lf",order = 3)
|
|
|
- @ApiOperation(value="添加租户列表",notes = "权限: sys:tenant:add")
|
|
|
+ @ApiOperation(value="添加医院列表",notes = "权限: sys:tenant:add")
|
|
|
@PostMapping("/add")
|
|
|
@SaCheckPermission("sys:tenant:add")
|
|
|
@OperateLog
|
|
|
public CommonResult<Boolean> add(@RequestBody@Validated(Insert.class) SysTenantAddDTO source) {
|
|
|
- source.setType(CreateEnum.custom.name());
|
|
|
return CommonResult.success(sysTenantService.insertSysTenant(source));
|
|
|
}
|
|
|
|
|
|
@ApiOperationSupport(author = "lf",order = 4)
|
|
|
- @ApiOperation(value="通过主键id编辑租户列表",notes = "权限: sys:tenant:edit")
|
|
|
+ @ApiOperation(value="通过主键id编辑医院列表",notes = "权限: sys:tenant:edit")
|
|
|
@PostMapping("/edit")
|
|
|
@SaCheckPermission("sys:tenant:edit")
|
|
|
@OperateLog
|
|
|
- public CommonResult<Boolean> edit(@RequestBody@Validated(Update.class) SysTenantCommonDTO source) {
|
|
|
+ public CommonResult<Boolean> edit(@RequestBody@Validated(Update.class) SysTenantAddDTO source) {
|
|
|
return CommonResult.success(sysTenantService.updateSysTenantById(source));
|
|
|
}
|
|
|
|
|
|
- @ApiOperationSupport(author = "lf",order = 5)
|
|
|
- @ApiOperation(value="删除租户列表",notes = "权限: sys:tenant:remove")
|
|
|
- @PostMapping("/removeByIds")
|
|
|
- @SaCheckPermission("sys:tenant:remove")
|
|
|
- @OperateLog
|
|
|
- public CommonResult<Integer> delete(@RequestBody Collection<String> ids) {
|
|
|
- return CommonResult.success(sysTenantService.removeSysTenantByIds(ids));
|
|
|
- }
|
|
|
-
|
|
|
@ApiOperationSupport(author = "lf",order = 6)
|
|
|
@ApiOperation(value="查询当前用户的租户信息",notes = "权限: 无")
|
|
|
@PostMapping("/query/current")
|
|
|
- public CommonResult<SysTenantCommonDTO> selectList() {
|
|
|
- return CommonResult.success(sysTenantService.selectSysTenantById(LoginUserContextHolder.getUser().getTenantId()));
|
|
|
+ public CommonResult<SysTenantCommonVO> selectList() {
|
|
|
+ return CommonResult.success(sysTenantService.selectSysTenantById(LoginUserStrategy.tr.getTenantId()));
|
|
|
}
|
|
|
}
|