package thyyxxk.webserver.controller.bodyexam;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.service.bodyexam.BodyExamService;

import java.util.List;
import java.util.Map;

/**
 * @ClassName bodyExamController
 * @Description 体检报告
 * @Author hsh
 * @Date 2022/8/12 16:53
 **/
@RestController
@RequestMapping("/bodyExam")
public class BodyExamController {

    private final BodyExamService service;

    @Autowired
    public BodyExamController(BodyExamService service) {
        this.service = service;
    }

    @PostMapping("/getTjReportData")
    public ResultVo<List<Map>> getTjReportData(@RequestBody @Validated Map<String, String> map){
        return service.getTjReportData(map);
    }

    @PostMapping("/getTjReportPersonalInfo")
    public ResultVo<List<Map>> getTjReportPersonalInfo(@RequestBody @Validated Map<String, String> map){
        return service.getTjReportPersonalInfo(map);
    }

    @PostMapping("/getTjReportTotalInfo")
    public ResultVo<List<Map>> getTjReportTotalInfo(@RequestBody @Validated Map<String, String> map){
        return service.getTjReportTotalInfo(map);
    }

    @PostMapping("/getTjReportResult")
    public ResultVo<List<Map>> getTjReportResult(@RequestBody @Validated Map<String, String> map){
        return service.getTjReportResult(map);
    }

    @PostMapping("/getTjReportModuleInfo")
    public ResultVo<List<Map>> getTjReportModuleInfo(@RequestBody @Validated Map<String, String> map){
        return service.getTjReportModuleInfo(map);
    }

    @PassToken
    @GetMapping("/selectTjReportInfoById")
    public ResultVo<Map> selectTjReportInfoById(@RequestParam("tjId") String tjId){
        return service.selectTjReportInfoById(tjId);
    }

}