mapper
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.cnbm.basic.controller;
|
||||
|
||||
import com.cnbm.admin.annotation.LogOperation;
|
||||
import com.cnbm.admin.params.IdParam;
|
||||
import com.cnbm.basic.vo.MachineVo;
|
||||
import com.cnbm.common.constant.Constant;
|
||||
import com.cnbm.common.page.PageData;
|
||||
import com.cnbm.common.utils.ExcelUtils;
|
||||
@@ -46,7 +48,8 @@ public class MachineController {
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:page')")
|
||||
public Result<PageData<MachineDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
@@ -55,6 +58,22 @@ public class MachineController {
|
||||
return new Result<PageData<MachineDTO>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("page2")
|
||||
@ApiOperation("分页2")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataTypeClass = Integer.class)
|
||||
})
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:page')")
|
||||
public Result<PageData<MachineVo>> page2(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
PageData<MachineVo> page = machineService.page1(params);
|
||||
|
||||
return new Result<PageData<MachineVo>>().ok(page);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("信息")
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:info')")
|
||||
@@ -66,7 +85,7 @@ public class MachineController {
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("保存")
|
||||
@LogOperation("保存")
|
||||
//@LogOperation("保存")
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:save')")
|
||||
public Result save(@RequestBody MachineDTO dto){
|
||||
//效验数据
|
||||
@@ -79,7 +98,7 @@ public class MachineController {
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改")
|
||||
@LogOperation("修改")
|
||||
//@LogOperation("修改")
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:update')")
|
||||
public Result update(@RequestBody MachineDTO dto){
|
||||
//效验数据
|
||||
@@ -92,7 +111,7 @@ public class MachineController {
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@LogOperation("删除")
|
||||
//@LogOperation("删除")
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:delete')")
|
||||
public Result delete(@RequestBody Long[] ids){
|
||||
//效验数据
|
||||
@@ -105,7 +124,7 @@ public class MachineController {
|
||||
|
||||
@GetMapping("export")
|
||||
@ApiOperation("导出")
|
||||
@LogOperation("导出")
|
||||
//@LogOperation("导出")
|
||||
//@PreAuthorize("@ex.hasAuthority('code:machine:export')")
|
||||
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||
List<MachineDTO> list = machineService.list(params);
|
||||
@@ -113,11 +132,11 @@ public class MachineController {
|
||||
ExcelUtils.exportExcelToTarget(response, null, list, MachineExcel.class);
|
||||
}
|
||||
|
||||
@GetMapping("status")
|
||||
@PostMapping("status")
|
||||
@ApiOperation("改变状态")
|
||||
@LogOperation("改变状态")
|
||||
public Result changeStatus(@PathVariable("id") Long id){
|
||||
machineService.changeStatus(id);
|
||||
//@LogOperation("改变状态")
|
||||
public Result changeStatus(@RequestBody IdParam id){
|
||||
machineService.changeStatus(id.getId());
|
||||
|
||||
return new Result().ok(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user