|
@@ -1,23 +1,22 @@
|
|
package com.platform.rest.controller.custom;
|
|
package com.platform.rest.controller.custom;
|
|
|
|
|
|
|
|
+import com.platform.common.bean.AbstractPageResultBean;
|
|
|
|
+import com.platform.common.util.BeanConverterUtil;
|
|
import com.platform.common.util.R;
|
|
import com.platform.common.util.R;
|
|
|
|
+import com.platform.common.validation.group.AddGroup;
|
|
|
|
+import com.platform.common.validation.group.UpdateGroup;
|
|
import com.platform.dao.dto.custom.CustomClassNameDTO;
|
|
import com.platform.dao.dto.custom.CustomClassNameDTO;
|
|
import com.platform.dao.entity.custom.CustomClassName;
|
|
import com.platform.dao.entity.custom.CustomClassName;
|
|
-import com.platform.service.custom.CustomClassNameService;
|
|
|
|
import com.platform.dao.util.ExcelUtil;
|
|
import com.platform.dao.util.ExcelUtil;
|
|
import com.platform.dao.vo.export.custom.ExportCustomClassNameVO;
|
|
import com.platform.dao.vo.export.custom.ExportCustomClassNameVO;
|
|
import com.platform.dao.vo.query.custom.CustomClassNameVO;
|
|
import com.platform.dao.vo.query.custom.CustomClassNameVO;
|
|
-import com.platform.common.util.BeanConverterUtil;
|
|
|
|
-import com.platform.common.validation.group.AddGroup;
|
|
|
|
-import com.platform.common.validation.group.UpdateGroup;
|
|
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
|
+import com.platform.rest.log.annotation.SysLog;
|
|
|
|
+import com.platform.service.custom.CustomClassNameService;
|
|
|
|
+import lombok.AllArgsConstructor;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
-import lombok.AllArgsConstructor;
|
|
|
|
-import com.platform.common.bean.AbstractPageResultBean;
|
|
|
|
-import com.platform.rest.log.annotation.SysLog;
|
|
|
|
-import java.util.List;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description 自定义配置类 控制器
|
|
* @Description 自定义配置类 控制器
|
|
@@ -51,9 +50,8 @@ public class CustomClassNameController {
|
|
*/
|
|
*/
|
|
@SysLog("新增自定义配置类")
|
|
@SysLog("新增自定义配置类")
|
|
@PostMapping
|
|
@PostMapping
|
|
- @PreAuthorize("@pms.hasPermission('custom-className-add')")
|
|
|
|
public R save(@Validated({AddGroup.class}) @RequestBody CustomClassNameDTO customClassNameDTO) {
|
|
public R save(@Validated({AddGroup.class}) @RequestBody CustomClassNameDTO customClassNameDTO) {
|
|
- return new R<>(customClassNameService.saveModelByDTO(customClassNameDTO));
|
|
|
|
|
|
+ return new R<>(customClassNameService.saveByDTO(customClassNameDTO));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -64,7 +62,6 @@ public class CustomClassNameController {
|
|
*/
|
|
*/
|
|
@SysLog("修改自定义配置类")
|
|
@SysLog("修改自定义配置类")
|
|
@PutMapping("/{id}")
|
|
@PutMapping("/{id}")
|
|
- @PreAuthorize("@pms.hasPermission('custom-className-edit')")
|
|
|
|
public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody CustomClassNameDTO customClassNameDTO) {
|
|
public R update(@PathVariable("id") String id, @Validated({UpdateGroup.class}) @RequestBody CustomClassNameDTO customClassNameDTO) {
|
|
customClassNameService.modModelByDTO(customClassNameDTO);
|
|
customClassNameService.modModelByDTO(customClassNameDTO);
|
|
return new R<>();
|
|
return new R<>();
|
|
@@ -80,7 +77,6 @@ public class CustomClassNameController {
|
|
*/
|
|
*/
|
|
@SysLog("删除自定义配置类")
|
|
@SysLog("删除自定义配置类")
|
|
@DeleteMapping("/{id}")
|
|
@DeleteMapping("/{id}")
|
|
- @PreAuthorize("@pms.hasPermission('custom-className-del')")
|
|
|
|
public R removeById(@PathVariable String id){
|
|
public R removeById(@PathVariable String id){
|
|
customClassNameService.deleteByPrimaryKey(id);
|
|
customClassNameService.deleteByPrimaryKey(id);
|
|
return new R<>();
|
|
return new R<>();
|
|
@@ -94,7 +90,6 @@ public class CustomClassNameController {
|
|
*/
|
|
*/
|
|
@SysLog("批量删除自定义配置类")
|
|
@SysLog("批量删除自定义配置类")
|
|
@DeleteMapping("")
|
|
@DeleteMapping("")
|
|
- @PreAuthorize("@pms.hasPermission('custom-className-del')")
|
|
|
|
public R removeIds(@RequestBody List<String> ids){
|
|
public R removeIds(@RequestBody List<String> ids){
|
|
customClassNameService.batchDelete(ids);
|
|
customClassNameService.batchDelete(ids);
|
|
return new R<>();
|
|
return new R<>();
|
|
@@ -132,7 +127,6 @@ public class CustomClassNameController {
|
|
*/
|
|
*/
|
|
@GetMapping("/export")
|
|
@GetMapping("/export")
|
|
@SysLog("自定义配置类导出")
|
|
@SysLog("自定义配置类导出")
|
|
- @PreAuthorize("@pms.hasPermission('custom-className-export')")
|
|
|
|
public void export(HttpServletResponse response, CustomClassNameDTO customClassNameDTO) {
|
|
public void export(HttpServletResponse response, CustomClassNameDTO customClassNameDTO) {
|
|
List<CustomClassName> list = customClassNameService.getModelListByDTO(customClassNameDTO);
|
|
List<CustomClassName> list = customClassNameService.getModelListByDTO(customClassNameDTO);
|
|
ExcelUtil.exportResponseDict(response, ExportCustomClassNameVO.class, BeanConverterUtil.copyListProperties(list, ExportCustomClassNameVO.class), "自定义配置类");
|
|
ExcelUtil.exportResponseDict(response, ExportCustomClassNameVO.class, BeanConverterUtil.copyListProperties(list, ExportCustomClassNameVO.class), "自定义配置类");
|