package com.dsk.biz.controller;

import com.dsk.biz.domain.bo.CustomerSearchDto;
import com.dsk.biz.domain.vo.CustomerAnalyzeVo;
import com.dsk.biz.service.ICustomerOverviewService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.R;
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 java.util.List;
import java.util.Map;

/**
 * 客户概览
 * @author lcl
 * @create 2023/8/15
 */
@RestController
@RequestMapping("/customer/overview")
public class CustomerOverviewController extends BaseController {

    @Autowired
    private ICustomerOverviewService baseService;

    /**
     * 客户统计
     */
    @GetMapping("/statistics")
    public R<Map<String, Object>> statistics(){
        return R.ok(baseService.statistics(new CustomerSearchDto()));
    }

    /**
     * 客户合作情况
     */
    @GetMapping("/cooperation/top")
    public R<List<CustomerAnalyzeVo>> cooperationTop(){
        return R.ok(baseService.cooperationTop(new CustomerSearchDto()));
    }

    /**
     * 客户信资评级
     */
    @GetMapping("/credit/level")
    public R<List<Map<String, Object>>> creditLevel(){
        return R.ok(baseService.creditLevel(new CustomerSearchDto()));
    }
}
