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.DevModelRelationFeignClientFallbackFactory;
import com.njcn.csdevice.pojo.param.CsDevModelRelationAddParm;
import com.njcn.csdevice.pojo.po.CsDevModelRelationPO;
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 = "/devmodelRelation", fallbackFactory = DevModelRelationFeignClientFallbackFactory.class,contextId = "devmodelRelation")
public interface DevModelRelationFeignClient {

    @PostMapping("/getModelByDevId")
    HttpResult<List<CsDevModelRelationPO>> getModelByDevId(@RequestParam("devId") String devId);

    @PostMapping("/addDevModelRelation")
    HttpResult<CsDevModelRelationPO> addDevModelRelation(@RequestBody @Validated CsDevModelRelationAddParm addParm);

    @PostMapping("/getModelByType")
    HttpResult<String> getModelByType(@RequestParam("devId") String devId, @RequestParam("type") Integer type);

    @PostMapping("/updateDataByList")
    HttpResult<String> updateDataByList(@RequestParam("list") List<String> list, @RequestParam("id") String id);

}
