添加swagger注释

This commit is contained in:
wuweida 2022-05-17 13:59:19 +08:00
parent 0f9588aa4c
commit 0cacf6c8fa
2 changed files with 29 additions and 13 deletions

View File

@ -122,11 +122,10 @@ public class Controller {
* @param
* @return
*/
@RequestMapping("selectAll")
@GetMapping("selectAll")
@ApiOperation("查询所有摄像头")
public String selectAll(){
return cameraChannelService.selectAll();
}
/**
@ -134,7 +133,9 @@ public class Controller {
* @param channelCode
* @return
*/
@RequestMapping("selectByChannelCode")
@GetMapping("selectByChannelCode")
@ApiOperation("根据channelCode查询摄像头详细信息")
@ApiImplicitParam(name = "channelCode",value = "摄像头标识",required = true,dataType = "String")
public Result selectByChannelCode(String channelCode){
List<CameraChannelDto1> list = cameraChannelMapper.selectByChannelCode(channelCode);
@ -151,7 +152,9 @@ public class Controller {
* @param channelName
* @return
*/
@RequestMapping("selectByChannelName")
@GetMapping("selectByChannelName")
@ApiOperation("根据摄像头名字模糊查询摄像头")
@ApiImplicitParam(name = "channelName",value = "摄像头名称",required = true,dataType = "String")
public Result selectByChannelName(String channelName){
List<CameraChannel> labels = cameraChannelMapper.selectByChannelName(channelName);
@ -162,11 +165,16 @@ public class Controller {
}
/**
* 根据parentId查询摄像头
* 根据parentId和checkStatus查询摄像头
* @param parentId
* @return
*/
@RequestMapping("selectByParentId")
@GetMapping("selectByParentId")
@ApiOperation("根据parentId和checkStatus查询摄像头")
@ApiImplicitParams({
@ApiImplicitParam(name = "parentId",value = "摄像头的组织Id",required = true,dataType = "String"),
@ApiImplicitParam(name = "checkStatus",value = "异常状态 1正常,0异常",required = true,dataType = "String")
})
public Result selectByParentId(String parentId,String checkStatus){
List<CameraChannel> list = cameraChannelMapper.selectByParentId(parentId,checkStatus);
@ -181,7 +189,9 @@ public class Controller {
* 根据标签查询对应摄像头
* @return
*/
@RequestMapping("selectLabel")
@GetMapping("selectLabel")
@ApiOperation("根据标签查询对应摄像头")
@ApiImplicitParam(name = "labelCode",value = "标签号",required = true,dataType = "String")
public Result selectLabel(String labelCode){
List<ChannelLabelDto> channelLabelDtos = cameraChannelMapper.selectLabel(labelCode);
@ -205,7 +215,7 @@ public class Controller {
* @param gpsY1
* @return
*/
@RequestMapping("selectAllByGps")
@GetMapping ("selectAllByGps")
public Result selectAllByGps(String gpsX,String gpsX1,String gpsY,String gpsY1){
List<CameraChannelDto> gps = cameraChannelMapper.selectAllByGps(gpsX, gpsX1, gpsY, gpsY1);
@ -224,7 +234,8 @@ public class Controller {
* @param label
* @return
*/
@RequestMapping("selectAllLabel")
@GetMapping("selectAllLabel")
@ApiOperation("查询所有标签")
public Result selectAllLabel(Label label ){
List<Label> labels = cameraChannelMapper.selectAllLabel(label);
@ -238,7 +249,7 @@ public class Controller {
* @param labelName
* @return
*/
@RequestMapping("selectByLabelName")
@GetMapping("selectByLabelName")
public Result selectByLabelName(String labelName){
List<Label> labels = cameraChannelMapper.selectByLabelName(labelName);
@ -253,7 +264,9 @@ public class Controller {
* @param parentId
* @return
*/
@RequestMapping("selectSubOrgan")
@GetMapping("selectSubOrgan")
@ApiOperation("根据parentId查询组织")
@ApiImplicitParam(name = "parentId",value = "上级组织id",required = true,dataType = "String")
public Result selectSubOrganization(String parentId){
if (parentId == null){
parentId = "";
@ -265,7 +278,7 @@ public class Controller {
return success;
}
//查询视频点播巡检结果只取异常的
// @RequestMapping("listChannelPlayStates")
// public Result listChannelPlayStates(

View File

@ -4,6 +4,7 @@ import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSONObject;
import com.hisense.monitormanage.entity.Result;
import com.hisense.monitormanage.service.ShangTangService;
import io.swagger.annotations.ApiOperation;
import org.omg.CORBA.Request;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -40,6 +41,7 @@ public class ShangTangController {
* @throws IOException
*/
@RequestMapping("receive")
@ApiOperation("订阅任务下发接口")
public Result receive(HttpServletRequest request) throws IOException {
ServletInputStream ris = request.getInputStream();
StringBuilder content = new StringBuilder();
@ -60,6 +62,7 @@ public class ShangTangController {
* @return
*/
@RequestMapping("tamplate")
@ApiOperation("事件模板分页查询接口")
public JSONObject tamplate(){
return shangTangService.template();