package thyyxxk.webserver.controller.heliyongyao;

import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.zhuyuanyisheng.yizhuluru.XinZhenYiZhu;
import thyyxxk.webserver.service.heliyongyao.RationalUseServer;

/**
 * <p>
 * 描述： 合理用药接口
 * </p>
 *
 * @author xc
 * @date 2022-03-29 11:25
 */
@RestController
@RequestMapping("/RationalUse")
public class RationalUseController {

    private final RationalUseServer server;

    public RationalUseController(RationalUseServer server) {
        this.server = server;
    }


    @GetMapping("/rationalUseOfMedicine")
    public ResultVo<JSONObject> rationalUseOfMedicine(@RequestParam("patNo") String patNo,
                                                      @RequestParam("times") Integer times) {
        return server.rationalUseOfMedicine(patNo, times);
    }

    @GetMapping("/getInfoRationalUseOfMedicine")
    public ResultVo<XinZhenYiZhu> getInfoRationalUseOfMedicine(@RequestParam("patNo") String patNo,
                                                               @RequestParam("times") Integer times) {
        return server.getInfoRationalUseOfMedicine(patNo, times);
    }


    @GetMapping("/auditingInterface")
    public ResultVo<JSONObject> auditingInterface(@RequestParam("url") String url) {
        return server.auditingInterface(url);
    }

}
