package com.yeejoin.amos.boot.module.tzs.biz.controller;

import com.yeejoin.amos.boot.module.tzs.api.dto.EquEnterDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseEnterpriseInfo;
import com.yeejoin.amos.boot.module.tzs.api.entity.TzBaseUnitLicence;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.TzBaseUnitLicenceServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@Api(tags = "企业许可数据信息Api")
@RequestMapping(value = "/baseUnitLicence", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class TzBaseUnitLicenceController {

    @Autowired
    TzBaseUnitLicenceServiceImpl baseUnitLicenceService;

    /**
     * 根据企业名称查询许可信息
     *
     * @return
     */
    @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
    @RequestMapping(value = "/licences", method = RequestMethod.POST)
    @ApiOperation(httpMethod = "POST", value = "根据企业名称查询许可信息", notes = "根据企业名称查询许可信息")
    public ResponseModel<List<TzBaseUnitLicence>> getLicenceByCompanyName(@RequestBody List<String> companyNames) {
        return  ResponseHelper.buildResponse(baseUnitLicenceService.getLicenceByCompanyName(companyNames));
    }
}
