| | |
| | | import com.ruoyi.chargingPile.service.TChargingPileService; |
| | | import com.ruoyi.chargingPile.service.TFaultMessageService; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | faultMessageService.add(dto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取故障信息列表 |
| | | * @param siteId |
| | | * @param basePage |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @GetMapping("/getFaultMessageList") |
| | | @ApiOperation(value = "获取故障信息列表数据", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult<PageInfo<TFaultMessage>> getFaultMessageList(Integer siteId, BasePage basePage){ |
| | | PageInfo<TFaultMessage> pageInfo = new PageInfo<>(basePage.getPageCurr(), basePage.getPageSize()); |
| | | List<TFaultMessage> faultMessageList = faultMessageService.getFaultMessageList(pageInfo, siteId); |
| | | pageInfo.setRecords(faultMessageList); |
| | | return AjaxResult.success(pageInfo); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/addFaultMessage") |
| | | @ApiOperation(value = "添加故障信息", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult addFaultMessage(@RequestBody TFaultMessage faultMessage){ |
| | | faultMessageService.save(faultMessage); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @DeleteMapping("/delFaultMessage/{id}") |
| | | @ApiOperation(value = "删除故障信息", tags = {"管理后台-设备监控"}) |
| | | public AjaxResult delFaultMessage(@PathVariable Integer id){ |
| | | faultMessageService.removeById(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| | | |