package com.red.circle.other.app.command.party3rd.callback.im;

import com.red.circle.external.inner.model.callback.im.GroupCallbackAfterMemberExit;
import com.red.circle.framework.core.asserts.ResponseAssert;
import com.red.circle.framework.core.response.ResponseErrorCode;
import com.red.circle.tool.core.json.JacksonUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 群成员离开之后回调.
 *
 * @author pengliang on 2021/7/24
 */
@Slf4j
@Component("Group.CallbackAfterMemberExit")
public class GroupCallbackAfterMemberExitStrategy implements ImCallbackStrategy {

  @Override
  public void doOperation(String body) {
    GroupCallbackAfterMemberExit group = JacksonUtils
        .readValue(body, GroupCallbackAfterMemberExit.class);
    ResponseAssert.notNull(ResponseErrorCode.REQUEST_PARAMETER_ERROR, group);
    log.warn("退出房间：{}", group);
  }
}
