package com.ym.controller;

import com.ym.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by weiqinxiao on 2019/2/25.
 */
@RestController
@RequestMapping("/history")
public class HistoryController{

    @Autowired
    MessageService messageService;

    @RequestMapping(value = "/get", method = RequestMethod.POST)
    public Object get(@RequestBody String date) throws Exception {
        return messageService.historyGet(date);
    }

    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    public Object remove(@RequestBody String date) throws Exception {
        return messageService.historyRemove(date);
    }
}
