fix: swagger找不到接口bug
This commit is contained in:
+146
-141
@@ -1,4 +1,4 @@
|
||||
package com.jero.modules.controller.controller;
|
||||
package com.jero.modules.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -13,6 +13,7 @@ import com.jero.modules.vo.DeviceStatisticsVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -23,167 +24,171 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 设备
|
||||
* @Author: jero-boot
|
||||
* @Date: 2024-04-01
|
||||
* @Date: 2024-04-01
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="设备")
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RestController
|
||||
@Api(tags = "设备管理")
|
||||
@RequestMapping("/device")
|
||||
public class KhDeviceController extends JeroController<KhDevice, IKhDeviceService> {
|
||||
@Autowired
|
||||
private IKhDeviceService khDeviceService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param khDevice
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-分页列表查询")
|
||||
@ApiOperation(value="设备-分页列表查询", notes="设备-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Results<IPage<KhDevice>> queryPageList(KhDevice khDevice,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<KhDevice> pageList = khDeviceService.queryPage(khDevice, pageNo, pageSize, req);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统设备概况
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-系统设备概况")
|
||||
@ApiOperation(value="设备-系统设备概况", notes="设备-系统设备概况")
|
||||
@GetMapping(value = "/statistics")
|
||||
public Results<DeviceStatisticsVO> statistics() {
|
||||
return Results.OK(khDeviceService.statistics());
|
||||
}
|
||||
@Autowired
|
||||
private IKhDeviceService khDeviceService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param khDevice
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-列表查询")
|
||||
@ApiOperation(value="设备-列表查询", notes="设备-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Results<List<KhDevice>> queryList(KhDevice khDevice, HttpServletRequest req) {
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param khDevice
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-分页列表查询")
|
||||
@ApiOperation(value = "设备-分页列表查询", notes = "设备-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Results<IPage<KhDevice>> queryPageList(KhDevice khDevice,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<KhDevice> pageList = khDeviceService.queryPage(khDevice, pageNo, pageSize, req);
|
||||
return Results.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统设备概况
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-系统设备概况")
|
||||
@ApiOperation(value = "设备-系统设备概况", notes = "设备-系统设备概况")
|
||||
@GetMapping(value = "/statistics")
|
||||
public Results<DeviceStatisticsVO> statistics() {
|
||||
return Results.OK(khDeviceService.statistics());
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param khDevice
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-列表查询")
|
||||
@ApiOperation(value = "设备-列表查询", notes = "设备-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Results<List<KhDevice>> queryList(KhDevice khDevice, HttpServletRequest req) {
|
||||
List<KhDevice> list = khDeviceService.queryList(khDevice, req);
|
||||
return Results.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param khDevice
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-添加")
|
||||
@ApiOperation(value="设备-添加", notes="设备-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Results<T> add(@Validated @RequestBody KhDevice khDevice) {
|
||||
khDeviceService.add(khDevice);
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param khDevice
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-编辑")
|
||||
@ApiOperation(value="设备-编辑", notes="设备-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Results<T> edit(@Validated @RequestBody KhDevice khDevice) {
|
||||
khDeviceService.editById(khDevice);
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-通过id删除")
|
||||
@ApiOperation(value="设备-通过id删除", notes="设备-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Results<T> delete(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
||||
return Results.error("请选择数据!");
|
||||
}
|
||||
khDeviceService.deleteById(map.get("id"));
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-批量删除")
|
||||
@ApiOperation(value="设备-批量删除", notes="设备-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Results<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
||||
return Results.error("请选择数据!");
|
||||
}
|
||||
this.khDeviceService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Results.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-通过id查询")
|
||||
@ApiOperation(value="设备-通过id查询", notes="设备-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<KhDevice> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
KhDevice khDevice = khDeviceService.queryById(id);
|
||||
if(khDevice==null) {
|
||||
return Results.error("未找到对应数据");
|
||||
}
|
||||
return Results.OK(khDevice);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param khDevice
|
||||
*/
|
||||
* 添加
|
||||
*
|
||||
* @param khDevice
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-添加")
|
||||
@ApiOperation(value = "设备-添加", notes = "设备-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Results<T> add(@Validated @RequestBody KhDevice khDevice) {
|
||||
khDeviceService.add(khDevice);
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param khDevice
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-编辑")
|
||||
@ApiOperation(value = "设备-编辑", notes = "设备-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Results<T> edit(@Validated @RequestBody KhDevice khDevice) {
|
||||
khDeviceService.editById(khDevice);
|
||||
return Results.OK("操作成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-通过id删除")
|
||||
@ApiOperation(value = "设备-通过id删除", notes = "设备-通过id删除")
|
||||
@PostMapping(value = "/delete")
|
||||
public Results<T> delete(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))) {
|
||||
return Results.error("请选择数据!");
|
||||
}
|
||||
khDeviceService.deleteById(map.get("id"));
|
||||
return Results.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-批量删除")
|
||||
@ApiOperation(value = "设备-批量删除", notes = "设备-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Results<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
if (!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))) {
|
||||
return Results.error("请选择数据!");
|
||||
}
|
||||
this.khDeviceService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
||||
return Results.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "设备-通过id查询")
|
||||
@ApiOperation(value = "设备-通过id查询", notes = "设备-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Results<KhDevice> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
KhDevice khDevice = khDeviceService.queryById(id);
|
||||
if (khDevice == null) {
|
||||
return Results.error("未找到对应数据");
|
||||
}
|
||||
return Results.OK(khDevice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param khDevice
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, KhDevice khDevice) {
|
||||
return super.exportXls(request, khDevice, KhDevice.class, "设备");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Results<KhDevice> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, KhDevice.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.jero.modules.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -16,7 +14,6 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.jero.modules.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -16,7 +14,6 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.1.mapper.KhDeviceMapper">
|
||||
<resultMap id="KhDeviceResultMap" type="com.jero.modules.1.entity.KhDevice">
|
||||
<mapper namespace="com.jero.modules.mapper.KhDeviceMapper">
|
||||
<resultMap id="KhDeviceResultMap" type="com.jero.modules.entity.KhDevice">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
@@ -13,6 +13,6 @@
|
||||
<result column="wellhead_id" property="wellheadId" />
|
||||
<result column="device_desc" property="deviceDesc" />
|
||||
<result column="device_sn" property="deviceSn" />
|
||||
<result column="device_statuts" property="deviceStatuts" />
|
||||
<result column="device_status" property="deviceStatus" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.1.mapper.KhWellheadMapper">
|
||||
<resultMap id="KhWellheadResultMap" type="com.jero.modules.1.entity.KhWellhead">
|
||||
<mapper namespace="com.jero.modules.mapper.KhWellheadMapper">
|
||||
<resultMap id="KhWellheadResultMap" type="com.jero.modules.entity.KhWellhead">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
|
||||
Reference in New Issue
Block a user