|
|
@ -1,7 +1,9 @@ |
|
|
|
package com.acupuncture.web.controller.web; |
|
|
|
|
|
|
|
import com.acupuncture.common.annotation.DataSource; |
|
|
|
import com.acupuncture.common.core.domain.BaseDto; |
|
|
|
import com.acupuncture.common.core.domain.JsonResponse; |
|
|
|
import com.acupuncture.common.enums.DataSourceType; |
|
|
|
import com.acupuncture.common.utils.SecurityUtils; |
|
|
|
import com.acupuncture.system.domain.dto.AdminTenantsDto; |
|
|
|
import com.acupuncture.system.domain.vo.AdminTenantsVo; |
|
|
@ -37,6 +39,7 @@ public class AdminTenantsController { |
|
|
|
|
|
|
|
@ApiOperation("添加租户") |
|
|
|
@PostMapping("/add") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<Integer> insert(@RequestBody @Validated AdminTenantsDto.AddDto dto) { |
|
|
|
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
|
|
|
return JsonResponse.ok().fail("无权限"); |
|
|
@ -46,6 +49,7 @@ public class AdminTenantsController { |
|
|
|
|
|
|
|
@ApiOperation("修改租户") |
|
|
|
@PostMapping("/upd") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<Integer> update(@RequestBody @Validated AdminTenantsDto.UpdDto dto) { |
|
|
|
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
|
|
|
return JsonResponse.ok().fail("无权限"); |
|
|
@ -55,6 +59,7 @@ public class AdminTenantsController { |
|
|
|
|
|
|
|
@ApiOperation("删除租户") |
|
|
|
@PostMapping("/del") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<Integer> delete(@RequestBody @Validated AdminTenantsDto.DeleteDto dto) { |
|
|
|
if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { |
|
|
|
return JsonResponse.ok().fail("无权限"); |
|
|
@ -64,6 +69,7 @@ public class AdminTenantsController { |
|
|
|
|
|
|
|
@ApiOperation("查询租户") |
|
|
|
@PostMapping("/list") |
|
|
|
@DataSource(DataSourceType.MASTER) |
|
|
|
public JsonResponse<PageInfo<AdminTenantsVo.Result>> query(@RequestBody @Validated BaseDto<AdminTenantsDto.Query> dto) { |
|
|
|
if (dto.getPageNum() > 0) { |
|
|
|
PageHelper.startPage(dto.getPageNum(), dto.getPageSize()); |
|
|
|