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

import com.prolog.cs.biz.inbound.dto.task.TaskQcDetailDTO;
import com.prolog.cs.biz.inbound.service.task.TaskQcDetailService;
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("/taskQcDetail")
public class TaskQcDetailController {

	@Resource
	private TaskQcDetailService taskQcDetailService;

	/**
	* 条件分页查询
	*/
	@ApiOperation("条件分页查询")
	@GetMapping("/page")
	public RestMessage<Page<TaskQcDetailDTO>> list(TaskQcDetailQueryVO taskQcDetailQueryVO) throws Exception {
		return RestMessage.newInstance(true, "pageSuccess", taskQcDetailService.findList2(taskQcDetailQueryVO));
	}

	/**
	* // TODO
	*/
	@ApiOperation("详情(主键id)")
	@GetMapping("/findByPkId")
	public RestMessage<TaskQcDetailDTO> findByPkId(@NotEmpty(message = "pkId is empty") String pkId){
		return RestMessage.newInstance(true, "findByPkIdSuccess", taskQcDetailService.findByPkId(pkId));
	}
}
