package com.ruoyi.web.controller.api;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.circuit.service.ICIntegratedCircuitService;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.report.vo.LastSumDTO;

import cn.hutool.http.HttpRequest;

/**
 * 集成电路接口
 *
 */
@RestController
@RequestMapping("/private/circuit")
public class CircuitController extends PrivateApiController{

	@Autowired
    private ICIntegratedCircuitService cIntegratedCircuitService;
	
	@GetMapping("/lastSum")
	public AjaxResult list(HttpServletRequest req) {
		try {
			checkAuth(req);
		} catch (Exception e) {
			return AjaxResult.error(HttpStatus.UNAUTHORIZED,"权限验证不通过");
		}
		LastSumDTO dto = cIntegratedCircuitService.listForLast();
		return AjaxResult.success(dto);
	}

}
