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

import com.prolog.cs.biz.inbound.dto.PageParam;
import com.prolog.cs.biz.inbound.dto.task.TaskInstockDetailDTO;
import com.prolog.cs.biz.inbound.service.task.TaskInstockDetailService;
import com.prolog.cs.biz.inbound.vo.task.TaskQueryVO;
import com.prolog.framework.common.message.RestMessage;
import com.prolog.framework.core.pojo.Page;
import com.prolog.framework.utils.AssertUtils;
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;

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

@Deprecated
@Api(tags = "上架任务池")
@RestController
@RequestMapping("/taskInstockDetail")
public class TaskInstockDetailController {

	@Resource
	private TaskInstockDetailService taskInstockDetailService;

	/**
	 * // TODO
	 */
	@ApiOperation("条件分页")
	@GetMapping("/page")
	public RestMessage<Page<TaskInstockDetailDTO>> list(TaskQueryVO queryVO, PageParam pageParam) throws Exception {
		return RestMessage.newInstance(true, "pageSuccess",
				taskInstockDetailService.extractTaskWithNativeSql(queryVO, pageParam));
	}

	/**
	 * // TODO
	 */
	@ApiOperation("详情(主键id)")
	@GetMapping("/findByPkId")
	public RestMessage<TaskInstockDetailDTO> findByPkId(String pkId) {
		AssertUtils.isNotBlank(pkId, "主键id不可为空!");
		return RestMessage.newInstance(true, "findByPkIdSuccess", taskInstockDetailService.findByPkId(pkId));
	}

}
