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

import com.red.circle.external.inner.model.callback.im.GroupAfterNewMemberJoinCallback;
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.CallbackAfterNewMemberJoin")
public class GroupCallbackAfterNewMemberJoinStrategy implements ImCallbackStrategy {

  @Override
  public void doOperation(String body) {
    GroupAfterNewMemberJoinCallback group = JacksonUtils
        .readValue(body, GroupAfterNewMemberJoinCallback.class);
    ResponseAssert.notNull(ResponseErrorCode.REQUEST_PARAMETER_ERROR, group);
    log.warn("加入群聊：{}", group);
  }
}
