feat: member 데이터 insert 및 updatedBy, updatedAt 데이터 내용 수정

This commit is contained in:
Hanbin Lee
2023-01-18 01:33:40 +09:00
parent 5ac5976dd3
commit 6337320cae
8 changed files with 39 additions and 14 deletions

View File

@@ -1,20 +1,20 @@
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('비니카페', '서울시 동대문구 전농로', '01011112222', 3.98, '언제나 상쾌한 비니카페', now(), 'system', null, null);
VALUES ('비니카페', '서울시 동대문구 전농로', '01011112222', 3.98, '언제나 상쾌한 비니카페', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('조이카페', '서울시 영등포구', '01033334444', 4.67, '언제나 상쾌한 조이카페', now(), 'system', null, null);
VALUES ('조이카페', '서울시 영등포구', '01033334444', 4.67, '언제나 상쾌한 조이카페', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('abc카페', '서울시 서대문구', '01025341432', 4.89, '언제나 상쾌한 abc카페', now(), 'system', null, null);
VALUES ('abc카페', '서울시 서대문구', '01025341432', 4.89, '언제나 상쾌한 abc카페', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('동네주변카페', '서울시 송파구', '01022223333', 4.23, '언제나 상쾌한 동네주변카페', now(), 'system', null, null);
VALUES ('동네주변카페', '서울시 송파구', '01022223333', 4.23, '언제나 상쾌한 동네주변카페', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('방긋카페', '서울시 광진구', '01099998888', 4.35, '언제나 상쾌한 방긋카페', now(), 'system', null, null);
VALUES ('방긋카페', '서울시 광진구', '01099998888', 4.35, '언제나 상쾌한 방긋카페', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('example cafe1', '서울시 종로구', '01077779999', 2.85, '언제나 상쾌한 example cafe1', now(), 'system', null, null);
VALUES ('example cafe1', '서울시 종로구', '01077779999', 2.85, '언제나 상쾌한 example cafe1', now(), 'system', now(), 'system');
INSERT IGNORE INTO `cafe` (name, address, phone_number, total_rate, description, created_at, created_by, updated_at, updated_by)
VALUES ('example cafe2', '서울시', '01044445555', 3.12, '언제나 상쾌한 example cafe2', now(), 'system', null, null);
VALUES ('example cafe2', '서울시', '01044445555', 3.12, '언제나 상쾌한 example cafe2', now(), 'system', now(), 'system');

View File

@@ -15,7 +15,7 @@ BEGIN
WHILE(j <= 3) DO
INSERT IGNORE INTO `cafe_image` (img_url, created_at, created_by, updated_at, updated_by, cafe_id)
VALUES (CONCAT('test_img_url_', idx_img), now(), 'system', null, null, var_cafe_id);
VALUES (CONCAT('test_img_url_', idx_img), now(), 'system', now(), 'system', var_cafe_id);
SET j = j + 1;
SET idx_img = idx_img + 1;

View File

@@ -13,7 +13,7 @@ BEGIN
WHILE(j <= 10) DO
INSERT IGNORE INTO `cafe_menu` (name, price, created_at, created_by, updated_at, updated_by, cafe_id)
VALUES (CONCAT('커피', j), FLOOR(RAND() * 10 + 1) * 1000, now(), 'system', null, null, var_cafe_id);
VALUES (CONCAT('커피', j), FLOOR(RAND() * 10 + 1) * 1000, now(), 'system', now(), 'system', var_cafe_id);
SET j = j + 1;
END WHILE;

View File

@@ -0,0 +1,3 @@
-- beanie@test.com / 1111
INSERT IGNORE INTO `member` (email, password, address, phone_number, role_type, activated, created_at, created_by, updated_at, updated_by)
VALUES ('beanie@test.com', '{bcrypt}$2a$10$sgNB3pRNXFcCajZe5NTJ3OEAabzmwD7Q.lD0hOr5gAtC0q/q1kLHa', '서울 어디', '01011223344', 'ROLE_USER', true, now(), 'system', now(), 'system');

View File

@@ -13,7 +13,7 @@ BEGIN
LIMIT i, 1);
INSERT IGNORE INTO `menu_option` (title, created_at, created_by, updated_at, updated_by, cafe_menu_id)
VALUES ('SIZE', now(), 'system', null, null, var_cafe_menu_id);
VALUES ('SIZE', now(), 'system', now(), 'system', var_cafe_menu_id);
SET i = i + 1;
END WHILE;

View File

@@ -13,11 +13,11 @@ BEGIN
LIMIT i, 1);
INSERT IGNORE INTO `option_detail` (name, extra_price, created_at, created_by, updated_at, updated_by, menu_option_id)
VALUES ('MEDIUM', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', null, null, var_menu_option_id);
VALUES ('MEDIUM', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', now(), 'system', var_menu_option_id);
INSERT IGNORE INTO `option_detail` (name, extra_price, created_at, created_by, updated_at, updated_by, menu_option_id)
VALUES ('LARGE', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', null, null, var_menu_option_id);
VALUES ('LARGE', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', now(), 'system', var_menu_option_id);
INSERT IGNORE INTO `option_detail` (name, extra_price, created_at, created_by, updated_at, updated_by, menu_option_id)
VALUES ('VENTI', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', null, null, var_menu_option_id);
VALUES ('VENTI', FLOOR(RAND() * 3 + 1) * 1000, now(), 'system', now(), 'system', var_menu_option_id);
SET i = i + 1;
END WHILE;

View File

@@ -0,0 +1,23 @@
package io.beaniejoy.dongnecafe.common
import mu.KLogging
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.security.crypto.password.PasswordEncoder
@SpringBootTest
class PasswordEncoderTest {
@Autowired
lateinit var passwordEncoder: PasswordEncoder
companion object: KLogging()
@Test
fun makeEncodedPasswordTest() {
val encodedPw = passwordEncoder.encode("1111")
assertEquals("{bcrypt}\$2a$10\$Wb71jZO9Z.1HXozEnmtqdOHSxCJjn9jMcVWNzqCgd7SW.nZj/1kC2", encodedPw)
}
}

View File

@@ -29,7 +29,6 @@ class JwtTokenUtils(
}
fun createToken(authentication: Authentication): String {
logger.info { "test = ${authentication.name}" }
val authenticatedMember = (authentication.principal as SecurityUser).member
val authorities = authentication.authorities.joinToString(",") { it.authority }