|
|
@ -3,34 +3,75 @@ package org.dromara.business.controller; |
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission; |
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
import jakarta.validation.constraints.NotEmpty; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.dromara.business.domain.bo.BusinessLayerBo; |
|
|
|
|
|
|
|
import org.dromara.business.domain.vo.BusinessLayerVo; |
|
|
|
|
|
|
|
import org.dromara.business.service.IBusinessLayerService; |
|
|
|
import org.dromara.common.core.domain.R; |
|
|
|
import org.dromara.common.core.validate.AddGroup; |
|
|
|
import org.dromara.common.core.validate.EditGroup; |
|
|
|
import org.dromara.common.idempotent.annotation.RepeatSubmit; |
|
|
|
import org.dromara.common.log.annotation.Log; |
|
|
|
import org.dromara.common.log.enums.BusinessType; |
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery; |
|
|
|
import org.dromara.common.mybatis.core.page.TableDataInfo; |
|
|
|
import org.dromara.common.web.core.BaseController; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Validated |
|
|
|
@RequiredArgsConstructor |
|
|
|
@RestController |
|
|
|
@Tag(name = "图层模块") |
|
|
|
@RequestMapping("/layer") |
|
|
|
public class BusinessLayerController { |
|
|
|
public class BusinessLayerController extends BaseController { |
|
|
|
|
|
|
|
private final IBusinessLayerService businessLayerService; |
|
|
|
/** |
|
|
|
* 图层模块列表 |
|
|
|
*/ |
|
|
|
@SaCheckPermission("business:task:list") |
|
|
|
@SaCheckPermission("business:layer:list") |
|
|
|
@GetMapping("/list") |
|
|
|
public TableDataInfo<BusinessLayerVo> list(BusinessLayerBo bo, PageQuery pageQuery) { |
|
|
|
return businessLayerService.queryPageList(bo, pageQuery); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 图层新增 |
|
|
|
*/ |
|
|
|
@SaCheckPermission("business:layer:add") |
|
|
|
@Log(title = "图层新增", businessType = BusinessType.INSERT) |
|
|
|
@RepeatSubmit() |
|
|
|
@PostMapping() |
|
|
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusinessLayerBo bo) { |
|
|
|
return toAjax(businessLayerService.insert(bo)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 图层修改 |
|
|
|
*/ |
|
|
|
@SaCheckPermission("business:layer:edit") |
|
|
|
@Log(title = "图层修改", businessType = BusinessType.UPDATE) |
|
|
|
@RepeatSubmit() |
|
|
|
@PutMapping() |
|
|
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusinessLayerBo bo) { |
|
|
|
return toAjax(businessLayerService.update(bo)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 删除 |
|
|
|
* |
|
|
|
* @param id 主键 |
|
|
|
*/ |
|
|
|
@SaCheckPermission("business:task:remove") |
|
|
|
@Log(title = "图层删除", businessType = BusinessType.DELETE) |
|
|
|
@DeleteMapping("/{id}") |
|
|
|
public R<Void> remove(@NotEmpty(message = "主键不能为空") |
|
|
|
@PathVariable Long id) { |
|
|
|
return toAjax(businessLayerService.delete(id)); |
|
|
|
} |
|
|
|
} |
|
|
|