package org.springblade.workorder.deviceorder.feign;

import io.swagger.annotations.ApiParam;
import org.springblade.core.tool.api.R;
import org.springblade.workorder.deviceorder.dto.DeviceOrderDTO;
import org.springblade.workorder.deviceorder.entity.DeviceOrder;
import org.springblade.workorder.deviceorder.vo.DeviceOrderStatisticsVO;
import org.springblade.workorder.deviceorder.vo.DeviceOrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
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 javax.validation.Valid;
import java.util.List;

/**
 * 设备工单 Feign
 *
 * @author lianghanqiang
 * @since 2021-04-21
 */
@FeignClient(value = "work-order",path = "/feign/deviceorder")
public interface IDeviceOrderClient  {

	/**
	 * 详情
	 */
	@GetMapping("/detail")
	DeviceOrderVO detail(@SpringQueryMap DeviceOrder deviceOrder);

	/**
	 * 查询 设备工单
	 */
	@GetMapping("/list")
    List<DeviceOrderVO> list(@SpringQueryMap DeviceOrder deviceOrder);



	/**
	 * 新增 设备工单
	 */
	@PostMapping("/save")
	boolean save(@Valid @RequestBody DeviceOrder deviceOrder);

	/**
	 * 修改 设备工单
	 */
	@PostMapping("/update")
    boolean update(@Valid @RequestBody DeviceOrder deviceOrder);

	/**
	 * 新增或修改 设备工单
	 */
	@PostMapping("/submit")
	R submit(@Valid @RequestBody DeviceOrderVO deviceOrder) ;


	/**
	 * 删除 设备工单
	 */
	@PostMapping("/remove")
    boolean remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids);

	@PostMapping("/getListByDeviceTypeList")
	List<DeviceOrder> getListByDeviceTypeList(@RequestBody DeviceOrderDTO deviceOrderDTO);

	@GetMapping("/getDeviceJobStaticVo")
	R<DeviceOrderStatisticsVO> getDeviceJobStaticVo();



}
