package com.ningdatech.carapi.company.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.carapi.company.entity.dto.CompanyCreditBlackListPageParam;
import com.ningdatech.carapi.company.entity.dto.ResCompanyBlackDetailListDTO;
import com.ningdatech.carapi.company.entity.dto.ResCompanyBlackListDTO;
import com.ningdatech.carapi.company.service.INdCompanyBlackListService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 企业失信名单 前端控制器
 * </p>
 *
 * @author liushuai
 * @since 2022-10-10
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/company-black-list")
public class NdCompanyBlackListController {
    private final INdCompanyBlackListService iNdCompanyBlackListService;

    @GetMapping
    private Page<ResCompanyBlackListDTO> companyBlackList(@ModelAttribute CompanyCreditBlackListPageParam param) {
        return iNdCompanyBlackListService.companyBlackList(param);
    }

    @GetMapping("/info")
    private List<ResCompanyBlackDetailListDTO> companyBlackInfoList(@RequestParam(value = "companyId", required = false) Long companyId) {
        return iNdCompanyBlackListService.companyBlackInfoList(companyId);
    }
}
