Commit 016d5233 authored by ma's avatar ma

完成报警类型查询接口

parent 42b36476
package iot.sixiang.license.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import iot.sixiang.license.entity.ReportType;
import iot.sixiang.license.log.BusinessType;
import iot.sixiang.license.log.MyLog;
import iot.sixiang.license.model.ResResult;
import iot.sixiang.license.service.ReportTypeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by m33
* Date 2023/2/1 9:52
* Description
*/
@RestController
@RequestMapping("/iot_license/report")
@Api(value = "安全报警模块", tags = {"安全报警模块"})
public class ReportController {
@Resource
ReportTypeService reportTypeService;
/**
* 查询所有报警类型
*
* @return
*/
@ApiOperation(value = "获取报警类型列表接口", notes = "用于获取报警类型列表")
@GetMapping("report_type/list")
@MyLog(title = "获取报警类型列表", businessType = BusinessType.SELECT)
public ResResult getReportTypeList() {
List<ReportType> reportTypes = reportTypeService.getReportTypeList();
return ResResult.success().goRecord(reportTypes);
}
}
package iot.sixiang.license.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import iot.sixiang.license.entity.Report;
/**
* Created by m33
* Date 2023/2/1 10:00
* Description
*/
public interface ReportMapper extends BaseMapper<Report> {
}
package iot.sixiang.license.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import iot.sixiang.license.entity.ReportType;
/**
* Created by m33
* Date 2023/2/1 10:00
* Description
*/
public interface ReportTypeMapper extends BaseMapper<ReportType> {
}
package iot.sixiang.license.service;
import iot.sixiang.license.entity.ReportType;
import java.util.List;
/**
* Created by M=54G
* Date 11/23/22 3:09 PM
* Description
*/
public interface ReportService {
}
package iot.sixiang.license.service;
import iot.sixiang.license.entity.PmsUseLog;
import iot.sixiang.license.entity.ReportType;
import iot.sixiang.license.model.PageInfoModel;
import iot.sixiang.license.model.dto.ReportErrorMsgDTO;
import java.util.List;
/**
* Created by M=54G
* Date 11/23/22 3:09 PM
* Description
*/
public interface ReportTypeService {
List<ReportType> getReportTypeList();
}
package iot.sixiang.license.service.impl;
import iot.sixiang.license.mapper.ReportMapper;
import iot.sixiang.license.service.ReportService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* Created by m33
* Date 2023/2/1 9:59
* Description
*/
@Service
public class ReportServiceImpl implements ReportService {
@Resource
ReportMapper reportMapper;
}
package iot.sixiang.license.service.impl;
import iot.sixiang.license.entity.ReportType;
import iot.sixiang.license.mapper.ReportTypeMapper;
import iot.sixiang.license.service.ReportTypeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* Created by m33
* Date 2023/2/1 9:59
* Description
*/
@Service
public class ReportTypeServiceImpl implements ReportTypeService {
@Resource
ReportTypeMapper reportTypeMapper;
@Override
public List<ReportType> getReportTypeList() {
return reportTypeMapper.selectList(null);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment