package com.sikey.wa04.business.domain.usecase;

import cn.hutool.core.util.IdUtil;
import com.sikey.wa04.business.domain.entity.GroupId;
import lombok.experimental.UtilityClass;

@UtilityClass
public class GroupIdFactory {

    /**
     * 创建群组ID
     *
     * @param childId 孩子ID
     * @return 群组ID
     */
    public GroupId create(String croupId) {
        return new GroupId(croupId);
    }

    /**
     * 生成群组ID
     *
     * @return 群组ID
     */
    public GroupId generate() {
        String groupId = String.format("G_%d", IdUtil.getSnowflakeNextId());
        return new GroupId(groupId);
    }
}
