Skip to content

Commit

Permalink
📦️ [CHORE] Sticker 카테고리 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
dong2ast committed Jan 18, 2024
1 parent af112e0 commit 5a26275
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 56 deletions.
102 changes: 49 additions & 53 deletions src/main/java/org/sopt/lequuServer/InitDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@

import jakarta.annotation.PostConstruct;
import jakarta.persistence.EntityManager;
import java.util.Arrays;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.sopt.lequuServer.domain.book.model.Book;
import org.sopt.lequuServer.domain.member.model.Member;
import org.sopt.lequuServer.domain.member.model.SocialPlatform;
import org.sopt.lequuServer.domain.note.model.Note;
import org.sopt.lequuServer.domain.sticker.model.Sticker;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

import static org.sopt.lequuServer.domain.sticker.model.StickerCategory.*;

@Component
@RequiredArgsConstructor
public class InitDb {
Expand Down Expand Up @@ -145,53 +141,53 @@ public void dbInit() {
em.persist(note2);
}

Sticker sticker1 = Sticker.builder()
.bookId(0L)
.category(BIRTHDAY)
.stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
.build();
em.persist(sticker1);
for (int i = 0; i < 2; i++) {
Sticker sticker = Sticker.builder()
.bookId(0L)
.category(ALPHABET)
.stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/8d83b1c1-1e2c-437b-a2f5-e3ce96ce6d35.jpg")
.build();
em.persist(sticker);
}
for (int i = 0; i < 2; i++) {
Sticker sticker = Sticker.builder()
.bookId(0L)
.category(BIRTHDAY)
.stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
.build();
em.persist(sticker);
}
for (String characterSticker : CHARACTER_STICKERS) {
Sticker sticker = Sticker.builder()
.bookId(0L)
.category(CHARACTER)
.stickerImage(characterSticker)
.build();
em.persist(sticker);
}

for (int i = 0; i < 2; i++) {
Sticker sticker = Sticker.builder()
.bookId(1L)
.category(ALPHABET)
.stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/8d83b1c1-1e2c-437b-a2f5-e3ce96ce6d35.jpg")
.build();
em.persist(sticker);
}
for (int i = 0; i < 3; i++) {
Sticker sticker = Sticker.builder()
.bookId(1L)
.category(BIRTHDAY)
.stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
.build();
em.persist(sticker);
}
// Sticker sticker1 = Sticker.builder()
// .bookId(0L)
// .category(BIRTHDAY)
// .stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
// .build();
// em.persist(sticker1);
// for (int i = 0; i < 2; i++) {
// Sticker sticker = Sticker.builder()
// .bookId(0L)
// .category(ALPHABET)
// .stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/8d83b1c1-1e2c-437b-a2f5-e3ce96ce6d35.jpg")
// .build();
// em.persist(sticker);
// }
// for (int i = 0; i < 2; i++) {
// Sticker sticker = Sticker.builder()
// .bookId(0L)
// .category(BIRTHDAY)
// .stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
// .build();
// em.persist(sticker);
// }
// for (String characterSticker : CHARACTER_STICKERS) {
// Sticker sticker = Sticker.builder()
// .bookId(0L)
// .category(CHARACTER)
// .stickerImage(characterSticker)
// .build();
// em.persist(sticker);
// }
//
// for (int i = 0; i < 2; i++) {
// Sticker sticker = Sticker.builder()
// .bookId(1L)
// .category(ALPHABET)
// .stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/8d83b1c1-1e2c-437b-a2f5-e3ce96ce6d35.jpg")
// .build();
// em.persist(sticker);
// }
// for (int i = 0; i < 3; i++) {
// Sticker sticker = Sticker.builder()
// .bookId(1L)
// .category(BIRTHDAY)
// .stickerImage("https://dzfv99wxq6tx0.cloudfront.net/stickers/birth_1.svg")
// .build();
// em.persist(sticker);
// }

// PostedSticker postedSticker = PostedSticker.builder()
// .member(member1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum StickerCategory {

ALPHABET("알파벳"),
BIRTHDAY("생일"),
CHARACTER("캐릭터");
CUSTOM("커스텀"),
EVENT("이벤트"),
CAT("고양이"),
ITEM("아이템");

private final String value;
}

0 comments on commit 5a26275

Please sign in to comment.