package com.prolog.cs.biz.inbound.controller.task;

import com.prolog.cs.biz.inbound.dto.task.TaskQcRecheckDetailDTO;
import com.prolog.cs.biz.inbound.service.task.TaskQcRecheckDetailService;
import com.prolog.cs.biz.inbound.vo.task.TaskQcDetailQueryVO;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotEmpty;

/**
 * @Description // TODO 
 * @Date 2021-03-24 
 */

@Deprecated
@Api(tags = "复检任务池")
@RestController
@RequestMapping("/taskQcRecheckDetail")
public class TaskQcRecheckDetailController {

	@Resource
	private TaskQcRecheckDetailService taskQcRecheckDetailService;

	/**
	* // TODO
	*/
	@ApiOperation("详情(主键id)")
	@GetMapping("/findByPkId")
	public RestMessage<TaskQcRecheckDetailDTO> findByPkId(@NotEmpty(message = "pkId is empty") String pkId){
		return RestMessage.newInstance(true, "findByPkIdSuccess", taskQcRecheckDetailService.findByPkId(pkId));
	}
	
	/**
	* 条件分页查询
	*/
	@ApiOperation("条件分页查询")
	@GetMapping("/page")
	public RestMessage<Page<TaskQcRecheckDetailDTO>> list(TaskQcDetailQueryVO taskQcDetailQueryVO) throws Exception {
		return RestMessage.newInstance(true, "pageSuccess", taskQcRecheckDetailService.extractTaskWithNativeSql(taskQcDetailQueryVO));
	}
}
