package com.ywt.alipaympapi.controller;

import com.ywt.model.PageVO;
import com.ywt.model.ResponseVO;
import com.ywt.request.report.QueryReportDetailRequest;
import com.ywt.request.report.QueryReportListRequest;
import com.ywt.response.report.QueryReportDetailResponseData;
import com.ywt.response.report.QueryReportListResponseData;
import com.ywt.alipaympapi.service.IsvReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Desc
 */
@RestController
@RequestMapping("")
@Slf4j
public class ReportController {

    @Autowired
    private IsvReportService reportService;


    /**
     * 默认就诊卡查询
     *
     * @param request
     * @return
     */
    @PostMapping("isvRequest.report.queryDetail")
    public ResponseVO<QueryReportDetailResponseData> queryDetail(QueryReportDetailRequest request) {
        return ResponseVO.success(reportService.queryReportDetail(request));
    }

    /**
     * 报告列表查询
     *
     * @param request
     * @return
     */
    @RequestMapping("isvRequest.report.queryList")
    public ResponseVO<PageVO<QueryReportListResponseData>> queryList(QueryReportListRequest request) {

        log.info("request is {}", request);

        PageVO<QueryReportListResponseData> data = reportService.queryReportList(request);


        return ResponseVO.success(data);
    }

}
