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

import com.prolog.cs.biz.inbound.dto.PageParam;
import com.prolog.cs.biz.inbound.dto.task.TaskExceptionDetailDTO;
import com.prolog.cs.biz.inbound.service.task.TaskExceptionDetailService;
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.log.aop.annotation.UserLog;
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("/taskExceptionDetail")
public class TaskExceptionDetailController {

	@Resource
	private TaskExceptionDetailService taskExceptionDetailService;

	/**
	 * 条件分页查询
	 */
	@UserLog("异常任务条件分页详情查询")
	@ApiOperation("条件分页查询")
	@GetMapping("/v1/page")
	public RestMessage<Page<TaskExceptionDetailDTO>> list(TaskQueryVO queryVO, PageParam pageParam) throws Exception {
		return RestMessage.newInstance(true, "pageSuccess", taskExceptionDetailService.findList(queryVO, pageParam));
	}

	/**
	 * 详情查看(主键id)
	 */
	@UserLog("异常任务详情查询")
	@ApiOperation("详情查看(主键id)")
	@GetMapping("/v1/findByPkId")
	public RestMessage<TaskExceptionDetailDTO> findByPkId(String pkId) {
		return RestMessage.newInstance(true, "findByPkIdSuccess", taskExceptionDetailService.findByPkId(pkId));
	}

//	/**
//	* // TODO
//	*/
//	@ApiOperation("batchAdd")
//	@PostMapping("/batchAdd")
//	public RestMessage<Object> batchAdd(@NotEmpty(message = "collection is empty") @RequestBody List<TaskExceptionDetailDTO> taskExceptionDetailDTOList) {
//		return RestMessage.newInstance(true, "batchAddSuccess", taskExceptionDetailService.batchAdd(taskExceptionDetailDTOList));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("batchEdit")
//	@PostMapping("/batchEdit")
//	public RestMessage<Object> batchEdit(@NotEmpty(message = "collection is empty")@RequestBody List<TaskExceptionDetailDTO> taskExceptionDetailDTOList) {
//		return RestMessage.newInstance(true, "batchEditSuccess", taskExceptionDetailService.batchEdit(taskExceptionDetailDTOList));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("condition findAll")
//	@PostMapping("/findAll")
//	public RestMessage<List<TaskExceptionDetailDTO>> findAll(@RequestBody(required = false) TaskExceptionDetailDTO taskExceptionDetailDTO) {
//		return RestMessage.newInstance(true, "listAllSuccess", taskExceptionDetailService.findAll(taskExceptionDetailDTO));
//	}
//	
//	/**
//	* // TODO
//	*/
//	@ApiOperation("add")
//	@PostMapping("/add")
//	public RestMessage<Object> add(@Validated(validAdd.class) @RequestBody TaskExceptionDetailDTO taskExceptionDetailDTO){
//		return RestMessage.newInstance(true, "addSuccess", taskExceptionDetailService.add(taskExceptionDetailDTO));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("edit")
//	@PostMapping("/edit")
//	public RestMessage<Object> edit(@Validated(validEdit.class) @RequestBody TaskExceptionDetailDTO taskExceptionDetailDTO){
//		return RestMessage.newInstance(true, "editSuccess", taskExceptionDetailService.edit(null,taskExceptionDetailDTO));
//	}
//
//	/**
//	* // TODO
//	*/
//	@ApiOperation("del by ids")
//	@PostMapping("/delIds")
//	public RestMessage<Object> delIds(@NotEmpty(message = "collection is empty") @RequestBody List<String> pkIdList) {
//		return RestMessage.newInstance(true, "delIdsSuccess", taskExceptionDetailService.delIds(pkIdList));
//	}
}
