package com.iailab.module.device.controller;
|
|
import com.iailab.framework.common.constant.Constant;
|
import com.iailab.framework.common.page.PageData;
|
import com.iailab.framework.common.pojo.CommonResult;
|
import com.iailab.module.device.dto.DeviceStatNewnessDTO;
|
import com.iailab.module.device.service.DeviceStatNewnessService;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameters;
|
import javax.annotation.Resource;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import java.util.List;
|
import java.util.Map;
|
|
|
/**
|
* 设备新度系数统计表
|
*
|
* @author lirm ${email}
|
* @since 1.0.0 2024-05-28
|
*/
|
@RestController
|
@RequestMapping("device/newness")
|
@Tag(name = "设备新度系数统计表")
|
public class DeviceStatNewnessController {
|
@Resource
|
private DeviceStatNewnessService deviceStatNewnessService;
|
|
@GetMapping("page")
|
@Operation(summary = "分页")
|
@Parameters({
|
@Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) ,
|
@Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) ,
|
@Parameter(name = Constant.ORDER_FIELD, description = "排序字段") ,
|
@Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)")
|
})
|
public CommonResult<PageData<DeviceStatNewnessDTO>> page(@RequestParam Map<String, Object> params){
|
PageData<DeviceStatNewnessDTO> page = deviceStatNewnessService.page(params);
|
|
return new CommonResult<PageData<DeviceStatNewnessDTO>>().setData(page);
|
}
|
|
@GetMapping("list")
|
@Operation(summary = "列表")
|
public CommonResult<List<DeviceStatNewnessDTO>> list(@RequestParam Map<String, Object> params){
|
List<DeviceStatNewnessDTO> data = deviceStatNewnessService.list(params);
|
return new CommonResult<List<DeviceStatNewnessDTO>>().setData(data);
|
}
|
}
|