10 changed files with 73 additions and 30 deletions
@ -0,0 +1,6 @@ |
|||||||
|
/* © SRSoftware 2025 */ |
||||||
|
package de.srsoftware.umbrella.core.api; |
||||||
|
|
||||||
|
public interface EntityId<T> { |
||||||
|
public T unwrap(); |
||||||
|
} |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
/* © SRSoftware 2025 */ |
||||||
|
package de.srsoftware.umbrella.core.model; |
||||||
|
|
||||||
|
import de.srsoftware.umbrella.core.api.EntityId; |
||||||
|
|
||||||
|
public record LongId(long id) implements EntityId<Long> { |
||||||
|
|
||||||
|
public static LongId of(long id){ |
||||||
|
return new LongId(id); |
||||||
|
} |
||||||
|
|
||||||
|
public static LongId of (String stringRepresentation){ |
||||||
|
return new LongId(Long.parseLong(stringRepresentation)); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public Long unwrap() { |
||||||
|
return id; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String toString() { |
||||||
|
return ""+id; |
||||||
|
} |
||||||
|
} |
||||||
@ -1,19 +1,20 @@ |
|||||||
/* © SRSoftware 2025 */ |
/* © SRSoftware 2025 */ |
||||||
package de.srsoftware.umbrella.tags; |
package de.srsoftware.umbrella.tags; |
||||||
|
|
||||||
|
import de.srsoftware.umbrella.core.api.EntityId; |
||||||
import java.util.Collection; |
import java.util.Collection; |
||||||
import java.util.List; |
import java.util.List; |
||||||
import java.util.Map; |
import java.util.Map; |
||||||
import java.util.Set; |
import java.util.Set; |
||||||
|
|
||||||
public interface TagDB { |
public interface TagDB { |
||||||
String delete(long userId, String module, long entityId, String tag); |
String delete(long userId, String module, EntityId<?> entityId, String tag); |
||||||
|
|
||||||
void deleteEntity(String module, long entityId); |
void deleteEntity(String module, EntityId<?> entityId); |
||||||
|
|
||||||
Map<String, List<Long>> getUses(String tag, long id); |
Map<String, List<Long>> getUses(String tag, long userId); |
||||||
|
|
||||||
Set<String> list(long userId, String module, long entityId); |
Set<String> list(long userId, String module, EntityId<?> entityId); |
||||||
|
|
||||||
void save(Collection<Long> userIds, String module, long entityId, Collection<String> tags); |
void save(Collection<Long> userIds, String module, EntityId<?> entityId, Collection<String> tags); |
||||||
} |
} |
||||||
|
|||||||
Loading…
Reference in new issue