package com.unis.base.client;

import java.util.List;

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.base.common.vo.SampleQueryVO;
import com.unis.base.common.vo.SampleVO;
import com.unis.common.utils.ResponseWrapper;

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

/**
 * @author WangZL
 * @version 1.0
 * @Title SampleFeign
 * @ProjectName SampleFeign
 * @Description 样品fegin接口
 * @date 2019/07/22 17点26分
 */
@FeignClient(name = "base-server")
@Component
@Api(value = "样品信息 ", tags = "样品信息维护")
public interface SampleFeign {

	/**
	 * @author WangZL
	 * @Description 获取样品列表
	 * @param 样品ID，样品编号，样品单编号，规格型号，来样方式，粮食等级编码，粮食等级名称，粮食性质编码，粮食性质名称，样品状态标识，样品所属库点编码，样品所属库点名称，检测开始时间，检测结束时间
	 * @return 样品列表
	 */
	@ApiOperation(value = "样品列表", notes = "参数：样品ID，样品编号，样品单编号，规格型号，来样方式，粮食等级编码，粮食等级名称，粮食性质编码，粮食性质名称，样品状态标识，样品所属库点编码，样品所属库点名称，检测开始时间，检测结束时间")
	@PostMapping(value = "/sampleList")
    public ResponseWrapper getSampleList(@RequestBody SampleQueryVO sampleVO);
	
	/**
	 * @author WangZL
	 * @Description 分页获取样品信息列表
	 * @param 样品ID，样品编号，样品单编号，规格型号，来样方式，粮食等级编码，粮食等级名称，粮食性质编码，粮食性质名称，样品状态标识，样品所属库点编码，样品所属库点名称，检测开始时间，检测结束时间
	 * @return 
	 */
	@ApiOperation(value = "分页获取样品信息列表", notes = "参数：样品ID，样品编号，样品单编号，规格型号，来样方式，粮食等级编码，粮食等级名称，粮食性质编码，粮食性质名称，样品状态标识，样品所属库点编码，样品所属库点名称，检测开始时间，检测结束时间")
	@PostMapping(value = "/samplePage/{pageNum}/{pageSize}")
    public ResponseWrapper getSamplePage(@RequestBody SampleQueryVO sampleVO ,@PathVariable("pageNum")Integer pageNum,@PathVariable("pageSize") Integer pageSize) ;
	
	/**
	 * @author WangZL
	 * @Description 新增样品信息
	 * @param 样品信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/sample")
	@ApiOperation(value = "新增样品信息", notes = "参数：样品信息对象 model")
    public ResponseWrapper insert(@RequestBody SampleVO sampleVO) ;
	
	/**
	 * @author WangZL
	 * @Description 更新样品信息
	 * @param 样品信息对象 model
	 * @return 新增状态
	 */
	@PutMapping(value = "/sample")
	@ApiOperation(value = "更新样品信息", notes = "参数：样品信息对象 model")
    public ResponseWrapper update(@RequestBody SampleVO sampleVO) ;

	/**
	 * @author WangZL
	 * @Description 根据样品ID删除样品信息
	 * @param 样品ID
	 * @return 状态
	 */
	@DeleteMapping(value="/sample/{ypid}")
	@ApiOperation(value = "根据样品ID删除样品信息", notes = "参数：样品ID")
	public ResponseWrapper delete(@PathVariable("ypid") String ypid) ;
	
	/**
	 * @author WangZL
	 * @Description 根据样品ID获取样品信息
	 * @param 样品ID
	 * @return 状态
	 */
	@GetMapping(value="/sample/{ypid}")
	@ApiOperation(value = "根据样品ID获取样品信息", notes = "参数：样品ID")
	public ResponseWrapper getSampleInfoByypid(@PathVariable("ypid") String ypid) ;

	
	
	/**
	 * 根据样品单ID获取样品信息
	 * @param ypdbh
	 * @return
	 */
	@GetMapping(value="/sampleByydbh/{ypdbh}")
	@ApiOperation(value = "根据样品单ID获取样品信息", notes = "参数：样品ID")
	public ResponseWrapper getSampleInfoByypdbh(@PathVariable("ypdbh") String ypdbh) ;
	
	
	/**
	 * @author WangZL
	 * @Description 新增样品信息
	 * @param 样品信息实体 models
	 * @return 新增状态
	 */
	@PostMapping(value = "/batchSample")
	@ApiOperation(value = "批量新增样品信息", notes = "参数：样品信息对象 model")
    public ResponseWrapper batchInserts(@RequestBody List<SampleVO> sampleVO) ;
	
}
