package com.yonge.cooleshow.teacher.controller;


import com.alibaba.fastjson.JSONObject;
import com.yonge.cooleshow.biz.dal.entity.ImUserStateSync;
import com.yonge.cooleshow.biz.dal.service.LiveRoomService;
import com.yonge.cooleshow.common.controller.BaseController;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 用户通讯录表(ImUserFriend)表控制层
 *
 * @author zx
 * @since 2022-03-22 10:45:59
 */
@Api(tags = "用户通讯录表")
@RestController
@Slf4j
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private LiveRoomService liveRoomService;



    /**
     * 同步融云用户状态变更
     *
     * @param userState
     */
    @PostMapping(value = "/statusImUser")
    public void statusImUser(@RequestBody List<ImUserStateSync> userState) {
        log.info("opsRoom >>>>> : {}", JSONObject.toJSONString(userState));
        liveRoomService.opsRoom(userState);
    }

}

