package com.unis.base.app.controller;

import com.unis.base.client.EquipmentRecordsFeign;
import com.unis.base.common.vo.EquipmentRecordsQueryVO;
import com.unis.common.utils.ResponseWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author WangZL
 * @version 1.0
 * @Title EquipmentRecordsController
 * @ProjectName 设备记录 Controller
 * @Description
 * @date 2019/07/22 17点26分
 */
@RestController
@Api(value = "设备记录", tags = "设备记录")
@Slf4j
public class EquipmentRecordsController {

	@Autowired
	private EquipmentRecordsFeign equipmentRecordsFeign;

	@ApiOperation(value = "设备记录-分页查询列表", notes = "参数：设备编号，设备名称，库点编号，设备类型，设备状态, 机构ID")
	@PostMapping(value = "/equipmentRecordsPage/{pageNum}/{pageSize}")
	public ResponseWrapper getEquipmentRecordsPage(@RequestBody EquipmentRecordsQueryVO equipmentRecordsQueryVO, @PathVariable("pageNum")Integer pageNum, @PathVariable("pageSize") Integer pageSize) {
		return equipmentRecordsFeign.getEquipmentRecordsPage(equipmentRecordsQueryVO,pageNum,pageSize);
	}

	@ApiOperation(value = "设备记录-查询详情", notes = "参数：设备记录ID")
	@GetMapping(value = "/equipmentRecords/{sbbajlId}")
	public ResponseWrapper getEquipmentRecordsInfoById(@PathVariable("sbbajlId")Integer sbbajlId) {
        return equipmentRecordsFeign.getEquipmentRecordsInfoById(sbbajlId);
	}


}
