package com.unis.base.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.unis.common.utils.ResponseWrapper;
import com.unis.base.common.vo.GranaryVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * @author huangxing
 * @version 1.0
 * @Title: BaseFeign
 * @ProjectName Base-Service
 * @Description:base层fegin接口
 * @date 2019/7/7 18:05
 */
@FeignClient(name = "base-server")
@Component
@Api(value = "廒间信息", tags = "廒间信息维护")
public interface GranaryFeign {

	/**
	 * @author huangxing
	 * @Description 获取仓房列表
	 * @param 仓房编号，仓房名称，廒间编号，廒间名称，廒间状态
	 * @return 仓房信息列表
	 */
	@ApiOperation(value = "获取廒间信息列表", notes = "参数：仓房编号，仓房名称，廒间编号，廒间名称，廒间状态")
	@PostMapping(value = "/granaryList")
    public ResponseWrapper getGranaryList(@RequestBody GranaryVO granaryVO );
	
	/**
	 * @author huangxing
	 * @Description 获取廒间信息列表
	 * @param 仓房编号，仓房名称，廒间编号，廒间名称，廒间状态
	 * @return 企业信息列表
	 */
	@ApiOperation(value = "分页获取廒间信息列表", notes = "参数：仓房编号，仓房名称，廒间编号，廒间名称，廒间状态")
	@PostMapping(value = "/granaryPage/{pageNum}/{pageSize}")
    public ResponseWrapper getGranaryPage(@RequestBody GranaryVO granaryVO ,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize") Integer pageSize);
	
	
	/**
	 * @author huangxing
	 * @Description 新增廒间信息
	 * @param 廒间信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/granary")
	@ApiOperation(value = "新增廒间信息", notes = "参数：廒间信息对象 granaryVO")
    public ResponseWrapper insert(@RequestBody GranaryVO granaryVO);
	
	/**
	 * @author huangxing
	 * @Description 更新廒间信息
	 * @param 参数：廒间信息实体 models
	 * @return 新增状态
	 */
	@PutMapping(value = "/granary")
	@ApiOperation(value = "更新廒间信息", notes = "参数：廒间信息对象 granaryVO")
    public ResponseWrapper update(@RequestBody GranaryVO granaryVO);
	

	/**
	 * @author huangxing
	 * @Description 删除廒间信息
	 * @param 参数：廒间编号
	 * @return 状态
	 */
	@DeleteMapping(value="/granary/{ajbh}")
	@ApiOperation(value = "根据廒间编号删除廒间信息", notes = "参数：廒间编号")
	public ResponseWrapper delete(@PathVariable("ajbh") String ajbh);
	
	/**
	 * @author huangxing
	 * @Description 删除廒间信息
	 * @param 参数：廒间编号
	 * @return 状态
	 */
	@GetMapping(value="/granary/{ajbh}")
	@ApiOperation(value = "根据廒间编号获取廒间信息", notes = "参数：廒间编号")
	public ResponseWrapper getGranaryByajbh(@PathVariable("ajbh") String ajbh);
}
