package com.bonus.zlpt.company.api;

import com.bonus.zlpt.common.core.constant.ServiceNameConstants;
import com.bonus.zlpt.common.core.web.domain.AjaxResult;
import com.bonus.zlpt.common.core.web.page.TableDataInfo;
import com.bonus.zlpt.company.api.domain.SysDic;
import com.bonus.zlpt.company.api.factory.BmCompanyServiceApiFallBackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.time.LocalDateTime;
import java.util.List;


@FeignClient(contextId = "BmCompanyServiceApi", value = ServiceNameConstants.COMPANY_SERVICE, fallbackFactory = BmCompanyServiceApiFallBackFactory.class)
public interface BmCompanyServiceApi {

    String PREFIX = "/company_type";
    /**
     * 根据条件查询企业类型数据
     * @return
     */
    @PostMapping(PREFIX+"/selectCompanyTypeList")
    TableDataInfo selectCompanyTypeList(@RequestBody SysDic sysDic);

    /**
     * 根据条件查询企业所属
     * @return
     */
    @PostMapping(PREFIX+"/selectCompanyLtd")
    TableDataInfo selectCompanyLtd(@RequestBody SysDic sysDic);

    /**
     * 根据条件查询证件类型
     * @return
     */
    @PostMapping(PREFIX+"/selectIdCard")
    TableDataInfo selectIdCard(@RequestBody SysDic sysDic);

    /**
     * 新增或者修改企业类型
     * @param sysDic
     * @return
     */
    @PostMapping(PREFIX+"/addOrUpdateCompanyType")
    AjaxResult addOrUpdateCompanyType(@Validated @RequestBody SysDic sysDic );


    /**
     * 根据id删除企业类型
     * @param id
     * @return
     */
    @DeleteMapping(PREFIX+"/deleteCompanyType/{id}")
    AjaxResult deleteCompanyType(@PathVariable("id") Integer id);


}
