济菏高速数据中心代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

125 lines
4.0 KiB

package com.zc.business.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.zc.business.domain.DcOperLog;
import com.zc.business.service.IDcOperLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
/**
* 调用功能记录Controller
*
* @author zhaoxianglong
*/
@Api(tags = {"调用功能记录"})
@RestController
@RequestMapping("/business/dcOperLog")
public class DcOperLogController extends BaseController {
@Resource
private IDcOperLogService dcOperLogService;
//*********************************调用功能记录增删改查******************************************
/**
* 查询设备的调用次数根据设备类型分组
*/
@ApiOperation("查询设备的调用次数根据设备类型分组")
@GetMapping("count/deviceType")
public AjaxResult countByDeviceType() {
return AjaxResult.success(dcOperLogService.countByDeviceType());
}
/**
* 分页查询列表
*
* @param dcOperLog 请求参数
* @return 分页查询结果
*/
@ApiOperation("分页查询列表")
@PreAuthorize("@ss.hasPermi('iot:facility:list')")
@GetMapping("list")
public TableDataInfo listFacility( DcOperLog dcOperLog,@RequestParam(value = "endTime", required = false)Date endTime,@RequestParam(value = "startTime", required = false)Date startTime) {
return getDataTable(dcOperLogService.pageDcOperLog(dcOperLog,endTime,startTime));
}
/**
* 无分页查询路网设施列表
*
* @param dcOperLog 请求参数
* @return 查询结果
*/
@ApiOperation("无分页查询列表")
@PreAuthorize("@ss.hasPermi('iot:facility:query')")
@GetMapping("query")
public AjaxResult queryFacility( DcOperLog dcOperLog, @RequestParam(value = "endTime", required = false) Date endTime, @RequestParam(value = "startTime", required = false)Date startTime) {
return AjaxResult.success(dcOperLogService.listDcOperLog(dcOperLog,endTime,startTime));
}
/**
* 根据id查询路网设施信息
*
* @param id id
* @return 查询结果
*/
@ApiOperation("根据id查询信息")
@PreAuthorize("@ss.hasPermi('iot:facility:query')")
@GetMapping("{id}")
public AjaxResult getFacility(@PathVariable String id) {
return AjaxResult.success(dcOperLogService.getById(id));
}
/**
* 新增
*
* @param dcOperLog 新增参数
* @return 新增操作结果
*/
@ApiOperation("新增")
@PreAuthorize("@ss.hasPermi('iot:facility:add')")
@Log(title = "新增", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult addFacility(@Valid @RequestBody DcOperLog dcOperLog) {
return toAjax(dcOperLogService.addDcOperLog(dcOperLog));
}
/**
* 修改
*
* @param dcOperLog 修改参数
* @return 修改操作结果
*/
@ApiOperation("修改")
@PreAuthorize("@ss.hasPermi('iot:facility:edit')")
@Log(title = "修改", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult editFacility(@Valid @RequestBody DcOperLog dcOperLog) {
return toAjax(dcOperLogService.editDcOperLog(dcOperLog));
}
/**
* 删除
*
* @param ids id集
* @return 删除操作结果
*/
@ApiOperation("删除")
@PreAuthorize("@ss.hasPermi('iot:facility:remove')")
@Log(title = "删除", businessType = BusinessType.DELETE)
@DeleteMapping("{ids}")
public AjaxResult removeFacility(@PathVariable List<String> ids) {
return toAjax(dcOperLogService.removeDcOperLog(ids));
}
}