Skip to content

Commit

Permalink
#87 rename: idgenerator -> generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rivkode committed Jun 10, 2024
1 parent 11a491f commit f80a040
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.seoultech.synergybe.domain.common.generator;

import org.springframework.stereotype.Component;

@Component
public interface IdGenerator {
Long generateId();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.common.idgenerator;
package com.seoultech.synergybe.domain.common.generator;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand All @@ -10,7 +10,7 @@

@Slf4j
@Component
public class IdGeneratorRivkodeImpl implements IdGenerator {
public class IdGeneratorRivkodeImpl {
private static final int ASCII_LOWER_CASE_START = 97;
private static final int ASCII_LOWER_CASE_END = 122;
private static final int ASCII_UPPER_CASE_START = 65;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.common.idgenerator;
package com.seoultech.synergybe.domain.common.generator;

import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -53,9 +53,9 @@ public IdGeneratorSnowFlake() {
this.customEpoch = DEFAULT_CUSTOM_EPOCH;
}

public String generateId(IdPrefix idPrefix) {
public Long generateId() {
long id = nextId();
return String.valueOf(id);
return id;
}

public synchronized long nextId() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.common.idgenerator;
package com.seoultech.synergybe.domain.common.generator;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.seoultech.synergybe.domain.common.idgenerator;
package com.seoultech.synergybe.domain.common.generator;

import org.springframework.stereotype.Component;

Expand Down

This file was deleted.

0 comments on commit f80a040

Please sign in to comment.