package cn.iocoder.yudao.module.system.api.project;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 项目")
public interface ProjectApi {

    String PREFIX = ApiConstants.PREFIX + "/project";

    @PostMapping(PREFIX + "/create")
    @Operation(summary = "创建项目")
    CommonResult<Long> create(@RequestBody ProjectDTO createReqVO);

    @GetMapping(PREFIX + "/get")
    @Operation(summary = "获得项目")
    @Parameter(name = "projectNo", description = "项目编号", required = true)
    CommonResult<ProjectDTO> getProject(@RequestParam("projectNo") String projectNo);

    @PostMapping(PREFIX + "/get")
    @Operation(summary = "获得项目")
    CommonResult<List<ProjectDTO>> getProjectList(@RequestBody Collection<String> projectNos);
}
