Skip to content

Commit

Permalink
Merge pull request #205 from ITZipProject/feature/techinfo
Browse files Browse the repository at this point in the history
๐Ÿš‘ ๊ธด๊ธ‰ ์ˆ˜์ • : TransientPropertyValueException ํ•ด๊ฒฐ, ํ…Œ์ŠคํŠธ ์—ฐ๋„ ์ˆ˜์ • ๋ฐ ์ดˆ๊ธฐ ์‚ฌ์šฉ์ž ๋ฐ์ดํ„ฐ ์ถ”๊ฐ€
  • Loading branch information
rowing0328 authored Jan 7, 2025
2 parents f088db2 + 91a0ede commit c96b7bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ public String save(UserJoinRequest userJoinRequest) {
user.setPassword(encryptedPassword);
user.setNickname(getUniqueNickname());

userRepository.save(user.convertToEntity());
User savedUser = userRepository.save(user.convertToEntity()).convertToDomain();

blogCommandService.create(user);
blogCommandService.create(savedUser);

return "ํšŒ์›๊ฐ€์ž…์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.";
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/resources/sql/techinfo/techinfo_blogs.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

CREATE TABLE blogs
(
id BIGSERIAL PRIMARY KEY,
Expand All @@ -10,5 +9,15 @@ CREATE TABLE blogs
CONSTRAINT fk_user FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE
);

INSERT INTO users (id, create_date, modify_date, authority, email, nickname, password, image_url)
VALUES (1,
'2024-08-26 01:00:56.653362',
'2024-08-26 01:00:56.653362',
'USER',
'dev.hyoseung@gmail.com',
'hyoseung',
'$2a$10$JV5r580j9yGtPwj8FsPpo.UQ.H6j25fLZG6H1iYbtX4rYOCsQUXVa',
'https://dy1vg9emkijkn.cloudfront.net/profile/19cc111f-c8f4-4d64-bd7a-129415e3ffa2.jpg');

INSERT INTO blogs (user_id, intro, is_public, create_date, modify_date)
VALUES (1, 'This is a sample blog introduction.', TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void tearDown(@Autowired PostCommandRepository postCommandRepository) {

// then
assertThat(result).isNotNull();
assertThat(result.getFirst().getYear()).isEqualTo(2024);
assertThat(result.getFirst().getYear()).isEqualTo(2025);
}

}

0 comments on commit c96b7bc

Please sign in to comment.