package com.unis.flowable.server.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.unis.common.utils.ResponseWrapper;
import com.unis.flowable.client.HastenWorkClient;
import com.unis.flowable.common.vo.HastenWorkVO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
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;

/**
 * Author huyong
 *  工作流催办 at 2019-09-29
 */
@RestController
@RequestMapping(value = "/hastenwork")
@Api(value = "工作流催办", tags = "工作流催办")
public class FlowHastenWorkController {
   
    @Autowired
    private HastenWorkClient hastenWorkClient;

 	//工作流催办-新增
 	@ApiOperation(value = "工作流催办-新增", notes = "参数：HastenWorkVO")
    @PostMapping(value = "/insert")
    public ResponseWrapper insertHastenWork(@RequestBody  HastenWorkVO vo) {
	
			return hastenWorkClient.insertHastenWork(vo);
		
	}

	//工作流催办-修改
 	@ApiOperation(value = "工作流催办-修改", notes = "参数：HastenWorkVO")
    @PostMapping(value = "/update")
    public ResponseWrapper updateHastenWork(@RequestBody HastenWorkVO vo) {
	
			return hastenWorkClient.updateHastenWork(vo);
		
	}

	//工作流催办-分页列表
	@ApiOperation(value = "工作流催办-分页列表", notes = "参数：HastenWorkVO")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "pageSize", value = "分页大小", dataType = "int", paramType = "query"),
        @ApiImplicitParam(name = "pageNum", value = "当前页", dataType = "int", paramType = "query")
    })	
    @PostMapping(value = "/select")
	  public ResponseWrapper selectHastenWorkPageList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
			  @RequestParam(value = "pageSize", defaultValue = "10") int pageSize,
				  @RequestBody HastenWorkVO vo) {
			return hastenWorkClient.selectHastenWorkPageList(pageNum, pageSize, vo);
		
    }
    
   
	//工作流催办-查看--返回单条
	@ApiOperation(value = "工作流催办--查看--返回单条", notes = "参数：HastenWorkVO")
	@PostMapping(value = "/selectDetail")	
    public ResponseWrapper selectHastenWorkInfo(@RequestBody HastenWorkVO vo) {
      
			return hastenWorkClient.selectHastenWorkInfo(vo);
		
    }
    
    //工作流催办-查看--通过主键
	@ApiOperation(value = "工作流催办--查看--通过主键", notes = "参数：主键")
	@GetMapping(value = "/get/{id}")	
    public ResponseWrapper selectHastenWorkDetail(@PathVariable("id") Integer id) {
       
			return hastenWorkClient.selectHastenWorkDetail(id);
		
    }
    
    
     //工作流催办-删除--通过主键
	@ApiOperation(value = "工作流催办--删除--通过主键", notes = "参数：主键")
	@DeleteMapping(value = "/del/{id}")
	
    public ResponseWrapper deleteHastenWork(@PathVariable("id") Integer id) {
    
        return hastenWorkClient.deleteHastenWork(id);
        
    }
	
	
	    //工作流催办-查看--返回多条
		@ApiOperation(value = "工作流催办--查看--返回多条", notes = "参数：HastenWorkVO")
		@PostMapping(value = "/selectList")	
	    public ResponseWrapper selectHastenWorkList(@RequestBody HastenWorkVO vo) {
	      
				return hastenWorkClient.selectHastenWorkList(vo);
	    }
    
    
    
}
