package com.njcn.csdevice.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.csdevice.api.fallback.AppProjectClientFallbackFactory;
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
import com.njcn.csdevice.pojo.po.AppProjectPO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author xy
 */
@FeignClient(value = ServerInfo.CS_DEVICE_BOOT, path = "/project", fallbackFactory = AppProjectClientFallbackFactory.class,contextId = "approject")
public interface AppProjectFeignClient {


    @PostMapping("/queryProjectById")
    HttpResult<List<AppProjectPO>> queryProjectById(@RequestParam("ids") List<String> ids);

    @PostMapping("/getProjectByName")
    HttpResult<AppProjectPO> getProjectByName(@RequestParam("name") String name);

    @PostMapping("/addPortableProject")
    HttpResult<AppProjectPO> addPortableProject(@Validated @RequestBody AppProjectAddParm appProjectAddParm);

}
