package com.yonge.cooleshow.admin.io.request.im;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections.CollectionUtils;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;

/**
 * 用户IM好友信息
 * Created by Eric.Shang on 2022/9/20.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserFriendInfoVO implements Serializable {

    @ApiModelProperty(value = "新用户ID")
    private Long userId;

    @ApiModelProperty(value = "好友ID")
    private List<Long> friendIds;

    public boolean invalidRequestParam() {

        return Optional.ofNullable(getUserId()).orElse(0L) <= 0 || CollectionUtils.isEmpty(getFriendIds());
    }
}
