package com.ywt.alipaympapi.controller;

import com.ywt.model.PageVO;
import com.ywt.model.ResponseVO;
import com.ywt.request.history.VisitDetailsRequest;
import com.ywt.request.history.VisitListRequest;
import com.ywt.response.history.VisitDetailsResponseData;
import com.ywt.response.history.VisitListResponseData;
import com.ywt.alipaympapi.service.IsvHistoryService;
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.RestController;

/**
 * @Desc
 */
@RestController
@Slf4j
public class VisitController {

    @Autowired
    private IsvHistoryService isvHistoryService;

    /**
     * 就诊详情
     *
     * @param request
     * @return
     */
    @PostMapping("isvRequest.history.visitDetail")
    public ResponseVO<VisitDetailsResponseData> queryVisitDetails(VisitDetailsRequest request) {
        return ResponseVO.success(isvHistoryService.queryVisitDetails(request));
    }


    /**
     * 就诊历史
     *
     * @param request
     * @return
     */
    @PostMapping("isvRequest.history.visitList")
    public ResponseVO<PageVO<VisitListResponseData>> queryVisitList(VisitListRequest request) {

        PageVO<VisitListResponseData> data = isvHistoryService.queryVisitList(request);


        return ResponseVO.success(data);
    }
}
