package com.casic.missiles.controller.customer;

import com.casic.missiles.dto.ReturnDTO;
import com.casic.missiles.dto.ReturnUtil;
import com.casic.missiles.dto.customer.CustomerExcellentResponse;
import com.casic.missiles.dto.customer.WorkbenceTrendResponse;
import com.casic.missiles.service.customer.CustomerWorkbenchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "客户工作台资源")
@RestController
@RequestMapping("/customer/workbench")
@AllArgsConstructor
public class CustomerWorkbenchController {

    private final CustomerWorkbenchService customerWorkbenchService;

    @ApiOperation("样品新增趋势")
    @PostMapping("/sample/increaseTrend")
    public ReturnDTO<WorkbenceTrendResponse> increaseTrend() {
        return ReturnUtil.success(customerWorkbenchService.sampleIncreaseTrend());
    }

    @ApiOperation("样品到期趋势")
    @PostMapping("/sample/expireTrend")
    public ReturnDTO<WorkbenceTrendResponse>querySampleExpireTrend() {
        return ReturnUtil.success(customerWorkbenchService.querySampleExpireTrend());
    }

    @ApiOperation("客户新增趋势")
    @PostMapping("/increaseTrend")
    public ReturnDTO<WorkbenceTrendResponse> customerIncreaseTrend() {
        return ReturnUtil.success(customerWorkbenchService.customerIncreaseTrend());
    }

    @ApiOperation("优质客户名单")
    @GetMapping("/excellentList")
    public ReturnDTO<CustomerExcellentResponse> customerExcellentList() {
        return ReturnUtil.success(customerWorkbenchService.customerExcellentList());
    }

}
