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

import com.prolog.cs.biz.inbound.dto.failure.ExceptionLineQueryDTO;
import com.prolog.cs.biz.inbound.dto.failure.ExceptionLineQueryVO;
import com.prolog.cs.biz.inbound.service.failure.ExceptionLinesService;
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 异常明细行
 * @Date 2021-03-24
 */

@Api(tags = "异常明细行")
@RestController
@RequestMapping("/exceptionLines")
public class ExceptionLinesController {

	@Resource
	private ExceptionLinesService exceptionLinesService;

	/**
	 * 异常行详情
	 */
	@UserLog("异常行详情查询")
	@ApiOperation("异常行详情")
	@GetMapping("/v1/infoByPkId")
	public RestMessage<ExceptionLineQueryDTO> findByPkId(String exceptionLineId) {
		return RestMessage.newInstance(true, "findByPkIdSuccess", exceptionLinesService.infoByPkId(exceptionLineId));
	}

	/**
	 * 异常行条件分页
	 */
	@UserLog("异常行条件分页详情查询")
	@ApiOperation("异常行条件分页")
	@GetMapping("/v1/page")
	public RestMessage<Page<ExceptionLineQueryDTO>> list(ExceptionLineQueryVO queryVO) {
		return RestMessage.newInstance(true, "pageSuccess", exceptionLinesService.findList(queryVO));
	}

}
