package thyyxxk.webserver.controller.zhuyuanyizheng.emr;

import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.dictionary.CodeName;
import thyyxxk.webserver.entity.zhuyuanyisheng.emr.LinkQualityControl;
import thyyxxk.webserver.service.zhuyuanyisheng.emr.EmrSuggestionService;

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

@RestController
@RequestMapping("/emrSuggestion")
public class EmrSuggestionController {

    private final EmrSuggestionService service;

    public EmrSuggestionController(EmrSuggestionService service) {
        this.service = service;
    }

    @GetMapping("/getLinkQuality")
    public ResultVo<List<LinkQualityControl>> getLinkQuality(@RequestParam("code") String code) {
        return service.getLinkQuality(code);
    }

    @GetMapping("/getLinkSelect")
    public ResultVo<List<CodeName>> getLinkSelect() {
        return service.getLinkSelect();
    }

    @PostMapping("/revise")
    public ResultVo<String> revise(@RequestBody LinkQualityControl param) {
        return service.revise(param);
    }

    @PostMapping("/addTo")
    public ResultVo<String> addTo(@RequestBody LinkQualityControl param) {
        return service.addTo(param);
    }

    @PostMapping("/deleteById")
    public ResultVo<String> deleteById(@RequestBody LinkQualityControl param) {
        return service.deleteById(param);
    }


    @PostMapping("/updateSort")
    public ResultVo<String> updateSort(@RequestBody List<LinkQualityControl> list) {
        return service.updateSort(list);
    }

}
