package com.ym.im;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.ym.im.fallback.ImFeignServiceFallback;
import com.ym.mec.common.config.FeignConfiguration;
import com.ym.mec.common.entity.ImGroupModel;
import com.ym.mec.common.entity.ImUserModel;

@FeignClient(name = "im-server", configuration = FeignConfiguration.class, fallback = ImFeignServiceFallback.class)
public interface ImFeignService {

    /**
     * 用户注册
     * @param userModel
     * @return
     */
    @PostMapping(value = "user/register")
    Object getUser(@RequestBody ImUserModel userModel);

    /**
     * 创建群组
     * @param groupModel
     * @return
     */
    @PostMapping(value = "group/create")
    Object groupCreate(@RequestBody ImGroupModel groupModel);

    /**
     * 加入群组
     * @param groupModel
     * @return
     */
    @PostMapping(value = "group/join")
    Object groupJoin(@RequestBody ImGroupModel groupModel);

    /**
     * 退出群组
     * @param groupModel
     * @return
     */
    @PostMapping(value = "group/quit")
    Object groupQuit(@RequestBody ImGroupModel groupModel);

    /**
     * 解散群组
     * @param groupModel
     * @return
     */
    @PostMapping(value = "group/dismiss")
    Object groupDismiss(@RequestBody ImGroupModel groupModel);
}
