package thyyxxk.webserver.controller.examinations;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.examinations.bookablemanage.ExamItem;
import thyyxxk.webserver.entity.examinations.bookablemanage.SearchParam;
import thyyxxk.webserver.service.examinations.BookableManageService;

import java.util.Map;

/**
 * @author: DingJie
 * @create: 2021-04-25 11:32:57
 **/
@RestController
@RequestMapping("/bookableManage")
public class BookableManageController {
    private final BookableManageService service;

    @Autowired
    public BookableManageController(BookableManageService service) {
        this.service = service;
    }

    @PostMapping("/searchItems")
    public ResultVo<Map<String, Object>> searchItems(@RequestBody SearchParam param) {
        return service.searchItems(param);
    }

    @PostMapping("/updateWxBookableFlag")
    public ResultVo<Integer> updateWxBookableFlag(@RequestBody ExamItem param) {
        return service.updateWxBookableFlag(param);
    }
}
