package com.engine.organization.entity.extend.param;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import weaver.general.StringUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.stream.Collectors;

/**
 * @author:dxfeng
 * @createTime: 2022/06/16
 * @version: 1.0
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ExtendFieldSearchParam {
    private String id;
    private Long groupId;
    private Long groupType;


    public Collection<Long> getId() {
        if (StringUtil.isEmpty(id)) {
            return new ArrayList<>();
        }
        return Arrays.stream(id.split(",")).map(Long::parseLong).collect(Collectors.toList());
    }
}
