package com.sckw.system.controller.server;

import com.sckw.system.api.model.dto.res.EntCacheResDto;
import com.sckw.system.model.vo.res.EntInfo;
import com.sckw.system.service.KwsEnterpriseService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 企业信息
 *
 * @author tangyishan
 * @since 2026-01-09  15:43
 */
@RestController
@RequestMapping("/server/kwsEnt")
@Tag(name = "服务端企业信息相关接口")
@Data
public class KwsEnterpriseServerController {
    @Autowired
    private KwsEnterpriseService kwsEntService;

    /**
     * @return HttpResult
     * @desc: 根据企业id列表查询企业信息
     */
    @PostMapping("queryEntInfos")
    public List<EntInfo> queryEntInfos(@RequestBody List<Long> entIds) {
        return kwsEntService.queryEntInfoByKeys(entIds);
    }

    /**
     * @return HttpResult
     * @desc: 根据企业id列表查询企业信息
     */
    @GetMapping("queryEntCacheById")
    public EntCacheResDto queryEntCacheById(@RequestParam("entId") Long entId) {
        return kwsEntService.queryEntCacheById(entId);
    }
}
