package com.ruoyi.web.work.api;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.web.work.domain.Diagnosis;
import com.ruoyi.web.work.service.IDiagnosisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/app/diagnosis")
@Api(tags = "小程序诊断信息")
public class Api_DiagnosisController {

    @Autowired
    private IDiagnosisService diagnosisService;

    /**
     * 根据就诊ID获取诊断详情
     * @param visitId
     * @return
     */
    @ApiOperation(value = "诊断详情")
    @GetMapping("/{visitId}")
    public AjaxResult getDiagnosisInfoByVisitId(@PathVariable String visitId){
        List<Diagnosis> visitList = diagnosisService.getDiagnosisInfoByVisitId(visitId);
        return AjaxResult.success(visitList);
    }
}
