Skip to content

Commit

Permalink
πŸ”₯ remove birthday code
Browse files Browse the repository at this point in the history
  • Loading branch information
HaiSeong committed Jul 31, 2024
1 parent 14619c4 commit 77e4058
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package net.pengcook.authentication.dto;

import com.google.firebase.database.annotations.NotNull;
import jakarta.validation.constraints.NotBlank;
import java.time.LocalDate;

public record GoogleSignUpRequest(
@NotBlank String idToken,
@NotBlank String username,
@NotBlank String nickname,
@NotNull LocalDate birthday,
@NotBlank String country
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public record GoogleSignUpResponse(
String username,
String nickname,
String image,
String birthday,
String country,
String accessToken,
String refreshToken
Expand All @@ -20,7 +19,6 @@ public GoogleSignUpResponse(User user, String accessToken, String refreshToken)
user.getUsername(),
user.getNickname(),
user.getImage(),
user.getBirth().toString(),
user.getRegion(),
accessToken,
refreshToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ private User createUser(GoogleSignUpRequest googleSignUpRequest) {
googleSignUpRequest.username(),
googleSignUpRequest.nickname(),
decodedToken.getPicture(),
googleSignUpRequest.birthday(),
googleSignUpRequest.country()
);
}
Expand Down
8 changes: 2 additions & 6 deletions backend/src/main/java/net/pengcook/user/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down Expand Up @@ -35,13 +34,10 @@ public class User {
@Column(nullable = false)
private String image;

@Column(nullable = false)
private LocalDate birth;

@Column(nullable = false)
private String region;

public User(String email, String username, String nickname, String image, LocalDate birth, String region) {
this(0L, email, username, nickname, image, birth, region);
public User(String email, String username, String nickname, String image, String region) {
this(0L, email, username, nickname, image, region);
}
}
3 changes: 0 additions & 3 deletions backend/src/main/java/net/pengcook/user/dto/UserResponse.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.pengcook.user.dto;

import java.time.LocalDate;
import net.pengcook.user.domain.User;

public record UserResponse(
Expand All @@ -9,7 +8,6 @@ public record UserResponse(
String username,
String nickname,
String image,
LocalDate birth,
String region
) {

Expand All @@ -20,7 +18,6 @@ public UserResponse(User user) {
user.getUsername(),
user.getNickname(),
user.getImage(),
user.getBirth(),
user.getRegion()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@

String image() default "tester.jpg";

String birth() default "2000-01-01";

String region() default "KOREA";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.google.firebase.auth.FirebaseToken;
import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import java.time.LocalDate;
import java.util.regex.Pattern;
import net.pengcook.RestDocsSetting;
import net.pengcook.authentication.domain.JwtTokenManager;
Expand Down Expand Up @@ -127,7 +126,6 @@ void signUpWithGoogle() throws FirebaseAuthException {
idToken,
"new_face",
"μ‹ μž…",
LocalDate.of(2000, 1, 1),
"KOREA"
);

Expand All @@ -144,7 +142,6 @@ void signUpWithGoogle() throws FirebaseAuthException {
fieldWithPath("idToken").description("Google ID Token"),
fieldWithPath("username").description("μ‚¬μš©μž 아이디"),
fieldWithPath("nickname").description("μ‚¬μš©μž λ‹‰λ„€μž„"),
fieldWithPath("birthday").description("생년월일"),
fieldWithPath("country").description("κ΅­κ°€")
),
responseFields(
Expand All @@ -153,7 +150,6 @@ void signUpWithGoogle() throws FirebaseAuthException {
fieldWithPath("username").description("μ‚¬μš©μž 아이디"),
fieldWithPath("nickname").description("μ‚¬μš©μž λ‹‰λ„€μž„"),
fieldWithPath("image").description("μ‚¬μš©μž ν”„λ‘œν•„ 이미지"),
fieldWithPath("birthday").description("μ‚¬μš©μž 생년월일"),
fieldWithPath("country").description("μ‚¬μš©μž κ΅­κ°€"),
fieldWithPath("accessToken").description("JWT Access Token"),
fieldWithPath("refreshToken").description("JWT Refresh Token")
Expand All @@ -179,7 +175,6 @@ void signUpWithGoogleWhenEmailAleadyRegistered() throws FirebaseAuthException {
idToken,
"loki",
"λ‘œν‚€",
LocalDate.of(1999, 8, 8),
"KOREA"
);

Expand All @@ -196,7 +191,6 @@ void signUpWithGoogleWhenEmailAleadyRegistered() throws FirebaseAuthException {
fieldWithPath("idToken").description("Google ID Token"),
fieldWithPath("username").description("μ‚¬μš©μž 아이디"),
fieldWithPath("nickname").description("μ‚¬μš©μž λ‹‰λ„€μž„"),
fieldWithPath("birthday").description("생년월일"),
fieldWithPath("country").description("κ΅­κ°€")
)
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import java.time.LocalDate;
import net.pengcook.authentication.annotation.WithLoginUser;
import net.pengcook.authentication.domain.JwtTokenManager;
import net.pengcook.authentication.domain.TokenPayload;
Expand Down Expand Up @@ -49,7 +48,6 @@ private User saveUser(WithLoginUser annotation, UserRepository userRepository) {
annotation.username(),
annotation.nickname(),
annotation.image(),
LocalDate.parse(annotation.birth()),
annotation.region()
);
return userRepository.save(user);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseAuthException;
import com.google.firebase.auth.FirebaseToken;
import java.time.LocalDate;
import java.util.regex.Pattern;
import net.pengcook.authentication.domain.JwtTokenManager;
import net.pengcook.authentication.domain.TokenPayload;
Expand Down Expand Up @@ -91,7 +90,6 @@ void signUpWithGoogle() throws FirebaseAuthException {
idToken,
"new_face",
"μ‹ μž…",
LocalDate.of(2000, 1, 1),
"KOREA"
);

Expand All @@ -115,7 +113,6 @@ void signUpWithGoogleWhenEmailAleadyRegistered() throws FirebaseAuthException {
idToken,
"loki",
"λ‘œν‚€",
LocalDate.of(1999, 8, 8),
"KOREA"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;
import net.pengcook.category.repository.CategoryRecipeRepository;
Expand Down Expand Up @@ -36,7 +35,7 @@ class CategoryServiceTest {
@Test
@DisplayName("λ ˆμ‹œν”Όμ˜ μΉ΄ν…Œκ³ λ¦¬λ₯Ό μ €μž₯ν•  수 μžˆλ‹€.")
void saveCategories() {
User author = new User("[email protected]", "ela", "μ—˜λΌ", "ela.jpg", LocalDate.of(2024, 7, 22), "KOREA");
User author = new User("[email protected]", "ela", "μ—˜λΌ", "ela.jpg", "KOREA");
Recipe recipe = new Recipe(1L, "κΉ€μΉ˜λ³ΆμŒλ°₯", author, LocalTime.of(0, 30, 0), "κΉ€μΉ˜λ³ΆμŒλ°₯이미지.jpg", 3, 2, "κΉ€μΉ˜λ³ΆμŒλ°₯ 쑰리법");

categoryService.saveCategories(recipe, List.of("건강식", "λ§€μš΄μŒμ‹"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import io.restassured.RestAssured;
import io.restassured.http.ContentType;
import java.time.LocalDate;
import net.pengcook.RestDocsSetting;
import net.pengcook.authentication.annotation.WithLoginUser;
import net.pengcook.authentication.annotation.WithLoginUserTest;
Expand All @@ -36,7 +35,6 @@ void getUserProfile() {
"loki",
"λ‘œν‚€",
"loki.jpg",
LocalDate.of(1999, 8, 8),
"KOREA"
);

Expand All @@ -50,7 +48,6 @@ void getUserProfile() {
fieldWithPath("username").description("μ‚¬μš©μž 아이디"),
fieldWithPath("nickname").description("μ‚¬μš©μž λ‹‰λ„€μž„"),
fieldWithPath("image").description("μ‚¬μš©μž ν”„λ‘œν•„ 이미지"),
fieldWithPath("birth").description("μ‚¬μš©μž 생년월일"),
fieldWithPath("region").description("μ‚¬μš©μž κ΅­κ°€")
)
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

import java.time.LocalDate;
import java.util.NoSuchElementException;
import net.pengcook.user.dto.UserResponse;
import net.pengcook.user.dto.UsernameCheckResponse;
Expand Down Expand Up @@ -37,7 +36,6 @@ void getUserById() {
"loki",
"λ‘œν‚€",
"loki.jpg",
LocalDate.of(1999, 8, 8),
"KOREA"
);

Expand All @@ -54,7 +52,7 @@ void getUserByIdWhenNotExistId() {
assertThatThrownBy(() -> userService.getUserById(id))
.isInstanceOf(NoSuchElementException.class);
}

@Test
@DisplayName("μ€‘λ³΅λ˜μ§€ μ•Šμ€ username을 μž…λ ₯ν•˜λ©΄ μ‚¬μš© κ°€λŠ₯ν•˜λ‹€")
void checkUsername() {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/resources/data/category.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ALTER TABLE ingredient_recipe
SET
REFERENTIAL_INTEGRITY TRUE;

INSERT INTO users (email, username, nickname, image, birth, region)
VALUES ('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', '2024-07-22', 'KOREA');
INSERT INTO users (email, username, nickname, image, region)
VALUES ('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', 'KOREA');

INSERT INTO category (name)
VALUES ('ν•œμ‹'),
Expand Down
18 changes: 9 additions & 9 deletions backend/src/test/resources/data/ingredient.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ ALTER TABLE ingredient_recipe ALTER COLUMN id RESTART;

SET REFERENTIAL_INTEGRITY TRUE;

INSERT INTO users (email, username, nickname, image, birth, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', '1999-08-08', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', '2024-07-22', 'KOREA');
INSERT INTO users (email, username, nickname, image, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', 'KOREA');

INSERT INTO recipe (title, author_id, cooking_time, thumbnail, difficulty, like_count, description)
VALUES ('κΉ€λ°₯', 1, '01:00:00', 'κΉ€λ°₯이미지.jpg', 8, 1, 'κΉ€λ°₯ 쑰리법'),
Expand Down
18 changes: 9 additions & 9 deletions backend/src/test/resources/data/recipe.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ ALTER TABLE recipe_step ALTER COLUMN id RESTART;

SET REFERENTIAL_INTEGRITY TRUE;

INSERT INTO users (email, username, nickname, image, birth, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', '1999-08-08', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', '2024-07-22', 'KOREA');
INSERT INTO users (email, username, nickname, image, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', 'KOREA');

INSERT INTO category (name)
VALUES ('ν•œμ‹'),
Expand Down
18 changes: 9 additions & 9 deletions backend/src/test/resources/data/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ TRUNCATE TABLE users;
ALTER TABLE users ALTER COLUMN id RESTART WITH 1;
SET REFERENTIAL_INTEGRITY TRUE;

INSERT INTO users (email, username, nickname, image, birth, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', '1999-08-08', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', '2024-07-22', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', '2024-07-22', 'KOREA');
INSERT INTO users (email, username, nickname, image, region)
VALUES ('[email protected]', 'loki', 'λ‘œν‚€', 'loki.jpg', 'KOREA'),
('[email protected]', 'ela', 'μ—˜λΌ', 'ela.jpg', 'KOREA'),
('[email protected]', 'crocodile', 'μ•…μ–΄', 'crocodile.jpg', 'KOREA'),
('[email protected]', 'birdsheep', 'μƒˆμ–‘', 'birdsheep.jpg', 'KOREA'),
('[email protected]', 'pond', 'ν°λ“œ', 'pond.jpg', 'KOREA'),
('[email protected]', 'ato', 'μ•„ν† ', 'ato.jpg', 'KOREA'),
('[email protected]', 'km', '케이엠', 'km.jpg', 'KOREA'),
('[email protected]', 'hadi', 'ν•˜λ””', 'hadi.jpg', 'KOREA');

0 comments on commit 77e4058

Please sign in to comment.