package thyyxxk.webserver.controller.dashboard;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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.entity.dashboard.InpatientBrief;
import thyyxxk.webserver.service.dashboard.DashboardService;

import java.util.List;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {
    private final DashboardService service;

    @Autowired
    public DashboardController(DashboardService service) {
        this.service = service;
    }

    @PassToken
    @GetMapping("/selectInpatientBriefs")
    public ResultVo<List<InpatientBrief>> selectInpatientBriefs(@RequestParam("deptCode") String deptCode) {
        return service.selectInpatientBriefs(deptCode);
    }


    @PassToken
    @GetMapping("/selectInpatientBriefsV2")
    public ResultVo<JSONObject> selectInpatientBriefsV2(@RequestParam("deptCode") String deptCode) {
        return service.selectInpatientBriefsV2(deptCode);
    }

}
