package com.yuchen.saas.device.api.feign.assets;

import com.yuchen.saas.device.api.dto.assets.AddAssetsMaintainReqDTO;
import com.yuchen.saas.device.api.dto.assets.client.AddInspectRepairDataDTO;
import com.yuchen.saas.device.api.vo.assets.SaasAssetsDataInfoVO;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@FeignClient(
        value = AppNameConstant.SAAS_DEVICE,
        fallbackFactory = AssetsFeignFallback.class
)
public interface AssetsFeign {


    @GetMapping("/client/assets/getAssetsDataInfoById/{id}")
    @ApiOperation(value = "获取资产详情", notes = "获取资产详情")
    R<SaasAssetsDataInfoVO> getAssetsDataInfoById(@PathVariable Long id);


    @PostMapping("/client/assets/addInspectRepairData")
    @ApiOperation(value = "巡检异常添加报修单", notes = "巡检异常添加报修单")
    R addInspectRepairData(@Validated @RequestBody AddInspectRepairDataDTO reqDTO);

    @PostMapping("/client/assets/addAssetsMaintainData")
    @ApiOperation(value = "添加维修单", notes = "添加维修单")
    R addAssetsMaintainData(@RequestBody AddAssetsMaintainReqDTO reqDTO);

}
