package com.ym.controller;

import com.ym.service.ChatroomService;
import io.rong.models.chatroom.ChatroomModel;
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("/distribute")
public class DistributeController{

    @Autowired
    ChatroomService chatroomService;

    @RequestMapping(value = "/stop", method = RequestMethod.POST)
    public Object stop(@RequestBody ChatroomModel chatroomModel) throws Exception {
        return chatroomService.distributeStop(chatroomModel);
    }

    @RequestMapping(value = "/resume", method = RequestMethod.POST)
    public Object resume(@RequestBody ChatroomModel chatroomModel) throws Exception {
        return chatroomService.distributeResume(chatroomModel);
    }
}
