From 16f2a3d1f43547de0e95f47a2202bcf727c7a220 Mon Sep 17 00:00:00 2001 From: Awhn Date: Mon, 11 Nov 2024 16:52:21 +0900 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=ED=95=98=EC=9C=84=20=EC=A7=80?= =?UTF-8?q?=EC=9E=90=EC=B2=B4=20=EA=B4=80=EB=A0=A8=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=A0=95=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/district_and_coordinate_kr.csv | 321 ++++++------------ 1 file changed, 103 insertions(+), 218 deletions(-) diff --git a/src/main/resources/district_and_coordinate_kr.csv b/src/main/resources/district_and_coordinate_kr.csv index 8c8149c..352eb5a 100644 --- a/src/main/resources/district_and_coordinate_kr.csv +++ b/src/main/resources/district_and_coordinate_kr.csv @@ -1,41 +1,11 @@ sidoGunguCode,sidoCode,sidoName,gunguName,latitude,longitude,sido 3000000,6110000,서울특별시,종로구,37.59491732,126.9773213,FALSE -3410000,6270000,대구광역시,중구,37.56014356,126.9959681,FALSE -3650000,6300000,대전광역시,중구,37.56014356,126.9959681,FALSE -3250000,6260000,부산광역시,중구,37.56014356,126.9959681,FALSE 3010000,6110000,서울특별시,중구,37.56014356,126.9959681,FALSE -3690000,6310000,울산광역시,중구,37.56014356,126.9959681,FALSE -3490000,6280000,인천광역시,중구,37.56014356,126.9959681,FALSE -3410000,6270000,대구광역시,중구,35.10547776,129.0315402,FALSE -3650000,6300000,대전광역시,중구,35.10547776,129.0315402,FALSE 3250000,6260000,부산광역시,중구,35.10547776,129.0315402,FALSE -3010000,6110000,서울특별시,중구,35.10547776,129.0315402,FALSE -3690000,6310000,울산광역시,중구,35.10547776,129.0315402,FALSE -3490000,6280000,인천광역시,중구,35.10547776,129.0315402,FALSE 3410000,6270000,대구광역시,중구,35.86653529,128.5936058,FALSE -3650000,6300000,대전광역시,중구,35.86653529,128.5936058,FALSE -3250000,6260000,부산광역시,중구,35.86653529,128.5936058,FALSE -3010000,6110000,서울특별시,중구,35.86653529,128.5936058,FALSE -3690000,6310000,울산광역시,중구,35.86653529,128.5936058,FALSE -3490000,6280000,인천광역시,중구,35.86653529,128.5936058,FALSE -3410000,6270000,대구광역시,중구,37.46753391,126.4805605,FALSE -3650000,6300000,대전광역시,중구,37.46753391,126.4805605,FALSE -3250000,6260000,부산광역시,중구,37.46753391,126.4805605,FALSE -3010000,6110000,서울특별시,중구,37.46753391,126.4805605,FALSE -3690000,6310000,울산광역시,중구,37.46753391,126.4805605,FALSE 3490000,6280000,인천광역시,중구,37.46753391,126.4805605,FALSE -3410000,6270000,대구광역시,중구,36.28086015,127.4110573,FALSE 3650000,6300000,대전광역시,중구,36.28086015,127.4110573,FALSE -3250000,6260000,부산광역시,중구,36.28086015,127.4110573,FALSE -3010000,6110000,서울특별시,중구,36.28086015,127.4110573,FALSE -3690000,6310000,울산광역시,중구,36.28086015,127.4110573,FALSE -3490000,6280000,인천광역시,중구,36.28086015,127.4110573,FALSE -3410000,6270000,대구광역시,중구,35.57104934,129.3082429,FALSE -3650000,6300000,대전광역시,중구,35.57104934,129.3082429,FALSE -3250000,6260000,부산광역시,중구,35.57104934,129.3082429,FALSE -3010000,6110000,서울특별시,중구,35.57104934,129.3082429,FALSE 3690000,6310000,울산광역시,중구,35.57104934,129.3082429,FALSE -3490000,6280000,인천광역시,중구,35.57104934,129.3082429,FALSE 3020000,6110000,서울특별시,용산구,37.53138497,126.979907,FALSE 3030000,6110000,서울특별시,성동구,37.55102969,127.0410585,FALSE 3040000,6110000,서울특별시,광진구,37.54670608,127.0857435,FALSE @@ -49,10 +19,8 @@ 3120000,6110000,서울특별시,서대문구,37.57778531,126.9390631,FALSE 3130000,6110000,서울특별시,마포구,37.55931349,126.90827,FALSE 3140000,6110000,서울특별시,양천구,37.52478941,126.8554777,FALSE -3360000,6260000,부산광역시,강서구,37.56123543,126.822807,FALSE 3150000,6110000,서울특별시,강서구,37.56123543,126.822807,FALSE 3360000,6260000,부산광역시,강서구,35.13834787,128.8924006,FALSE -3150000,6110000,서울특별시,강서구,35.13834787,128.8924006,FALSE 3160000,6110000,서울특별시,구로구,37.49440543,126.8563006,FALSE 3170000,6110000,서울특별시,금천구,37.46056756,126.9008202,FALSE 3180000,6110000,서울특별시,영등포구,37.52230829,126.9101695,FALSE @@ -62,110 +30,28 @@ 3220000,6110000,서울특별시,강남구,37.49664389,127.0629852,FALSE 3230000,6110000,서울특별시,송파구,37.50561924,127.115295,FALSE 3240000,6110000,서울특별시,강동구,37.55045024,127.1470118,FALSE -3600000,6290000,광주광역시,서구,35.10383663,129.0149537,FALSE -3430000,6270000,대구광역시,서구,35.10383663,129.0149537,FALSE -3660000,6300000,대전광역시,서구,35.10383663,129.0149537,FALSE 3260000,6260000,부산광역시,서구,35.10383663,129.0149537,FALSE -3560000,6280000,인천광역시,서구,35.10383663,129.0149537,FALSE -3600000,6290000,광주광역시,서구,35.87500167,128.5496976,FALSE 3430000,6270000,대구광역시,서구,35.87500167,128.5496976,FALSE -3660000,6300000,대전광역시,서구,35.87500167,128.5496976,FALSE -3260000,6260000,부산광역시,서구,35.87500167,128.5496976,FALSE -3560000,6280000,인천광역시,서구,35.87500167,128.5496976,FALSE -3600000,6290000,광주광역시,서구,37.55780443,126.6563778,FALSE -3430000,6270000,대구광역시,서구,37.55780443,126.6563778,FALSE -3660000,6300000,대전광역시,서구,37.55780443,126.6563778,FALSE -3260000,6260000,부산광역시,서구,37.55780443,126.6563778,FALSE 3560000,6280000,인천광역시,서구,37.55780443,126.6563778,FALSE 3600000,6290000,광주광역시,서구,35.13569311,126.8507191,FALSE -3430000,6270000,대구광역시,서구,35.13569311,126.8507191,FALSE -3660000,6300000,대전광역시,서구,35.13569311,126.8507191,FALSE -3260000,6260000,부산광역시,서구,35.13569311,126.8507191,FALSE -3560000,6280000,인천광역시,서구,35.13569311,126.8507191,FALSE -3600000,6290000,광주광역시,서구,36.28023963,127.3451041,FALSE -3430000,6270000,대구광역시,서구,36.28023963,127.3451041,FALSE 3660000,6300000,대전광역시,서구,36.28023963,127.3451041,FALSE -3260000,6260000,부산광역시,서구,36.28023963,127.3451041,FALSE -3560000,6280000,인천광역시,서구,36.28023963,127.3451041,FALSE -3590000,6290000,광주광역시,동구,35.12918632,129.0445856,FALSE -3420000,6270000,대구광역시,동구,35.12918632,129.0445856,FALSE -3640000,6300000,대전광역시,동구,35.12918632,129.0445856,FALSE 3270000,6260000,부산광역시,동구,35.12918632,129.0445856,FALSE -3710000,6310000,울산광역시,동구,35.12918632,129.0445856,FALSE -3500000,6280000,인천광역시,동구,35.12918632,129.0445856,FALSE -3590000,6290000,광주광역시,동구,35.93442633,128.6856599,FALSE 3420000,6270000,대구광역시,동구,35.93442633,128.6856599,FALSE -3640000,6300000,대전광역시,동구,35.93442633,128.6856599,FALSE -3270000,6260000,부산광역시,동구,35.93442633,128.6856599,FALSE -3710000,6310000,울산광역시,동구,35.93442633,128.6856599,FALSE -3500000,6280000,인천광역시,동구,35.93442633,128.6856599,FALSE -3590000,6290000,광주광역시,동구,37.48298658,126.6397466,FALSE -3420000,6270000,대구광역시,동구,37.48298658,126.6397466,FALSE -3640000,6300000,대전광역시,동구,37.48298658,126.6397466,FALSE -3270000,6260000,부산광역시,동구,37.48298658,126.6397466,FALSE -3710000,6310000,울산광역시,동구,37.48298658,126.6397466,FALSE 3500000,6280000,인천광역시,동구,37.48298658,126.6397466,FALSE 3590000,6290000,광주광역시,동구,35.11738023,126.9494643,FALSE -3420000,6270000,대구광역시,동구,35.11738023,126.9494643,FALSE -3640000,6300000,대전광역시,동구,35.11738023,126.9494643,FALSE -3270000,6260000,부산광역시,동구,35.11738023,126.9494643,FALSE -3710000,6310000,울산광역시,동구,35.11738023,126.9494643,FALSE -3500000,6280000,인천광역시,동구,35.11738023,126.9494643,FALSE -3590000,6290000,광주광역시,동구,36.32392023,127.4750374,FALSE -3420000,6270000,대구광역시,동구,36.32392023,127.4750374,FALSE -3640000,6300000,대전광역시,동구,36.32392023,127.4750374,FALSE -3270000,6260000,부산광역시,동구,36.32392023,127.4750374,FALSE -3710000,6310000,울산광역시,동구,36.32392023,127.4750374,FALSE -3500000,6280000,인천광역시,동구,36.32392023,127.4750374,FALSE -3590000,6290000,광주광역시,동구,35.52557365,129.4260655,FALSE -3420000,6270000,대구광역시,동구,35.52557365,129.4260655,FALSE -3640000,6300000,대전광역시,동구,35.52557365,129.4260655,FALSE -3270000,6260000,부산광역시,동구,35.52557365,129.4260655,FALSE +3420000,6270000,대전광역시,동구,36.32392023,127.4750374,FALSE 3710000,6310000,울산광역시,동구,35.52557365,129.4260655,FALSE -3500000,6280000,인천광역시,동구,35.52557365,129.4260655,FALSE 3280000,6260000,부산광역시,영도구,35.07868795,129.0648096,FALSE 3290000,6260000,부산광역시,부산진구,35.16524411,129.0430603,FALSE 3300000,6260000,부산광역시,동래구,35.20621244,129.0792201,FALSE -3610000,6290000,광주광역시,남구,35.12613679,129.0940064,FALSE -3440000,6270000,대구광역시,남구,35.12613679,129.0940064,FALSE 3310000,6260000,부산광역시,남구,35.12613679,129.0940064,FALSE -3700000,6310000,울산광역시,남구,35.12613679,129.0940064,FALSE -3510000,6280000,인천광역시,남구,35.12613679,129.0940064,FALSE -3610000,6290000,광주광역시,남구,35.83517716,128.5853296,FALSE 3440000,6270000,대구광역시,남구,35.83517716,128.5853296,FALSE -3310000,6260000,부산광역시,남구,35.83517716,128.5853296,FALSE -3700000,6310000,울산광역시,남구,35.83517716,128.5853296,FALSE -3510000,6280000,인천광역시,남구,35.83517716,128.5853296,FALSE -3610000,6290000,광주광역시,남구,37.45259578,126.6646585,FALSE -3440000,6270000,대구광역시,남구,37.45259578,126.6646585,FALSE -3310000,6260000,부산광역시,남구,37.45259578,126.6646585,FALSE -3700000,6310000,울산광역시,남구,37.45259578,126.6646585,FALSE 3510000,6280000,인천광역시,미추홀구,37.45259578,126.6646585,FALSE 3610000,6290000,광주광역시,남구,35.09405825,126.8567181,FALSE -3440000,6270000,대구광역시,남구,35.09405825,126.8567181,FALSE -3310000,6260000,부산광역시,남구,35.09405825,126.8567181,FALSE -3700000,6310000,울산광역시,남구,35.09405825,126.8567181,FALSE -3510000,6280000,인천광역시,남구,35.09405825,126.8567181,FALSE -3610000,6290000,광주광역시,남구,35.51604996,129.3282023,FALSE -3440000,6270000,대구광역시,남구,35.51604996,129.3282023,FALSE -3310000,6260000,부산광역시,남구,35.51604996,129.3282023,FALSE 3700000,6310000,울산광역시,남구,35.51604996,129.3282023,FALSE -3510000,6280000,인천광역시,남구,35.51604996,129.3282023,FALSE -3620000,6290000,광주광역시,북구,35.22922961,129.0234398,FALSE -3450000,6270000,대구광역시,북구,35.22922961,129.0234398,FALSE 3320000,6260000,부산광역시,북구,35.22922961,129.0234398,FALSE -3720000,6310000,울산광역시,북구,35.22922961,129.0234398,FALSE -3620000,6290000,광주광역시,북구,35.92892237,128.5772044,FALSE 3450000,6270000,대구광역시,북구,35.92892237,128.5772044,FALSE -3320000,6260000,부산광역시,북구,35.92892237,128.5772044,FALSE -3720000,6310000,울산광역시,북구,35.92892237,128.5772044,FALSE 3620000,6290000,광주광역시,북구,35.19324611,126.9254865,FALSE -3450000,6270000,대구광역시,북구,35.19324611,126.9254865,FALSE -3320000,6260000,부산광역시,북구,35.19324611,126.9254865,FALSE -3720000,6310000,울산광역시,북구,35.19324611,126.9254865,FALSE -3620000,6290000,광주광역시,북구,35.61005392,129.3798105,FALSE -3450000,6270000,대구광역시,북구,35.61005392,129.3798105,FALSE -3320000,6260000,부산광역시,북구,35.61005392,129.3798105,FALSE 3720000,6310000,울산광역시,북구,35.61005392,129.3798105,FALSE 3330000,6260000,부산광역시,해운대구,35.19385339,129.1535934,FALSE 3340000,6260000,부산광역시,사하구,35.0893484,128.974349,FALSE @@ -186,29 +72,29 @@ 3630000,6290000,광주광역시,광산구,35.16503502,126.7528952,FALSE 3670000,6300000,대전광역시,유성구,36.37679049,127.3332564,FALSE 3680000,6300000,대전광역시,대덕구,36.41217868,127.4401518,FALSE -3730000,6310000,울산광역시,울주군,35.54661673,129.1869255, -3740000,3740000,경기도,수원시,37.31396569,127.0034517,FALSE -3750000,3740000,경기도,수원시 장안구,37.31396569,127.0034517,FALSE -3760000,3740000,경기도,수원시 권선구,37.26053016,126.9797438,FALSE -3770000,3740000,경기도,수원시 팔달구,37.27746363,127.0162387,FALSE -5610000,3740000,경기도,수원시 영통구,37.27499039,127.0566989,FALSE -3790000,3780000,경기도,성남시 수정구,37.43516624,127.1041452,FALSE -3800000,3780000,경기도,성남시 중원구,37.43343323,127.1639099,FALSE -3810000,3780000,경기도,성남시 분당구,37.37930157,127.106064,FALSE +3730000,6310000,울산광역시,울주군,35.54661673,129.1869255,FALSE +3740000,6410000,경기도,수원시,37.31396569,127.0034517,FALSE +3750000,6410000,경기도,수원시 장안구,37.31396569,127.0034517,FALSE +3760000,6410000,경기도,수원시 권선구,37.26053016,126.9797438,FALSE +3770000,6410000,경기도,수원시 팔달구,37.27746363,127.0162387,FALSE +5610000,6410000,경기도,수원시 영통구,37.27499039,127.0566989,FALSE +3790000,6410000,경기도,성남시 수정구,37.43516624,127.1041452,FALSE +3800000,6410000,경기도,성남시 중원구,37.43343323,127.1639099,FALSE +3810000,6410000,경기도,성남시 분당구,37.37930157,127.106064,FALSE 3820000,6410000,경기도,의정부시,37.73619211,127.0684231,FALSE 3830000,6410000,경기도,안양시,37.40413345,126.9113856,FALSE -3840000,3830000,경기도,안양시 만안구,37.40413345,126.9113856,FALSE -3850000,3830000,경기도,안양시 동안구,37.40039183,126.9555027,FALSE +3840000,6410000,경기도,안양시 만안구,37.40413345,126.9113856,FALSE +3850000,6410000,경기도,안양시 동안구,37.40039183,126.9555027,FALSE 3860000,6410000,경기도,부천시,37.50425833,126.7887109,FALSE 3900000,6410000,경기도,광명시,37.44515907,126.8647013,FALSE 3910000,6410000,경기도,평택시,37.01183071,126.9877007,FALSE 3920000,6410000,경기도,동두천시,37.91653761,127.0779127,FALSE -5550000,3930000,경기도,안산시 상록구,37.31600383,126.870815,FALSE -5560000,3930000,경기도,안산시 단원구,37.28192491,126.6940412,FALSE -3960000,3940000,경기도,고양시 일산구,37.67986514,126.7975582,FALSE -3950000,3940000,경기도,고양시 덕양구,37.65580987,126.8786321,FALSE -3960100,3940000,경기도,고양시 일산동구,37.67986514,126.7975582,FALSE -4100100,3940000,경기도,고양시 일산서구,37.68020512,126.7279835,FALSE +5550000,6410000,경기도,안산시 상록구,37.31600383,126.870815,FALSE +5560000,6410000,경기도,안산시 단원구,37.28192491,126.6940412,FALSE +3960000,6410000,경기도,고양시 일산구,37.67986514,126.7975582,FALSE +3950000,6410000,경기도,고양시 덕양구,37.65580987,126.8786321,FALSE +3960100,6410000,경기도,고양시 일산동구,37.67986514,126.7975582,FALSE +4100100,6410000,경기도,고양시 일산서구,37.68020512,126.7279835,FALSE 3970000,6410000,경기도,과천시,37.43384529,127.0026795,FALSE 3980000,6410000,경기도,구리시,37.59922149,127.1312299,FALSE 3990000,6410000,경기도,남양주시,37.66252981,127.2436606,FALSE @@ -218,9 +104,9 @@ 4030000,6410000,경기도,의왕시,37.36238774,126.9896255,FALSE 4040000,6410000,경기도,하남시,37.52281418,127.2059438,FALSE 4050000,6410000,경기도,용인시,37.2033319,127.2529331,FALSE -5620000,4050000,경기도,용인시 처인구,37.2033319,127.2529331,FALSE -5630000,4050000,경기도,용인시 기흥구,37.26742665,127.1213215,FALSE -5640000,4050000,경기도,용인시 수지구,37.33344743,127.0715511,FALSE +5620000,6410000,경기도,용인시 처인구,37.2033319,127.2529331,FALSE +5630000,6410000,경기도,용인시 기흥구,37.26742665,127.1213215,FALSE +5640000,6410000,경기도,용인시 수지구,37.33344743,127.0715511,FALSE 4060000,6410000,경기도,파주시,37.85619198,126.8107502,FALSE 4070000,6410000,경기도,이천시,37.20977588,127.4810141,FALSE 4080000,6410000,경기도,안성시,37.03502705,127.3027223,FALSE @@ -233,47 +119,46 @@ 4140000,6410000,경기도,연천군,38.09272995,127.0244564,FALSE 4160000,6410000,경기도,가평군,37.81843317,127.4501921,FALSE 4170000,6410000,경기도,양평군,37.51805585,127.5792645,FALSE -4181000,4180000,강원특별자치도,춘천시,37.88979679,127.7398684,FALSE -4180000,4180000,강원도,춘천시,37.88979679,127.7398684,FALSE -4191000,4190000,강원특별자치도,원주시,37.30822288,127.9295253,FALSE -4190000,4190000,강원도,원주시,37.30822288,127.9295253,FALSE -4201000,4200000,강원특별자치도,강릉시,37.70910197,128.8323789,FALSE -4200000,4200000,강원도,강릉시,37.70910197,128.8323789,FALSE -4211000,4210000,강원특별자치도,동해시,37.5066814,129.0555688,FALSE -4210000,4210000,강원도,동해시,37.5066814,129.0555688,FALSE -4221000,4220000,강원특별자치도,태백시,37.17231241,128.9800726,FALSE -4220000,4220000,강원도,태백시,37.17231241,128.9800726,FALSE -4231000,4230000,강원특별자치도,속초시,38.17603138,128.519541,FALSE -4230000,4230000,강원도,속초시,38.17603138,128.519541,FALSE -4241000,4240000,강원특별자치도,삼척시,37.27748089,129.12171,FALSE -4240000,4240000,강원도,삼척시,37.27748089,129.12171,FALSE -4251000,4250000,강원특별자치도,홍천군,37.74504907,128.0742609,FALSE -4250000,4250000,강원도,홍천군,37.74504907,128.0742609,FALSE -4261000,4260000,강원특별자치도,횡성군,37.50914207,128.0770674,FALSE -4260000,4260000,강원도,횡성군,37.50914207,128.0770674,FALSE -4271000,4270000,강원특별자치도,영월군,37.20411361,128.500296,FALSE -4270000,4270000,강원도,영월군,37.20411361,128.500296,FALSE -4281000,4280000,강원특별자치도,평창군,37.55683921,128.48259,FALSE -4280000,4280000,강원도,평창군,37.55683921,128.48259,FALSE -4291000,4290000,강원특별자치도,정선군,37.37868629,128.7390632,FALSE -4290000,4290000,강원도,정선군,37.37868629,128.7390632,FALSE -4301000,4300000,강원특별자치도,철원군,38.23908523,127.3989244,FALSE -4300000,4300000,강원도,철원군,38.23908523,127.3989244,FALSE -4311000,4310000,강원특별자치도,화천군,38.13842628,127.6851657,FALSE -4310000,4310000,강원도,화천군,38.13842628,127.6851657,FALSE -4321000,4320000,강원특별자치도,양구군,38.17560879,128.0002064,FALSE -4320000,4320000,강원도,양구군,38.17560879,128.0002064,FALSE -4331000,4330000,강원특별자치도,인제군,38.06460026,128.2647272,FALSE -4330000,4330000,강원도,인제군,38.06460026,128.2647272,FALSE -4341000,4340000,강원특별자치도,고성군,38.36275363,128.4111555,FALSE -4340000,4340000,강원도,고성군,38.36275363,128.4111555,FALSE -5420000,6480000,경상남도,고성군,38.36275363,128.4111555,FALSE +4181000,6530000,강원특별자치도,춘천시,37.88979679,127.7398684,FALSE +4180000,6530000,강원도,춘천시,37.88979679,127.7398684,FALSE +4191000,6530000,강원특별자치도,원주시,37.30822288,127.9295253,FALSE +4190000,6530000,강원도,원주시,37.30822288,127.9295253,FALSE +4201000,6530000,강원특별자치도,강릉시,37.70910197,128.8323789,FALSE +4200000,6530000,강원도,강릉시,37.70910197,128.8323789,FALSE +4211000,6530000,강원특별자치도,동해시,37.5066814,129.0555688,FALSE +4210000,6530000,강원도,동해시,37.5066814,129.0555688,FALSE +4221000,6530000,강원특별자치도,태백시,37.17231241,128.9800726,FALSE +4220000,6530000,강원도,태백시,37.17231241,128.9800726,FALSE +4231000,6530000,강원특별자치도,속초시,38.17603138,128.519541,FALSE +4230000,6530000,강원도,속초시,38.17603138,128.519541,FALSE +4241000,6530000,강원특별자치도,삼척시,37.27748089,129.12171,FALSE +4240000,6530000,강원도,삼척시,37.27748089,129.12171,FALSE +4251000,6530000,강원특별자치도,홍천군,37.74504907,128.0742609,FALSE +4250000,6530000,강원도,홍천군,37.74504907,128.0742609,FALSE +4261000,6530000,강원특별자치도,횡성군,37.50914207,128.0770674,FALSE +4260000,6530000,강원도,횡성군,37.50914207,128.0770674,FALSE +4271000,6530000,강원특별자치도,영월군,37.20411361,128.500296,FALSE +4270000,6530000,강원도,영월군,37.20411361,128.500296,FALSE +4281000,6530000,강원특별자치도,평창군,37.55683921,128.48259,FALSE +4280000,6530000,강원도,평창군,37.55683921,128.48259,FALSE +4291000,6530000,강원특별자치도,정선군,37.37868629,128.7390632,FALSE +4290000,6530000,강원도,정선군,37.37868629,128.7390632,FALSE +4301000,6530000,강원특별자치도,철원군,38.23908523,127.3989244,FALSE +4300000,6530000,강원도,철원군,38.23908523,127.3989244,FALSE +4311000,6530000,강원특별자치도,화천군,38.13842628,127.6851657,FALSE +4310000,6530000,강원도,화천군,38.13842628,127.6851657,FALSE +4321000,6530000,강원특별자치도,양구군,38.17560879,128.0002064,FALSE +4320000,6530000,강원도,양구군,38.17560879,128.0002064,FALSE +4331000,6530000,강원특별자치도,인제군,38.06460026,128.2647272,FALSE +4330000,6530000,강원도,인제군,38.06460026,128.2647272,FALSE +4341000,6530000,강원특별자치도,고성군,38.36275363,128.4111555,FALSE +4340000,6530000,강원도,고성군,38.36275363,128.4111555,FALSE 5420000,6480000,경상남도,고성군,35.01630447,128.2906632,FALSE 5720000,6430000,충청북도,청주시 상당구,36.59211242,127.5848802,FALSE -4370000,4360000,충청북도,청주시 상당구,36.59211242,127.5848802,FALSE +4370000,6430000,충청북도,청주시 상당구,36.59211242,127.5848802,FALSE 5725000,6430000,충청북도,청주시 서원구,36.54726305,127.4384007,FALSE 5730000,6430000,충청북도,청주시 흥덕구,36.64696076,127.3692749,FALSE -4380000,4360000,충청북도,청주시 흥덕구,36.64696076,127.3692749,FALSE +4380000,6430000,충청북도,청주시 흥덕구,36.64696076,127.3692749,FALSE 5735000,6430000,충청북도,청주시 청원구,36.72057891,127.4913176,FALSE 4390000,6430000,충청북도,충주시,37.01519694,127.8956623,FALSE 4400000,6430000,충청북도,제천시,37.05991183,128.1409593,FALSE @@ -286,8 +171,8 @@ 4470000,6430000,충청북도,음성군,36.97622261,127.6142068,FALSE 4480000,6430000,충청북도,단양군,36.99445276,128.3878416,FALSE 4490000,6440000,충청남도,천안시,36.76411722,127.2208946,FALSE -5650000,4490000,충청남도,천안시 동남구,36.76411722,127.2208946,FALSE -5660000,4490000,충청남도,천안시 서북구,36.89271067,127.1618094,FALSE +5650000,6440000,충청남도,천안시 동남구,36.76411722,127.2208946,FALSE +5660000,6440000,충청남도,천안시 서북구,36.89271067,127.1618094,FALSE 4500000,6440000,충청남도,공주시,36.47981976,127.0752191,FALSE 4510000,6440000,충청남도,보령시,36.34024523,126.594247,FALSE 4520000,6440000,충청남도,아산시,36.80731633,126.9800756,FALSE @@ -302,38 +187,38 @@ 4600000,6440000,충청남도,홍성군,36.57009431,126.6258536,FALSE 4610000,6440000,충청남도,예산군,36.67062867,126.7843109,FALSE 4620000,6440000,충청남도,태안군,36.7036613,126.2809571,FALSE -4641000,4640000,전북특별자치도,전주시,35.79209428,127.1195036,FALSE -4640000,4640000,전라북도,전주시,35.79209428,127.1195036,FALSE -4651000,4650000,전북특별자치도,전주시 완산구,35.79209428,127.1195036,FALSE -4650000,4650000,전라북도,전주시 완산구,35.79209428,127.1195036,FALSE -4661000,4660000,전북특별자치도,전주시 덕진구,35.85870118,127.1129157,FALSE -4660000,4660000,전라북도,전주시 덕진구,35.85870118,127.1129157,FALSE -4671000,4670000,전북특별자치도,군산시,35.95043894,126.7260152,FALSE -4670000,4670000,전라북도,군산시,35.95043894,126.7260152,FALSE -4681000,4680000,전북특별자치도,익산시,36.02310555,126.9895102,FALSE -4680000,4680000,전라북도,익산시,36.02310555,126.9895102,FALSE -4691000,4690000,전북특별자치도,정읍시,35.60262466,126.9058575,FALSE -4690000,4690000,전라북도,정읍시,35.60262466,126.9058575,FALSE -4701000,4700000,전북특별자치도,남원시,35.4225448,127.4418897,FALSE -4700000,4700000,전라북도,남원시,35.4225448,127.4418897,FALSE -4711000,4710000,전북특별자치도,김제시,35.80671644,126.8948857,FALSE -4710000,4710000,전라북도,김제시,35.80671644,126.8948857,FALSE -4721000,4720000,전북특별자치도,완주군,35.91861444,127.2151146,FALSE -4720000,4720000,전라북도,완주군,35.91861444,127.2151146,FALSE -4731000,4730000,전북특별자치도,진안군,35.82880745,127.4300354,FALSE -4730000,4730000,전라북도,진안군,35.82880745,127.4300354,FALSE -4741000,4740000,전북특별자치도,무주군,35.93936736,127.7129531,FALSE -4740000,4740000,전라북도,무주군,35.93936736,127.7129531,FALSE -4751000,4750000,전북특별자치도,장수군,35.65746098,127.5442641,FALSE -4750000,4750000,전라북도,장수군,35.65746098,127.5442641,FALSE -4761000,4760000,전북특별자치도,임실군,35.59820204,127.2366472,FALSE -4760000,4760000,전라북도,임실군,35.59820204,127.2366472,FALSE -4771000,4770000,전북특별자치도,순창군,35.4336343,127.090087,FALSE -4770000,4770000,전라북도,순창군,35.4336343,127.090087,FALSE -4781000,4780000,전북특별자치도,고창군,35.44816757,126.6160462,FALSE -4780000,4780000,전라북도,고창군,35.44816757,126.6160462,FALSE -4791000,4790000,전북특별자치도,부안군,35.6779229,126.6443774,FALSE -4790000,4790000,전라북도,부안군,35.6779229,126.6443774,FALSE +4641000,6540000,전북특별자치도,전주시,35.79209428,127.1195036,FALSE +4640000,6540000,전라북도,전주시,35.79209428,127.1195036,FALSE +4651000,6540000,전북특별자치도,전주시 완산구,35.79209428,127.1195036,FALSE +4650000,6540000,전라북도,전주시 완산구,35.79209428,127.1195036,FALSE +4661000,6540000,전북특별자치도,전주시 덕진구,35.85870118,127.1129157,FALSE +4660000,6540000,전라북도,전주시 덕진구,35.85870118,127.1129157,FALSE +4671000,6540000,전북특별자치도,군산시,35.95043894,126.7260152,FALSE +4670000,6540000,전라북도,군산시,35.95043894,126.7260152,FALSE +4681000,6540000,전북특별자치도,익산시,36.02310555,126.9895102,FALSE +4680000,6540000,전라북도,익산시,36.02310555,126.9895102,FALSE +4691000,6540000,전북특별자치도,정읍시,35.60262466,126.9058575,FALSE +4690000,6540000,전라북도,정읍시,35.60262466,126.9058575,FALSE +4701000,6540000,전북특별자치도,남원시,35.4225448,127.4418897,FALSE +4700000,6540000,전라북도,남원시,35.4225448,127.4418897,FALSE +4711000,6540000,전북특별자치도,김제시,35.80671644,126.8948857,FALSE +4710000,6540000,전라북도,김제시,35.80671644,126.8948857,FALSE +4721000,6540000,전북특별자치도,완주군,35.91861444,127.2151146,FALSE +4720000,6540000,전라북도,완주군,35.91861444,127.2151146,FALSE +4731000,6540000,전북특별자치도,진안군,35.82880745,127.4300354,FALSE +4730000,6540000,전라북도,진안군,35.82880745,127.4300354,FALSE +4741000,6540000,전북특별자치도,무주군,35.93936736,127.7129531,FALSE +4740000,6540000,전라북도,무주군,35.93936736,127.7129531,FALSE +4751000,6540000,전북특별자치도,장수군,35.65746098,127.5442641,FALSE +4750000,6540000,전라북도,장수군,35.65746098,127.5442641,FALSE +4761000,6540000,전북특별자치도,임실군,35.59820204,127.2366472,FALSE +4760000,6540000,전라북도,임실군,35.59820204,127.2366472,FALSE +4771000,6540000,전북특별자치도,순창군,35.4336343,127.090087,FALSE +4770000,6540000,전라북도,순창군,35.4336343,127.090087,FALSE +4781000,6540000,전북특별자치도,고창군,35.44816757,126.6160462,FALSE +4780000,6540000,전라북도,고창군,35.44816757,126.6160462,FALSE +4791000,6540000,전북특별자치도,부안군,35.6779229,126.6443774,FALSE +4790000,6540000,전라북도,부안군,35.6779229,126.6443774,FALSE 4800000,6460000,전라남도,목포시,34.80376416,126.3918353,FALSE 4810000,6460000,전라남도,여수시,34.69617175,127.6532031,FALSE 4820000,6460000,전라남도,순천시,34.99474506,127.3891627,FALSE @@ -356,9 +241,9 @@ 4990000,6460000,전라남도,완도군,34.29557933,126.7768069,FALSE 5000000,6460000,전라남도,진도군,34.43939638,126.2150578,FALSE 5010000,6460000,전라남도,신안군,34.81240654,126.048907,FALSE -5020000,5020000,경상북도,포항시,35.95813526,129.4376545,TRUE -5030000,5020000,경상북도,포항시 남구,35.95813526,129.4376545,FALSE -5040000,5020000,경상북도,포항시 북구,36.16507327,129.234009,FALSE +5020000,6470000,경상북도,포항시,35.95813526,129.4376545,FALSE +5030000,6470000,경상북도,포항시 남구,35.95813526,129.4376545,FALSE +5040000,6470000,경상북도,포항시 북구,36.16507327,129.234009,FALSE 5050000,6470000,경상북도,경주시,35.8266428,129.2359296,FALSE 5060000,6470000,경상북도,김천시,36.06042386,128.0777075,FALSE 5070000,6470000,경상북도,안동시,36.58024221,128.7800427,FALSE @@ -382,12 +267,12 @@ 5240000,6470000,경상북도,봉화군,36.93414016,128.9129004,FALSE 5250000,6470000,경상북도,울진군,36.90391313,129.3123186,FALSE 5260000,6470000,경상북도,울릉군,37.50194192,130.864243,FALSE -5670000,5670000,경상남도,창원시,35.30894896,128.6495884,TRUE -5670123,5670000,경상남도,창원시 의창구,35.30894896,128.6495884,FALSE -5670140,5670000,경상남도,창원시 성산구,35.19618568,128.6721044,FALSE -5670156,5670000,경상남도,창원시 마산합포구,35.13545806,128.4852558,FALSE -5670184,5670000,경상남도,창원시 마산회원구,35.23222659,128.5364332,FALSE -5670206,5670000,경상남도,창원시 진해구,35.12994945,128.7363008,FALSE +5670000,6480000,경상남도,창원시,35.30894896,128.6495884,FALSE +5670123,6480000,경상남도,창원시 의창구,35.30894896,128.6495884,FALSE +5670140,6480000,경상남도,창원시 성산구,35.19618568,128.6721044,FALSE +5670156,6480000,경상남도,창원시 마산합포구,35.13545806,128.4852558,FALSE +5670184,6480000,경상남도,창원시 마산회원구,35.23222659,128.5364332,FALSE +5670206,6480000,경상남도,창원시 진해구,35.12994945,128.7363008,FALSE 5310000,6480000,경상남도,진주시,35.20515765,128.1298011,FALSE 5330000,6480000,경상남도,통영시,34.82932843,128.3740775,FALSE 5340000,6480000,경상남도,사천시,35.04970341,128.0376963,FALSE @@ -404,10 +289,11 @@ 5460000,6480000,경상남도,함양군,35.55160171,127.7220411,FALSE 5470000,6480000,경상남도,거창군,35.73255219,127.9041696,FALSE 5480000,6480000,경상남도,합천군,35.57657745,128.1415437,FALSE -5490000,6490000,제주도,제주시,33.44220188,126.5292476,FALSE +5490000,6500000,제주도,제주시,33.44220188,126.5292476,FALSE 6510000,6500000,제주특별자치도,제주시,33.44220188,126.5292476,FALSE -5500000,6490000,제주도,서귀포시,33.32504027,126.5810857,FALSE +5500000,6500000,제주도,서귀포시,33.32504027,126.5810857,FALSE 6520000,6500000,제주특별자치도,서귀포시,33.32504027,126.5810857,FALSE +5690000,5690000,세종특별자치시,세종특별자치시,36.56072897,127.258722,FALSE 6530000,6530000,강원특별자치도,강원특별자치도,37.71904264,128.3008969,TRUE 6410000,6410000,경기도,경기도,37.53434923,127.1810501,TRUE 6480000,6480000,경상남도,경상남도,35.32449891,128.2611748,TRUE @@ -422,7 +308,6 @@ 6280000,6280000,인천광역시,인천광역시,37.58457102,126.3755151,TRUE 6460000,6460000,전라남도,전라남도,34.87817002,126.9052332,TRUE 6540000,6540000,전북특별자치도,전북특별자치도,35.71581062,127.1427384,TRUE -6490000,6490000,제주도,제주도,33.38699923,126.5538395,TRUE 6500000,6500000,제주특별자치도,제주특별자치도,33.38699923,126.5538395,TRUE 6440000,6440000,충청남도,충청남도,36.52940199,126.8497393,TRUE 6430000,6430000,충청북도,충청북도,36.73877678,127.8313457,TRUE \ No newline at end of file From 22d9d6c1cf9e64b5e417e45cec63f4c7aef7e452 Mon Sep 17 00:00:00 2001 From: Awhn Date: Mon, 11 Nov 2024 22:18:53 +0900 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20=EC=84=B1=EB=82=A8=EC=8B=9C,=20?= =?UTF-8?q?=EA=B3=A0=EC=96=91=EC=8B=9C=EC=97=90=20=EB=8C=80=ED=95=B4?= =?UTF-8?q?=EC=84=9C=20=ED=95=98=EC=9C=84=20=EC=9E=90=EC=B9=98=EB=8B=A8?= =?UTF-8?q?=EC=B2=B4=EB=A5=BC=20=EC=B6=94=EA=B0=80=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/district_and_coordinate_kr.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/district_and_coordinate_kr.csv b/src/main/resources/district_and_coordinate_kr.csv index 352eb5a..0693937 100644 --- a/src/main/resources/district_and_coordinate_kr.csv +++ b/src/main/resources/district_and_coordinate_kr.csv @@ -78,6 +78,7 @@ 3760000,6410000,경기도,수원시 권선구,37.26053016,126.9797438,FALSE 3770000,6410000,경기도,수원시 팔달구,37.27746363,127.0162387,FALSE 5610000,6410000,경기도,수원시 영통구,37.27499039,127.0566989,FALSE +3790000,6410000,경기도,성남시,37.42000600,127.12581800,FALSE 3790000,6410000,경기도,성남시 수정구,37.43516624,127.1041452,FALSE 3800000,6410000,경기도,성남시 중원구,37.43343323,127.1639099,FALSE 3810000,6410000,경기도,성남시 분당구,37.37930157,127.106064,FALSE @@ -91,6 +92,7 @@ 3920000,6410000,경기도,동두천시,37.91653761,127.0779127,FALSE 5550000,6410000,경기도,안산시 상록구,37.31600383,126.870815,FALSE 5560000,6410000,경기도,안산시 단원구,37.28192491,126.6940412,FALSE +3960000,6410000,경기도,고양시,37.65790200,126.83248100,FALSE 3960000,6410000,경기도,고양시 일산구,37.67986514,126.7975582,FALSE 3950000,6410000,경기도,고양시 덕양구,37.65580987,126.8786321,FALSE 3960100,6410000,경기도,고양시 일산동구,37.67986514,126.7975582,FALSE From ab8d951f44f01fdcc1569bcafa361d405469fb9c Mon Sep 17 00:00:00 2001 From: Awhn Date: Mon, 11 Nov 2024 22:22:10 +0900 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=EA=B8=B0=EA=B4=80=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EC=8B=9C=20=EC=A3=BC=EC=86=8C=EB=A5=BC=20=EC=A2=8C?= =?UTF-8?q?=ED=91=9C=EA=B0=92=EC=9D=84=20=ED=86=B5=ED=95=B4=20=EC=96=BB?= =?UTF-8?q?=EB=8A=94=20=EB=A1=9C=EC=A7=81=20=EB=8B=A4=EC=8B=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gamsa/dataupdate/service/ActivityDataUpdateService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gamsa/dataupdate/service/ActivityDataUpdateService.java b/src/main/java/com/gamsa/dataupdate/service/ActivityDataUpdateService.java index ff4e00b..4bfda00 100644 --- a/src/main/java/com/gamsa/dataupdate/service/ActivityDataUpdateService.java +++ b/src/main/java/com/gamsa/dataupdate/service/ActivityDataUpdateService.java @@ -47,7 +47,8 @@ public void saveInstitute(String programNo) { try { var instituteApiResponse = activityDataUtils.getInstituteApiResponse(programNo); InstituteSaveRequest saveRequest = instituteApiResponse.toSaveRequest( - districtService.findCoordinates(instituteApiResponse.getSidoGunguCode())); + kakaoLocalUtils.getCoordinateByAddress(instituteApiResponse.getLocation()).orElse( + districtService.findCoordinates(instituteApiResponse.getSidoGunguCode()))); instituteService.save(saveRequest); } catch (Exception e) { log.warn("Failed to save institute for program number {}: {}", programNo, e.getMessage()); From a5d4ddefc17567b9b84488518beb4a3afbda1014 Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 00:49:16 +0900 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=ED=99=9C=EB=8F=99=20=EA=B8=B0?= =?UTF-8?q?=EA=B4=80=20=EC=83=81=EC=84=B8=20=EC=A0=95=EB=B3=B4=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=20=EC=8B=9C=20=EB=B0=9C=EC=83=9D=ED=95=A0=20=EC=88=98?= =?UTF-8?q?=20=EC=9E=88=EB=8A=94=20=EC=A7=81=EB=A0=AC=ED=99=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit map -> reviewresponse) --- .../activity/dto/ActivityDetailResponse.java | 4 ++-- .../activity/dto/InstituteDetailResponse.java | 16 ++++++++++++---- .../gamsa/activity/service/ActivityService.java | 10 +++------- .../com/gamsa/review/dto/QuestionResponse.java | 6 +++--- .../gamsa/review/service/QuestionService.java | 11 ++++++++--- 5 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/gamsa/activity/dto/ActivityDetailResponse.java b/src/main/java/com/gamsa/activity/dto/ActivityDetailResponse.java index 7b6f8f9..c44f92d 100644 --- a/src/main/java/com/gamsa/activity/dto/ActivityDetailResponse.java +++ b/src/main/java/com/gamsa/activity/dto/ActivityDetailResponse.java @@ -3,7 +3,7 @@ import com.gamsa.activity.constant.Category; import com.gamsa.activity.domain.Activity; -import com.gamsa.review.dto.QuestionResponse; +import com.gamsa.review.domain.Question; import lombok.Builder; import lombok.Getter; import lombok.RequiredArgsConstructor; @@ -41,7 +41,7 @@ public class ActivityDetailResponse { private final InstituteDetailResponse institute; private final DistrictDetailResponse sidoGungu; - public static ActivityDetailResponse from(Activity activity, Map scores) { + public static ActivityDetailResponse from(Activity activity, Map scores) { return ActivityDetailResponse.builder() .actId(activity.getActId()) .actTitle(activity.getActTitle()) diff --git a/src/main/java/com/gamsa/activity/dto/InstituteDetailResponse.java b/src/main/java/com/gamsa/activity/dto/InstituteDetailResponse.java index cc3d139..77ddd8c 100644 --- a/src/main/java/com/gamsa/activity/dto/InstituteDetailResponse.java +++ b/src/main/java/com/gamsa/activity/dto/InstituteDetailResponse.java @@ -1,13 +1,16 @@ package com.gamsa.activity.dto; import com.gamsa.activity.domain.Institute; -import com.gamsa.review.dto.QuestionResponse; +import com.gamsa.review.domain.Question; +import com.gamsa.review.dto.ReviewResponse; import lombok.Builder; import lombok.Getter; import lombok.RequiredArgsConstructor; import java.math.BigDecimal; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Getter @Builder @@ -20,9 +23,14 @@ public class InstituteDetailResponse { private final BigDecimal latitude; private final BigDecimal longitude; private final String phone; - private final Map scores; + private final List scores; + + public static InstituteDetailResponse from(Institute institute, Map scores) { + List reviewResponses = scores.entrySet().stream() + .map(entry -> ReviewResponse.from(entry.getKey(), entry.getValue())) + .collect(Collectors.toList()); + - public static InstituteDetailResponse from(Institute institute, Map scores) { return InstituteDetailResponse.builder() .instituteId(institute.getInstituteId()) .name(institute.getName()) @@ -30,7 +38,7 @@ public static InstituteDetailResponse from(Institute institute, Map new ActivityException(ActivityErrorCode.ACTIVITY_NOT_EXISTS)); - Map scores = new HashMap<>(); + Map scores = new HashMap<>(); long instituteId = activity.getInstitute().getInstituteId(); - questionService.findAllResponse().forEach(question -> { + questionService.findAll().forEach(question -> { BigDecimal score = reviewService.getAverageScore(instituteId, question.getQuestionId()); scores.put(question, score); }); diff --git a/src/main/java/com/gamsa/review/dto/QuestionResponse.java b/src/main/java/com/gamsa/review/dto/QuestionResponse.java index a56fb82..e355fd5 100644 --- a/src/main/java/com/gamsa/review/dto/QuestionResponse.java +++ b/src/main/java/com/gamsa/review/dto/QuestionResponse.java @@ -13,8 +13,8 @@ public class QuestionResponse { public static QuestionResponse from(Question question) { return QuestionResponse.builder() - .questionId(question.getQuestionId()) - .content(question.getContent()) - .build(); + .questionId(question.getQuestionId()) + .content(question.getContent()) + .build(); } } diff --git a/src/main/java/com/gamsa/review/service/QuestionService.java b/src/main/java/com/gamsa/review/service/QuestionService.java index a9ccda6..c14fb70 100644 --- a/src/main/java/com/gamsa/review/service/QuestionService.java +++ b/src/main/java/com/gamsa/review/service/QuestionService.java @@ -1,11 +1,13 @@ package com.gamsa.review.service; +import com.gamsa.review.domain.Question; import com.gamsa.review.dto.QuestionResponse; import com.gamsa.review.repository.QuestionRepository; -import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; + @RequiredArgsConstructor @Service public class QuestionService { @@ -14,8 +16,11 @@ public class QuestionService { public List findAllResponse() { return questionRepository.findAllQuestion().stream() - .map(QuestionResponse::from) - .toList(); + .map(QuestionResponse::from) + .toList(); } + public List findAll() { + return questionRepository.findAllQuestion(); + } } From 7f2096834afc4e437b4a4f34134882150cb4eb46 Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 00:50:01 +0900 Subject: [PATCH 05/11] =?UTF-8?q?fix:=20=ED=99=9C=EB=8F=99=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A0=95=EB=B3=B4=20=EC=88=98=EC=A0=95=20=EC=8B=9C?= =?UTF-8?q?=20=EC=9C=84=EA=B2=BD=EB=8F=84=20=EB=B0=94=EB=80=90=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gamsa/dataupdate/utils/ActivityDataUtils.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java b/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java index 0b3fdef..a5ebaa0 100644 --- a/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java +++ b/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java @@ -7,11 +7,6 @@ import com.gamsa.activity.dto.InstituteApiResponse; import com.gamsa.dataupdate.DataUpdateErrorCode; import com.gamsa.dataupdate.DataUpdateException; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -20,6 +15,12 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.List; + @Slf4j @Component @RequiredArgsConstructor @@ -158,8 +159,8 @@ public ActivitySaveRequest getVolunteerDetail(String programNo) { .actEndTime(item.path("actEndTm").asInt()) .recruitTotalNum(item.path("rcritNmpr").asInt()) .actLocation(item.path("areaAddress1").asText()) - .longitude(new BigDecimal(item.path("areaLalo1").asText().split(",")[0])) - .latitude(new BigDecimal(item.path("areaLalo1").asText().split(",")[1])) + .latitude(new BigDecimal(item.path("areaLalo1").asText().split(",")[0])) + .longitude(new BigDecimal(item.path("areaLalo1").asText().split(",")[1])) .adultPossible(item.path("adultPosblAt").asText("").equals("Y")) .teenPossible(item.path("yngbgsPosblAt").asText("").equals("Y")) .groupPossible(item.path("grpPosblAt").asText("").equals("Y")).actWeek(item.path("actWkdy").asInt()) From cc6a7eba36fc0449895be7033a8b9750f4af19ea Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 00:55:37 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20=ED=99=9C=EB=8F=99=20=EA=B8=B0?= =?UTF-8?q?=EB=A1=9D=20=EB=B0=98=ED=99=98=20=EC=8B=9C=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EB=8C=80=EC=8B=A0=20=EC=9D=BC=EB=B6=80?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=EB=A7=8C=20=EC=A0=9C=EA=B3=B5.=20Review?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=ED=99=95=EC=9D=B8=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../history/dto/HistoryFindSliceResponse.java | 12 ++-- .../gamsa/history/service/HistoryService.java | 20 +------ .../review/controller/ReviewController.java | 16 +++-- .../repository/ReviewJpaRepository.java | 4 +- .../review/repository/ReviewRepository.java | 5 +- .../repository/ReviewRepositoryImpl.java | 10 +++- .../gamsa/review/service/ReviewService.java | 11 +++- .../activity/service/ActivityServiceTest.java | 60 ++++--------------- ...rviceTest.java => HistoryServiceTest.java} | 22 +------ .../review/stub/StubReviewRepository.java | 7 ++- 10 files changed, 63 insertions(+), 104 deletions(-) rename src/test/java/com/gamsa/history/service/{HitstoryServiceTest.java => HistoryServiceTest.java} (62%) diff --git a/src/main/java/com/gamsa/history/dto/HistoryFindSliceResponse.java b/src/main/java/com/gamsa/history/dto/HistoryFindSliceResponse.java index 9b3c9de..eaeccf6 100644 --- a/src/main/java/com/gamsa/history/dto/HistoryFindSliceResponse.java +++ b/src/main/java/com/gamsa/history/dto/HistoryFindSliceResponse.java @@ -1,16 +1,12 @@ package com.gamsa.history.dto; -import com.gamsa.activity.dto.ActivityDetailResponse; +import com.gamsa.activity.dto.ActivityFindSliceResponse; import com.gamsa.history.constant.ActivityStatus; import com.gamsa.history.domain.History; -import com.gamsa.review.dto.QuestionResponse; import lombok.Builder; import lombok.Getter; import lombok.RequiredArgsConstructor; -import java.math.BigDecimal; -import java.util.Map; - @Getter @Builder @RequiredArgsConstructor @@ -18,17 +14,17 @@ public class HistoryFindSliceResponse { private final long historyId; private final long avatarId; - private final ActivityDetailResponse activity; + private final ActivityFindSliceResponse activity; private final ActivityStatus activityStatus; private final boolean reviewed; - public static HistoryFindSliceResponse from(History history, Map scores) { + public static HistoryFindSliceResponse from(History history) { return HistoryFindSliceResponse.builder() .historyId(history.getHistoryId()) .avatarId(history.getAvatar().getAvatarId()) .activityStatus(history.getActivityStatus()) .reviewed(history.isReviewed()) - .activity(ActivityDetailResponse.from(history.getActivity(), scores)) + .activity(ActivityFindSliceResponse.from(history.getActivity())) .build(); } } diff --git a/src/main/java/com/gamsa/history/service/HistoryService.java b/src/main/java/com/gamsa/history/service/HistoryService.java index 2c0bcf7..f6f4f97 100644 --- a/src/main/java/com/gamsa/history/service/HistoryService.java +++ b/src/main/java/com/gamsa/history/service/HistoryService.java @@ -8,18 +8,12 @@ import com.gamsa.history.dto.HistoryFindSliceResponse; import com.gamsa.history.dto.HistorySaveRequest; import com.gamsa.history.repository.HistoryRepository; -import com.gamsa.review.dto.QuestionResponse; -import com.gamsa.review.service.QuestionService; -import com.gamsa.review.service.ReviewService; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Slice; import org.springframework.stereotype.Service; -import java.math.BigDecimal; import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.Map; import java.util.NoSuchElementException; @RequiredArgsConstructor @@ -28,8 +22,6 @@ public class HistoryService { private final HistoryRepository historyRepository; private final AvatarRepository avatarRepository; private final ActivityRepository activityRepository; - private final QuestionService questionService; - private final ReviewService reviewService; public void save(HistorySaveRequest saveRequest, Long userId) { @@ -49,17 +41,7 @@ public Slice findSliceByAvatarId(Long userId, Pageable .findSliceByAvatarId(avatar.getAvatarId(), pageable); histories.forEach(this::checkDate); - return histories.map(history -> { - Map scores = new HashMap<>(); - long instituteId = history.getActivity().getInstitute().getInstituteId(); - - questionService.findAllResponse().forEach(question -> { - BigDecimal score = reviewService.getAverageScore(instituteId, question.getQuestionId()); - scores.put(question, score); - }); - - return HistoryFindSliceResponse.from(history, scores); - }); + return histories.map(HistoryFindSliceResponse::from); } public void delete(long historyId) { diff --git a/src/main/java/com/gamsa/review/controller/ReviewController.java b/src/main/java/com/gamsa/review/controller/ReviewController.java index d6646c8..1df238c 100644 --- a/src/main/java/com/gamsa/review/controller/ReviewController.java +++ b/src/main/java/com/gamsa/review/controller/ReviewController.java @@ -2,16 +2,16 @@ import com.gamsa.common.utils.ExtractUserIdFromJwt; +import com.gamsa.review.dto.ReviewResponse; import com.gamsa.review.dto.ReviewSaveRequest; import com.gamsa.review.service.ReviewService; import jakarta.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; @RequiredArgsConstructor @RestController @@ -22,10 +22,16 @@ public class ReviewController { @PostMapping public ResponseEntity saveReview(@RequestBody ReviewSaveRequest saveRequest, - HttpServletRequest request) { + HttpServletRequest request) { Long userId = ExtractUserIdFromJwt.extract(request); reviewService.saveReview(userId, saveRequest); return new ResponseEntity<>(HttpStatus.CREATED); } + + @GetMapping("{history-id}") + public List getAllReviews(@PathVariable("history-id") Long historyId) { + + return reviewService.getReview(historyId); + } } diff --git a/src/main/java/com/gamsa/review/repository/ReviewJpaRepository.java b/src/main/java/com/gamsa/review/repository/ReviewJpaRepository.java index a3b0bb2..ac0e8d7 100644 --- a/src/main/java/com/gamsa/review/repository/ReviewJpaRepository.java +++ b/src/main/java/com/gamsa/review/repository/ReviewJpaRepository.java @@ -4,8 +4,10 @@ import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; +import java.util.Optional; public interface ReviewJpaRepository extends JpaRepository { - List findByInstituteInstituteIdAndAnswersQuestionQuestionId(Long instituteId, Long questionId); + List findByInstituteInstituteIdAndAnswersQuestionQuestionId(Long instituteId, int questionId); + Optional findByHistoryHistoryId(long historyHistoryId); } diff --git a/src/main/java/com/gamsa/review/repository/ReviewRepository.java b/src/main/java/com/gamsa/review/repository/ReviewRepository.java index f3e2c88..cf8e495 100644 --- a/src/main/java/com/gamsa/review/repository/ReviewRepository.java +++ b/src/main/java/com/gamsa/review/repository/ReviewRepository.java @@ -3,10 +3,13 @@ import com.gamsa.review.domain.Review; import java.util.List; +import java.util.Optional; public interface ReviewRepository { void save(Review review); - List findReviews(Long instituteId, Long questionId); + List findReviews(Long instituteId, int questionId); + + Optional findHistoryReview(Long historyId); } diff --git a/src/main/java/com/gamsa/review/repository/ReviewRepositoryImpl.java b/src/main/java/com/gamsa/review/repository/ReviewRepositoryImpl.java index 734552e..6b3344e 100644 --- a/src/main/java/com/gamsa/review/repository/ReviewRepositoryImpl.java +++ b/src/main/java/com/gamsa/review/repository/ReviewRepositoryImpl.java @@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository; import java.util.List; +import java.util.Optional; @RequiredArgsConstructor @Repository @@ -18,9 +19,14 @@ public void save(Review review) { } @Override - public List findReviews(Long instituteId, Long questionId) { - return reviewJpaRepository.findByInstituteInstituteIdAndAnswersQuestionQuestionId(instituteId, questionId).stream().map(ReviewJpaEntity::toModel).toList(); + public List findReviews(Long instituteId, int questionId) { + return reviewJpaRepository.findByInstituteInstituteIdAndAnswersQuestionQuestionId(instituteId, questionId).stream() + .map(ReviewJpaEntity::toModel).toList(); } + @Override + public Optional findHistoryReview(Long historyId) { + return reviewJpaRepository.findByHistoryHistoryId(historyId).map(ReviewJpaEntity::toModel); + } } diff --git a/src/main/java/com/gamsa/review/service/ReviewService.java b/src/main/java/com/gamsa/review/service/ReviewService.java index c8e6501..26b315a 100644 --- a/src/main/java/com/gamsa/review/service/ReviewService.java +++ b/src/main/java/com/gamsa/review/service/ReviewService.java @@ -7,6 +7,7 @@ import com.gamsa.review.domain.Answer; import com.gamsa.review.domain.Question; import com.gamsa.review.domain.Review; +import com.gamsa.review.dto.ReviewResponse; import com.gamsa.review.dto.ReviewSaveRequest; import com.gamsa.review.repository.AnswerRepository; import com.gamsa.review.repository.QuestionRepository; @@ -72,7 +73,7 @@ public void saveReview(Long userId, ReviewSaveRequest saveRequest) { answers.forEach(answerRepository::save); } - public BigDecimal getAverageScore(long instituteId, long questionId) { + public BigDecimal getAverageScore(long instituteId, int questionId) { OptionalDouble averageScore = reviewRepository.findReviews(instituteId, questionId) .stream() .flatMap(review -> review.getAnswers().stream()) @@ -86,4 +87,12 @@ public BigDecimal getAverageScore(long instituteId, long questionId) { return BigDecimal.ZERO; } } + + public List getReview(long historyId) { + + return reviewRepository.findHistoryReview(historyId) + .orElseThrow(NoSuchElementException::new) + .getAnswers().stream().map(answer -> ReviewResponse.from(answer.getQuestion(), new BigDecimal(answer.getScore()))) + .toList(); + } } diff --git a/src/test/java/com/gamsa/activity/service/ActivityServiceTest.java b/src/test/java/com/gamsa/activity/service/ActivityServiceTest.java index b8cb43e..ce15081 100644 --- a/src/test/java/com/gamsa/activity/service/ActivityServiceTest.java +++ b/src/test/java/com/gamsa/activity/service/ActivityServiceTest.java @@ -1,17 +1,11 @@ package com.gamsa.activity.service; -import static org.assertj.core.api.Assertions.assertThat; - import com.gamsa.activity.constant.ActivityErrorCode; -import com.gamsa.activity.constant.Category; import com.gamsa.activity.dto.ActivityDetailResponse; import com.gamsa.activity.dto.ActivityFindSliceResponse; -import com.gamsa.activity.dto.ActivitySaveRequest; import com.gamsa.activity.exception.ActivityException; import com.gamsa.activity.stub.StubEmptyActivityRepository; import com.gamsa.activity.stub.StubExistsActivityRepository; -import com.gamsa.activity.stub.StubExistsDistrictRepository; -import com.gamsa.activity.stub.StubExistsInstituteRepository; import com.gamsa.history.stub.StubHistoryRepository; import com.gamsa.review.service.QuestionService; import com.gamsa.review.service.ReviewService; @@ -19,45 +13,21 @@ import com.gamsa.review.stub.StubQuestionRepository; import com.gamsa.review.stub.StubReviewRepository; import com.gamsa.user.stub.StubExistsUserRepository; -import java.time.LocalDateTime; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Slice; +import static org.assertj.core.api.Assertions.assertThat; + class ActivityServiceTest { - ActivitySaveRequest saveRequest = ActivitySaveRequest.builder() - .actId(1L) - .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") - .actLocation("아이사랑꿈터 서구 5호점") - .description("봉사 내용") - .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .noticeEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .actEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartTime(13) - .actEndTime(18) - .recruitTotalNum(1) - .adultPossible(true) - .teenPossible(false) - .groupPossible(false) - .actWeek(0111110) - .actManager("윤순영") - .actPhone("032-577-3026") - .url("https://...") - .category(Category.OTHER_ACTIVITIES) - .instituteName("아이사랑꿈터서구5호점상세정보") - .sidoGunguCode(1) - .build(); @Test void 활동객체_리스트를_반환한다() { // given ActivityService activityService = new ActivityService( new StubEmptyActivityRepository(), - new StubExistsInstituteRepository(), - new StubExistsDistrictRepository(), new QuestionService( new StubQuestionRepository() ), @@ -82,19 +52,17 @@ class ActivityServiceTest { void ID로_활동조회에_성공한다() { // given ActivityService activityService = new ActivityService( - new StubExistsActivityRepository(), - new StubExistsInstituteRepository(), - new StubExistsDistrictRepository(), - new QuestionService( - new StubQuestionRepository() - ), - new ReviewService( - new StubExistsUserRepository(), - new StubQuestionRepository(), - new StubReviewRepository(), - new StubAnswerRepository(), - new StubHistoryRepository() - ) + new StubExistsActivityRepository(), + new QuestionService( + new StubQuestionRepository() + ), + new ReviewService( + new StubExistsUserRepository(), + new StubQuestionRepository(), + new StubReviewRepository(), + new StubAnswerRepository(), + new StubHistoryRepository() + ) ); // when @@ -109,8 +77,6 @@ class ActivityServiceTest { // given ActivityService activityService = new ActivityService( new StubEmptyActivityRepository(), - new StubExistsInstituteRepository(), - new StubExistsDistrictRepository(), new QuestionService( new StubQuestionRepository() ), diff --git a/src/test/java/com/gamsa/history/service/HitstoryServiceTest.java b/src/test/java/com/gamsa/history/service/HistoryServiceTest.java similarity index 62% rename from src/test/java/com/gamsa/history/service/HitstoryServiceTest.java rename to src/test/java/com/gamsa/history/service/HistoryServiceTest.java index bd7ab2d..c40fcaf 100644 --- a/src/test/java/com/gamsa/history/service/HitstoryServiceTest.java +++ b/src/test/java/com/gamsa/history/service/HistoryServiceTest.java @@ -4,12 +4,6 @@ import com.gamsa.avatar.stub.StubExistsAvatarRepository; import com.gamsa.history.dto.HistorySaveRequest; import com.gamsa.history.stub.StubHistoryRepository; -import com.gamsa.review.service.QuestionService; -import com.gamsa.review.service.ReviewService; -import com.gamsa.review.stub.StubAnswerRepository; -import com.gamsa.review.stub.StubQuestionRepository; -import com.gamsa.review.stub.StubReviewRepository; -import com.gamsa.user.stub.StubExistsUserRepository; import org.junit.jupiter.api.Test; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; @@ -17,26 +11,16 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -public class HitstoryServiceTest { +public class HistoryServiceTest { HistorySaveRequest historySaveRequest = HistorySaveRequest.builder() .actId(1L) .build(); - ReviewService reviewService = new ReviewService( - new StubExistsUserRepository(), - new StubQuestionRepository(), - new StubReviewRepository(), - new StubAnswerRepository(), - new StubHistoryRepository() - ); - - QuestionService questionService = new QuestionService( - new StubQuestionRepository() - ); HistoryService historyService = new HistoryService(new StubHistoryRepository(), - new StubExistsAvatarRepository(), new StubExistsActivityRepository(), questionService, reviewService); + new StubExistsAvatarRepository(), + new StubExistsActivityRepository()); @Test void 새로운_기록_저장() { diff --git a/src/test/java/com/gamsa/review/stub/StubReviewRepository.java b/src/test/java/com/gamsa/review/stub/StubReviewRepository.java index 464a340..301ea37 100644 --- a/src/test/java/com/gamsa/review/stub/StubReviewRepository.java +++ b/src/test/java/com/gamsa/review/stub/StubReviewRepository.java @@ -16,6 +16,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Optional; public class StubReviewRepository implements ReviewRepository { @@ -101,8 +102,12 @@ public void save(Review review) { } @Override - public List findReviews(Long instituteID, Long questionId) { + public List findReviews(Long instituteID, int questionId) { return List.of(review1); + } + @Override + public Optional findHistoryReview(Long historyId) { + return Optional.of(review1); } } From e885feb1a232a3cb024e984e3866662b6e0010f5 Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 20:51:51 +0900 Subject: [PATCH 07/11] =?UTF-8?q?test:=20=EC=99=B8=EB=B6=80=20API=20Mockin?= =?UTF-8?q?g=EC=9D=84=20=ED=86=B5=ED=95=9C=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=20Mocking=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EB=A5=BC=20=EC=9C=84=ED=95=9C=20RestTemplete=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=EC=84=B1=20=EC=A3=BC=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gamsa/dataupdate/AppConfig.java | 14 ++ .../gamsa/dataupdate/DataUpdateErrorCode.java | 5 - .../dataupdate/utils/ActivityDataUtils.java | 11 +- .../dataupdate/utils/KakaoLocalUtils.java | 58 +++-- .../utils/ActivityDataUtilsTest.java | 233 ++++++++++++++++++ .../dataupdate/utils/KakaoLocalUtilsTest.java | 90 +++++++ 6 files changed, 376 insertions(+), 35 deletions(-) create mode 100644 src/main/java/com/gamsa/dataupdate/AppConfig.java create mode 100644 src/test/java/com/gamsa/dataupdate/utils/ActivityDataUtilsTest.java create mode 100644 src/test/java/com/gamsa/dataupdate/utils/KakaoLocalUtilsTest.java diff --git a/src/main/java/com/gamsa/dataupdate/AppConfig.java b/src/main/java/com/gamsa/dataupdate/AppConfig.java new file mode 100644 index 0000000..43171ae --- /dev/null +++ b/src/main/java/com/gamsa/dataupdate/AppConfig.java @@ -0,0 +1,14 @@ +package com.gamsa.dataupdate; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.client.RestTemplate; + +@Configuration +public class AppConfig { + + @Bean + public RestTemplate restTemplate() { + return new RestTemplate(); + } +} \ No newline at end of file diff --git a/src/main/java/com/gamsa/dataupdate/DataUpdateErrorCode.java b/src/main/java/com/gamsa/dataupdate/DataUpdateErrorCode.java index f24851f..f5e3f79 100644 --- a/src/main/java/com/gamsa/dataupdate/DataUpdateErrorCode.java +++ b/src/main/java/com/gamsa/dataupdate/DataUpdateErrorCode.java @@ -10,11 +10,6 @@ public enum DataUpdateErrorCode { OPENAPI_NOT_RESPOND(504, "Open API가 응답하지 않습니다."), OPENAPI_ERROR(504, "Open API의 반환 값을 처리할 수 없습니다."), - - // 카카오 API 오류 - KAKAOLOCALAPI_NOT_RESPOND(504, "카카오 API가 정상적으로 응답하지 않습니다."), - KAKAOLOCALAPT_ERROR(504, "카카오 API의 반환 값을 처리할 수 없습니다."), - // 내부 처리 오류 INVALID_CSV(500, "주어진 CSV 파일을 처리할 수 없습니다"), INVALID_FILE_SOURCE(500, "주어진 파일 경로가 올바르지 않습니다."); diff --git a/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java b/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java index a5ebaa0..5f634ec 100644 --- a/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java +++ b/src/main/java/com/gamsa/dataupdate/utils/ActivityDataUtils.java @@ -7,7 +7,6 @@ import com.gamsa.activity.dto.InstituteApiResponse; import com.gamsa.dataupdate.DataUpdateErrorCode; import com.gamsa.dataupdate.DataUpdateException; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; @@ -23,18 +22,20 @@ @Slf4j @Component -@RequiredArgsConstructor public class ActivityDataUtils { @Value(value = "${openapi.key}") private String openapiKey; - @Value(value = "${openapi.url}") - private String openapiUrl; + private final String openapiUrl = "http://openapi.1365.go.kr/openapi/service/rest/VolunteerPartcptnService/"; @Value(value = "${openapi.volurl}") private String volUrl; - private final RestTemplate restTemplate = new RestTemplate(); + private final RestTemplate restTemplate; + + public ActivityDataUtils(RestTemplate restTemplate) { + this.restTemplate = restTemplate; + } DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd"); diff --git a/src/main/java/com/gamsa/dataupdate/utils/KakaoLocalUtils.java b/src/main/java/com/gamsa/dataupdate/utils/KakaoLocalUtils.java index fcfad3b..a963182 100644 --- a/src/main/java/com/gamsa/dataupdate/utils/KakaoLocalUtils.java +++ b/src/main/java/com/gamsa/dataupdate/utils/KakaoLocalUtils.java @@ -1,10 +1,5 @@ package com.gamsa.dataupdate.utils; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; @@ -15,6 +10,12 @@ import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + @Slf4j @Component public class KakaoLocalUtils { @@ -22,14 +23,18 @@ public class KakaoLocalUtils { @Value("${kakao.localkey}") private String kakaoKey; - private final RestTemplate restTemplate = new RestTemplate(); + private final RestTemplate restTemplate; + + public KakaoLocalUtils(RestTemplate restTemplate) { + this.restTemplate = restTemplate; + } public Optional> getCoordinateByAddress(String address) { // 요청 URL 생성 String url = UriComponentsBuilder.fromHttpUrl("https://dapi.kakao.com/v2/local/search/address.json") - .queryParam("query", address) - .build() - .toUriString(); + .queryParam("query", address) + .build() + .toUriString(); // 헤더 설정 HttpHeaders headers = new HttpHeaders(); @@ -40,26 +45,29 @@ public Optional> getCoordinateByAddress(String address) ResponseEntity response = restTemplate.exchange( url, HttpMethod.GET, entity, Map.class); - // 응답 처리 - if (response.getStatusCode().is2xxSuccessful()) { - Map result = response.getBody(); - if (result != null && result.containsKey("documents")) { - // 첫 번째 결과의 x, y 좌표 반환 - var documents = (List>) result.get("documents"); - if (!documents.isEmpty()) { - Map firstDoc = documents.getFirst(); - BigDecimal x = new BigDecimal(firstDoc.get("x").toString()); - BigDecimal y = new BigDecimal(firstDoc.get("y").toString()); + try { + // 응답 처리 + if (response.getStatusCode().is2xxSuccessful()) { + + Map result = response.getBody(); + if (result != null && result.containsKey("documents")) { + // 첫 번째 결과의 x, y 좌표 반환 + var documents = (List>) result.get("documents"); + if (!documents.isEmpty()) { + Map firstDoc = documents.getFirst(); + BigDecimal x = new BigDecimal(firstDoc.get("x").toString()); + BigDecimal y = new BigDecimal(firstDoc.get("y").toString()); - Map coordinates = new HashMap<>(); - coordinates.put("longitude", x); - coordinates.put("latitude", y); - return Optional.of(coordinates); + Map coordinates = new HashMap<>(); + coordinates.put("longitude", x); + coordinates.put("latitude", y); + return Optional.of(coordinates); + } } } + } catch (Exception e) { + log.error("API 요청 실패: " + response.getStatusCode() + e.getMessage()); } - - log.error("API 요청 실패: " + response.getStatusCode()); return Optional.empty(); } } diff --git a/src/test/java/com/gamsa/dataupdate/utils/ActivityDataUtilsTest.java b/src/test/java/com/gamsa/dataupdate/utils/ActivityDataUtilsTest.java new file mode 100644 index 0000000..420929a --- /dev/null +++ b/src/test/java/com/gamsa/dataupdate/utils/ActivityDataUtilsTest.java @@ -0,0 +1,233 @@ +package com.gamsa.dataupdate.utils; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.gamsa.activity.dto.ActivitySaveRequest; +import com.gamsa.activity.dto.InstituteApiResponse; +import com.gamsa.dataupdate.DataUpdateErrorCode; +import com.gamsa.dataupdate.DataUpdateException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +import java.time.LocalDate; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +public class ActivityDataUtilsTest { + + @Mock + private RestTemplate restTemplate; + + @InjectMocks + private ActivityDataUtils activityDataUtils; + + private final ObjectMapper objectMapper = new ObjectMapper(); + + @BeforeEach + public void setup() { + MockitoAnnotations.openMocks(this); + } + + @Test + public void 목록_조회_성공() throws Exception { + String firstResponse = """ + { + "response": { + "body": { + "items": { + "item": [ + { "progrmRegistNo": "12345" }, + { "progrmRegistNo": "67890" } + ] + } + } + } + } + """; + String secondResponse = """ + { + "response": { + "body": { + "items": { + "item": [ + ] + } + } + } + } + """; + + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(firstResponse, HttpStatus.OK)) + .thenReturn(new ResponseEntity<>(secondResponse, HttpStatus.OK)) + ; + + List result = activityDataUtils.getVolunteerParticipationList( + LocalDate.of(2024, 1, 1), LocalDate.of(2024, 12, 31)); + + assertEquals(2, result.size()); + assertTrue(result.contains("12345")); + assertTrue(result.contains("67890")); + } + + @Test + public void 목록_조회_실패() { + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); + + assertThrows(DataUpdateException.class, () -> + activityDataUtils.getVolunteerParticipationList(LocalDate.of(2024, 1, 1), LocalDate.of(2024, 12, 31)), + DataUpdateErrorCode.OPENAPI_NOT_RESPOND.name() + ); + } + + @Test + public void 기관_조회_성공() throws Exception { + //given + String mockResponse = """ + {"response": { + "body": { + "items": { + "item": { + "actBeginTm": 10, + "actEndTm": 11, + "actPlace": "음성효심주간보호 프로그램실", + "actWkdy": 1111111, + "adultPosblAt": "Y", + "appTotal": 0, + "areaAddress1": "충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", + "areaAddress2": "", + "areaAddress3": "", + "areaLalo1": "36.9397922285334,127.686299185056", + "areaLalo2": "", + "areaLalo3": "", + "email": "shon1966@naver.com", + "familyPosblAt": "N", + "fxnum": "0438732338", + "grpPosblAt": "N", + "gugunCd": 4470000, + "mnnstNm": "음성효심주간보호센터", + "nanmmbyNm": "충청북도 음성군", + "nanmmbyNmAdmn": "손덕기", + "noticeBgnde": 20240803, + "noticeEndde": 20241102, + "pbsvntPosblAt": "N", + "postAdres": "충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", + "progrmBgnde": 20240803, + "progrmCn": "-어르신 민요교실 준비\\n-어르신 민요교실 프로그램 진행\\n-어르신 민요교실 마무리", + "progrmEndde": 20241102, + "progrmRegistNo": 3168803, + "progrmSj": "어르신 민요 공연 봉사", + "progrmSttusSe": 2, + "rcritNmpr": 2, + "sidoCd": 6430000, + "srvcClCode": "문화행사 > 공연활동", + "telno": "043-873-2337", + "yngbgsPosblAt": "N" + } + } + } + } + } + """; + + //when + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(mockResponse, HttpStatus.OK)); + + InstituteApiResponse result = activityDataUtils.getInstituteApiResponse("3168803"); + + //then + assertEquals("충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", result.getLocation()); + } + + @Test + public void 기관_조회_실패() { + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); + + assertThrows(DataUpdateException.class, () -> + activityDataUtils.getInstituteApiResponse("12345"), + DataUpdateErrorCode.OPENAPI_NOT_RESPOND.name() + ); + } + + @Test + public void 활동_조회_성공() throws Exception { + String mockResponse = """ + { + "response": { + "body": { + "items": { + "item": { + "actBeginTm": 10, + "actEndTm": 11, + "actPlace": "음성효심주간보호 프로그램실", + "actWkdy": 1111111, + "adultPosblAt": "Y", + "appTotal": 0, + "areaAddress1": "충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", + "areaAddress2": "", + "areaAddress3": "", + "areaLalo1": "36.9397922285334,127.686299185056", + "areaLalo2": "", + "areaLalo3": "", + "email": "shon1966@naver.com", + "familyPosblAt": "N", + "fxnum": "0438732338", + "grpPosblAt": "N", + "gugunCd": 4470000, + "mnnstNm": "음성효심주간보호센터", + "nanmmbyNm": "충청북도 음성군", + "nanmmbyNmAdmn": "손덕기", + "noticeBgnde": 20240803, + "noticeEndde": 20241102, + "pbsvntPosblAt": "N", + "postAdres": "충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", + "progrmBgnde": 20240803, + "progrmCn": "-어르신 민요교실 준비\\n-어르신 민요교실 프로그램 진행\\n-어르신 민요교실 마무리", + "progrmEndde": 20241102, + "progrmRegistNo": 3168803, + "progrmSj": "어르신 민요 공연 봉사", + "progrmSttusSe": 2, + "rcritNmpr": 2, + "sidoCd": 6430000, + "srvcClCode": "문화행사 > 공연활동", + "telno": "043-873-2337", + "yngbgsPosblAt": "N" + } + } + } + } + } + """; + + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(mockResponse, HttpStatus.OK)); + + ActivitySaveRequest result = activityDataUtils.getVolunteerDetail("12345"); + + assertEquals("어르신 민요 공연 봉사", result.getActTitle()); + assertEquals("충청북도 음성군 음성읍 음성천서길 217-1 음성효심주간보호센터", result.getActLocation()); + } + + @Test + public void 활동_조회_실패() { + when(restTemplate.getForEntity(any(String.class), eq(String.class))) + .thenReturn(new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR)); + + assertThrows(DataUpdateException.class, () -> + activityDataUtils.getVolunteerDetail("12345"), + DataUpdateErrorCode.OPENAPI_NOT_RESPOND.name() + ); + } +} diff --git a/src/test/java/com/gamsa/dataupdate/utils/KakaoLocalUtilsTest.java b/src/test/java/com/gamsa/dataupdate/utils/KakaoLocalUtilsTest.java new file mode 100644 index 0000000..5c81e20 --- /dev/null +++ b/src/test/java/com/gamsa/dataupdate/utils/KakaoLocalUtilsTest.java @@ -0,0 +1,90 @@ +package com.gamsa.dataupdate.utils; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +public class KakaoLocalUtilsTest { + + @Mock + private RestTemplate restTemplate; + + @InjectMocks + private KakaoLocalUtils kakaoLocalUtils; + + @BeforeEach + public void setup() { + MockitoAnnotations.openMocks(this); + } + + @Test + public void 좌표_반환_성공() { + //given + String address = "Seoul"; + Map document = new HashMap<>(); + document.put("x", "126.9784"); + document.put("y", "37.5665"); + + Map responseBody = new HashMap<>(); + responseBody.put("documents", List.of(document)); + + ResponseEntity responseEntity = new ResponseEntity<>(responseBody, HttpStatus.OK); + + //when + when(restTemplate.exchange( + any(String.class), + eq(HttpMethod.GET), + any(HttpEntity.class), + eq(Map.class) + )).thenReturn(responseEntity); + + Optional> result = kakaoLocalUtils.getCoordinateByAddress(address); + + //then + assertTrue(result.isPresent()); + + Map coordinates = result.get(); + assertEquals(new BigDecimal("126.9784"), coordinates.get("longitude")); + assertEquals(new BigDecimal("37.5665"), coordinates.get("latitude")); + } + + @Test + public void 좌표_반환_실패() { + //given + String address = "Seoul"; + ResponseEntity responseEntity = new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); + + //when + when(restTemplate.exchange( + any(String.class), + eq(HttpMethod.GET), + any(HttpEntity.class), + eq(Map.class) + )).thenReturn(responseEntity); + + Optional> result = kakaoLocalUtils.getCoordinateByAddress(address); + + //then + assertEquals(Optional.empty(), result); + } + +} From 16dc49447371b5c912e42866580a2a3f59b0b646 Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 21:00:26 +0900 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=EC=A0=80=EC=9E=A5=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=EC=A2=8C=ED=91=9C=EC=9D=98=20=EC=86=8C=EC=88=98?= =?UTF-8?q?=EC=A0=90=20=EC=95=84=EB=9E=98=20=EC=9E=90=EB=A6=BF=EC=88=98=20?= =?UTF-8?q?8=EC=9E=90=EB=A6=AC=EB=A1=9C=20=EC=88=98=EC=A0=95=20=EC=8B=9C?= =?UTF-8?q?=EA=B5=B0=EA=B5=AC=20=EB=8D=B0=EC=9D=B4=ED=84=B0=EC=9D=98=20?= =?UTF-8?q?=EC=A4=91=EC=8B=AC=EC=A0=90=20=EC=A2=8C=ED=91=9C=EC=9D=98=20?= =?UTF-8?q?=EC=A0=95=ED=99=95=EB=8F=84=EC=97=90=20=EB=A7=9E=EC=B6=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gamsa/activity/entity/ActivityJpaEntity.java | 4 ++-- .../java/com/gamsa/activity/entity/DistrictJpaEntity.java | 4 ++-- .../java/com/gamsa/activity/entity/InstituteJpaEntity.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gamsa/activity/entity/ActivityJpaEntity.java b/src/main/java/com/gamsa/activity/entity/ActivityJpaEntity.java index e249a1e..0fef1c2 100644 --- a/src/main/java/com/gamsa/activity/entity/ActivityJpaEntity.java +++ b/src/main/java/com/gamsa/activity/entity/ActivityJpaEntity.java @@ -68,10 +68,10 @@ public class ActivityJpaEntity extends BaseEntity { @Column(name = "online_possible") private boolean onlinePossible; - @Column(name = "latitude") + @Column(name = "latitude", precision = 10, scale = 8) private BigDecimal latitude; - @Column(name = "longitude") + @Column(name = "longitude", precision = 11, scale = 8) private BigDecimal longitude; @Column(name = "act_week") diff --git a/src/main/java/com/gamsa/activity/entity/DistrictJpaEntity.java b/src/main/java/com/gamsa/activity/entity/DistrictJpaEntity.java index 5fe4025..92b5171 100644 --- a/src/main/java/com/gamsa/activity/entity/DistrictJpaEntity.java +++ b/src/main/java/com/gamsa/activity/entity/DistrictJpaEntity.java @@ -25,10 +25,10 @@ public class DistrictJpaEntity extends BaseEntity { @Column(name = "sido_code", nullable = false) private int sidoCode; - @Column(name = "latitude") + @Column(name = "latitude", precision = 10, scale = 8) private BigDecimal latitude; - @Column(name = "longitude") + @Column(name = "longitude", precision = 11, scale = 8) private BigDecimal longitude; @Column(name = "sido_name", length = 15, nullable = false) diff --git a/src/main/java/com/gamsa/activity/entity/InstituteJpaEntity.java b/src/main/java/com/gamsa/activity/entity/InstituteJpaEntity.java index 4436d58..5ab41b0 100644 --- a/src/main/java/com/gamsa/activity/entity/InstituteJpaEntity.java +++ b/src/main/java/com/gamsa/activity/entity/InstituteJpaEntity.java @@ -26,10 +26,10 @@ public class InstituteJpaEntity extends BaseEntity { @Column(name = "location", length = 255) private String location; - @Column(name = "latitude") + @Column(name = "latitude", precision = 10, scale = 8) private BigDecimal latitude; - @Column(name = "longitude") + @Column(name = "longitude", precision = 11, scale = 8) private BigDecimal longitude; @ManyToOne(fetch = FetchType.EAGER) From d9488df738715eac9b97bef084dc25c7148da7a1 Mon Sep 17 00:00:00 2001 From: Awhn <69659322+Awhn@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:37:00 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=EC=9E=90=EB=A6=BF=EC=88=98?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EC=B6=94=EC=96=B4=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/ActivityJpaRepositoryTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java b/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java index ba8de98..199870b 100644 --- a/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java +++ b/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java @@ -41,8 +41,8 @@ class ActivityJpaRepositoryTest { .adultPossible(true) .teenPossible(false) .groupPossible(false) - .latitude(new BigDecimal("126.111111")) - .longitude(new BigDecimal("37.111111")) + .latitude(new BigDecimal("126.11111111")) + .longitude(new BigDecimal("37.11111111")) .actWeek(0111110) .actManager("윤순영") .actPhone("032-577-3026") @@ -65,8 +65,8 @@ class ActivityJpaRepositoryTest { .adultPossible(true) .teenPossible(true) .groupPossible(false) - .latitude(new BigDecimal("127.666666")) - .longitude(new BigDecimal("38.666666")) + .latitude(new BigDecimal("127.66666666")) + .longitude(new BigDecimal("38.66666666")) .actWeek(0111110) .actManager("홀란드") .actPhone("032-111-2222") @@ -89,8 +89,8 @@ class ActivityJpaRepositoryTest { .adultPossible(true) .teenPossible(true) .groupPossible(false) - .latitude(new BigDecimal("128.999999")) - .longitude(new BigDecimal("39.999999")) + .latitude(new BigDecimal("128.99999999")) + .longitude(new BigDecimal("39.99999999")) .actWeek(0111110) .actManager("사서쌤") .actPhone("032-111-2222") @@ -113,7 +113,7 @@ class ActivityJpaRepositoryTest { // distance sorting private final ActivityFindDistanceOrderRequest distanceOrderReq = new ActivityFindDistanceOrderRequest( - new BigDecimal("126.111111"), new BigDecimal("37.111111"), 9999999); + new BigDecimal("126.11111111"), new BigDecimal("37.11111111"), 9999999); @Test void 새_활동_저장() { @@ -276,4 +276,4 @@ class ActivityJpaRepositoryTest { assertThat(content.getFirst().getActId()).isEqualTo(jpaEntity1.getActId()); assertThat(content.getLast().getActId()).isEqualTo(jpaEntity3.getActId()); } -} \ No newline at end of file +} From 354c0f2b70ca64b734fd647ba0f7ed9d0b5f55ba Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 21:48:31 +0900 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=83=81=20=EC=9C=84=EA=B2=BD=EB=8F=84?= =?UTF-8?q?=EA=B0=80=20=EB=B0=98=EB=8C=80=EB=A1=9C=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=EB=90=9C=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/ActivityJpaEntityTest.java | 151 +++++++------- .../entity/InstituteJpaEntityTest.java | 63 +++--- .../repository/ActivityJpaRepositoryTest.java | 191 +++++++++--------- 3 files changed, 204 insertions(+), 201 deletions(-) diff --git a/src/test/java/com/gamsa/activity/entity/ActivityJpaEntityTest.java b/src/test/java/com/gamsa/activity/entity/ActivityJpaEntityTest.java index 3dfe74a..5baabaf 100644 --- a/src/test/java/com/gamsa/activity/entity/ActivityJpaEntityTest.java +++ b/src/test/java/com/gamsa/activity/entity/ActivityJpaEntityTest.java @@ -1,14 +1,15 @@ package com.gamsa.activity.entity; -import static org.assertj.core.api.Assertions.assertThat; - import com.gamsa.activity.constant.Category; import com.gamsa.activity.domain.Activity; import com.gamsa.activity.domain.District; import com.gamsa.activity.domain.Institute; +import org.junit.jupiter.api.Test; + import java.math.BigDecimal; import java.time.LocalDateTime; -import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; class ActivityJpaEntityTest { @@ -16,46 +17,46 @@ class ActivityJpaEntityTest { void 도메인모델에서_JPA엔티티로_변환() { // given District district = District.builder() - .sidoCode(1234) - .sidoGunguCode(8888) - .sidoName("서울특별시") - .gunguName("강남구") - .sido(false) - .build(); + .sidoCode(1234) + .sidoGunguCode(8888) + .sidoName("서울특별시") + .gunguName("강남구") + .sido(false) + .build(); Institute institute = Institute.builder() - .instituteId(1L) - .name("도서관") - .location("서울시") - .latitude(new BigDecimal("123456789.12341234")) - .longitude(new BigDecimal("987654321.43214321")) - .sidoGungu(district) - .phone("010xxxxxxxx") - .build(); + .instituteId(1L) + .name("도서관") + .location("서울시") + .latitude(new BigDecimal("37.56100278")) + .longitude(new BigDecimal("126.9996417")) + .sidoGungu(district) + .phone("010xxxxxxxx") + .build(); Activity activity = Activity.builder() - .actId(1L) - .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") - .actLocation("아이사랑꿈터 서구 5호점") - .description("봉사 내용") - .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .noticeEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .actEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartTime(13) - .actEndTime(18) - .recruitTotalNum(1) - .adultPossible(true) - .teenPossible(false) - .groupPossible(false) - .actWeek(0111110) - .actManager("윤순영") - .actPhone("032-577-3026") - .url("https://...") - .category(Category.OTHER_ACTIVITIES) - .institute(institute) - .sidoGungu(district) - .build(); + .actId(1L) + .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") + .actLocation("아이사랑꿈터 서구 5호점") + .description("봉사 내용") + .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .noticeEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) + .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .actEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) + .actStartTime(13) + .actEndTime(18) + .recruitTotalNum(1) + .adultPossible(true) + .teenPossible(false) + .groupPossible(false) + .actWeek(0111110) + .actManager("윤순영") + .actPhone("032-577-3026") + .url("https://...") + .category(Category.OTHER_ACTIVITIES) + .institute(institute) + .sidoGungu(district) + .build(); // when ActivityJpaEntity jpaEntity = ActivityJpaEntity.from(activity); @@ -68,46 +69,46 @@ class ActivityJpaEntityTest { void JPA엔티에서_도메인모델로_변환() { // given DistrictJpaEntity districtJpaEntity = DistrictJpaEntity.builder() - .sidoCode(1234) - .sidoGunguCode(8888) - .sidoName("서울특별시") - .gunguName("강남구") - .sido(false) - .build(); + .sidoCode(1234) + .sidoGunguCode(8888) + .sidoName("서울특별시") + .gunguName("강남구") + .sido(false) + .build(); InstituteJpaEntity institute = InstituteJpaEntity.builder() - .instituteId(1L) - .name("도서관") - .location("서울시") - .latitude(new BigDecimal("123456789.12341234")) - .longitude(new BigDecimal("987654321.43214321")) - .sidoGungu(districtJpaEntity) - .phone("010xxxxxxxx") - .build(); + .instituteId(1L) + .name("도서관") + .location("서울시") + .latitude(new BigDecimal("37.56100278")) + .longitude(new BigDecimal("126.9996417")) + .sidoGungu(districtJpaEntity) + .phone("010xxxxxxxx") + .build(); ActivityJpaEntity jpaEntity = ActivityJpaEntity.builder() - .actId(1L) - .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") - .actLocation("아이사랑꿈터 서구 5호점") - .description("봉사 내용") - .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .noticeEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .actEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) - .actStartTime(13) - .actEndTime(18) - .recruitTotalNum(1) - .adultPossible(true) - .teenPossible(false) - .groupPossible(false) - .actWeek(0111110) - .actManager("윤순영") - .actPhone("032-577-3026") - .url("https://...") - .category(Category.OTHER_ACTIVITIES) - .institute(institute) - .sidoGungu(districtJpaEntity) - .build(); + .actId(1L) + .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") + .actLocation("아이사랑꿈터 서구 5호점") + .description("봉사 내용") + .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .noticeEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) + .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .actEndDate(LocalDateTime.of(2024, 12, 7, 0, 0)) + .actStartTime(13) + .actEndTime(18) + .recruitTotalNum(1) + .adultPossible(true) + .teenPossible(false) + .groupPossible(false) + .actWeek(0111110) + .actManager("윤순영") + .actPhone("032-577-3026") + .url("https://...") + .category(Category.OTHER_ACTIVITIES) + .institute(institute) + .sidoGungu(districtJpaEntity) + .build(); // when Activity activity = jpaEntity.toModel(); diff --git a/src/test/java/com/gamsa/activity/entity/InstituteJpaEntityTest.java b/src/test/java/com/gamsa/activity/entity/InstituteJpaEntityTest.java index 8e10d69..16fb2a6 100644 --- a/src/test/java/com/gamsa/activity/entity/InstituteJpaEntityTest.java +++ b/src/test/java/com/gamsa/activity/entity/InstituteJpaEntityTest.java @@ -1,13 +1,14 @@ package com.gamsa.activity.entity; -import static org.assertj.core.api.Assertions.assertThat; - import com.gamsa.activity.domain.District; import com.gamsa.activity.domain.Institute; -import java.math.BigDecimal; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import java.math.BigDecimal; + +import static org.assertj.core.api.Assertions.assertThat; + class InstituteJpaEntityTest { @@ -16,22 +17,22 @@ class InstituteJpaEntityTest { void changeToJpaEntity() { // given District district = District.builder() - .sidoCode(1234) - .sidoGunguCode(8888) - .sidoName("서울특별시") - .gunguName("강남구") - .sido(false) - .build(); + .sidoCode(1234) + .sidoGunguCode(8888) + .sidoName("서울특별시") + .gunguName("강남구") + .sido(false) + .build(); Institute model = Institute.builder() - .instituteId(1L) - .name("도서관") - .location("서울시") - .latitude(new BigDecimal("123456789.12341234")) - .longitude(new BigDecimal("987654321.43214321")) - .sidoGungu(district) - .phone("010xxxxxxxx") - .build(); + .instituteId(1L) + .name("도서관") + .location("서울시") + .latitude(new BigDecimal("37.56100278")) + .longitude(new BigDecimal("126.9996417")) + .sidoGungu(district) + .phone("010xxxxxxxx") + .build(); // when InstituteJpaEntity jpaEntity = InstituteJpaEntity.from(model); // then @@ -43,22 +44,22 @@ void changeToJpaEntity() { void changeToDomainModel() { // given DistrictJpaEntity districtJpaEntity = DistrictJpaEntity.builder() - .sidoCode(1234) - .sidoGunguCode(8888) - .sidoName("서울특별시") - .gunguName("강남구") - .sido(false) - .build(); + .sidoCode(1234) + .sidoGunguCode(8888) + .sidoName("서울특별시") + .gunguName("강남구") + .sido(false) + .build(); InstituteJpaEntity jpaEntity = InstituteJpaEntity.builder() - .instituteId(1L) - .name("도서관") - .location("서울시") - .latitude(new BigDecimal("123456789.12341234")) - .longitude(new BigDecimal("987654321.43214321")) - .sidoGungu(districtJpaEntity) - .phone("010xxxxxxxx") - .build(); + .instituteId(1L) + .name("도서관") + .location("서울시") + .latitude(new BigDecimal("37.56100278")) + .longitude(new BigDecimal("126.9996417")) + .sidoGungu(districtJpaEntity) + .phone("010xxxxxxxx") + .build(); // when Institute model = jpaEntity.toModel(); // then diff --git a/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java b/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java index 199870b..a41c035 100644 --- a/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java +++ b/src/test/java/com/gamsa/activity/repository/ActivityJpaRepositoryTest.java @@ -1,16 +1,10 @@ package com.gamsa.activity.repository; -import static org.assertj.core.api.Assertions.assertThat; - import com.gamsa.activity.constant.Category; import com.gamsa.activity.dto.ActivityFilterRequest; import com.gamsa.activity.dto.ActivityFindDistanceOrderRequest; import com.gamsa.activity.entity.ActivityJpaEntity; import com.gamsa.common.config.TestConfig; -import java.math.BigDecimal; -import java.time.LocalDateTime; -import java.util.List; -import java.util.Optional; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; @@ -19,6 +13,13 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort.Direction; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.List; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; + @DataJpaTest @Import(TestConfig.class) class ActivityJpaRepositoryTest { @@ -27,93 +28,93 @@ class ActivityJpaRepositoryTest { private ActivityJpaRepository activityJpaRepository; private final ActivityJpaEntity jpaEntity1 = ActivityJpaEntity.builder() - .actId(1L) - .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") - .actLocation("아이사랑꿈터 서구 5호점") - .description("봉사 내용") - .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .noticeEndDate(LocalDateTime.of(2024, 9, 20, 0, 0)) - .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) - .actEndDate(LocalDateTime.of(2024, 9, 20, 0, 0)) - .actStartTime(13) - .actEndTime(18) - .recruitTotalNum(1) - .adultPossible(true) - .teenPossible(false) - .groupPossible(false) - .latitude(new BigDecimal("126.11111111")) - .longitude(new BigDecimal("37.11111111")) - .actWeek(0111110) - .actManager("윤순영") - .actPhone("032-577-3026") - .url("https://...") - .category(Category.OTHER_ACTIVITIES) - .build(); + .actId(1L) + .actTitle("어린이놀이안전관리 및 놀잇감 청결유지 및 정리") + .actLocation("아이사랑꿈터 서구 5호점") + .description("봉사 내용") + .noticeStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .noticeEndDate(LocalDateTime.of(2024, 9, 20, 0, 0)) + .actStartDate(LocalDateTime.of(2024, 9, 10, 0, 0)) + .actEndDate(LocalDateTime.of(2024, 9, 20, 0, 0)) + .actStartTime(13) + .actEndTime(18) + .recruitTotalNum(1) + .adultPossible(true) + .teenPossible(false) + .groupPossible(false) + .longitude(new BigDecimal("126.11111111")) + .latitude(new BigDecimal("37.11111111")) + .actWeek(0111110) + .actManager("윤순영") + .actPhone("032-577-3026") + .url("https://...") + .category(Category.OTHER_ACTIVITIES) + .build(); private final ActivityJpaEntity jpaEntity2 = ActivityJpaEntity.builder() - .actId(2L) - .actTitle("어린이놀이안전관리 청소") - .actLocation("아이사랑꿈터 서구 7호점") - .description("봉사 내용2") - .noticeStartDate(LocalDateTime.of(2024, 11, 1, 0, 0)) - .noticeEndDate(LocalDateTime.of(2024, 12, 8, 0, 0)) - .actStartDate(LocalDateTime.of(2024, 11, 1, 0, 0)) - .actEndDate(LocalDateTime.of(2024, 12, 8, 0, 0)) - .actStartTime(10) - .actEndTime(20) - .recruitTotalNum(2) - .adultPossible(true) - .teenPossible(true) - .groupPossible(false) - .latitude(new BigDecimal("127.66666666")) - .longitude(new BigDecimal("38.66666666")) - .actWeek(0111110) - .actManager("홀란드") - .actPhone("032-111-2222") - .url("https://...") - .category(Category.EDUCATION_AND_MENTORING) - .build(); + .actId(2L) + .actTitle("어린이놀이안전관리 청소") + .actLocation("아이사랑꿈터 서구 7호점") + .description("봉사 내용2") + .noticeStartDate(LocalDateTime.of(2024, 11, 1, 0, 0)) + .noticeEndDate(LocalDateTime.of(2024, 12, 8, 0, 0)) + .actStartDate(LocalDateTime.of(2024, 11, 1, 0, 0)) + .actEndDate(LocalDateTime.of(2024, 12, 8, 0, 0)) + .actStartTime(10) + .actEndTime(20) + .recruitTotalNum(2) + .adultPossible(true) + .teenPossible(true) + .groupPossible(false) + .longitude(new BigDecimal("127.66666666")) + .latitude(new BigDecimal("38.66666666")) + .actWeek(0111110) + .actManager("홀란드") + .actPhone("032-111-2222") + .url("https://...") + .category(Category.EDUCATION_AND_MENTORING) + .build(); private final ActivityJpaEntity jpaEntity3 = ActivityJpaEntity.builder() - .actId(3L) - .actTitle("학교") - .actLocation("도서관") - .description("책 정리") - .noticeStartDate(LocalDateTime.of(2025, 1, 1, 0, 0)) - .noticeEndDate(LocalDateTime.of(2025, 1, 8, 0, 0)) - .actStartDate(LocalDateTime.of(2025, 1, 1, 0, 0)) - .actEndDate(LocalDateTime.of(2025, 1, 8, 0, 0)) - .actStartTime(10) - .actEndTime(20) - .recruitTotalNum(5) - .adultPossible(true) - .teenPossible(true) - .groupPossible(false) - .latitude(new BigDecimal("128.99999999")) - .longitude(new BigDecimal("39.99999999")) - .actWeek(0111110) - .actManager("사서쌤") - .actPhone("032-111-2222") - .url("https://...") - .category(Category.ADMINISTRATIVE_AND_OFFICE_SUPPORT) - .build(); + .actId(3L) + .actTitle("학교") + .actLocation("도서관") + .description("책 정리") + .noticeStartDate(LocalDateTime.of(2025, 1, 1, 0, 0)) + .noticeEndDate(LocalDateTime.of(2025, 1, 8, 0, 0)) + .actStartDate(LocalDateTime.of(2025, 1, 1, 0, 0)) + .actEndDate(LocalDateTime.of(2025, 1, 8, 0, 0)) + .actStartTime(10) + .actEndTime(20) + .recruitTotalNum(5) + .adultPossible(true) + .teenPossible(true) + .groupPossible(false) + .longitude(new BigDecimal("128.99999999")) + .latitude(new BigDecimal("39.99999999")) + .actWeek(0111110) + .actManager("사서쌤") + .actPhone("032-111-2222") + .url("https://...") + .category(Category.ADMINISTRATIVE_AND_OFFICE_SUPPORT) + .build(); // 필터링 private final ActivityFilterRequest noFilterReq = new ActivityFilterRequest( - null, null, null, false, false, null); + null, null, null, false, false, null); private final ActivityFilterRequest otherCategoryFilterReq = new ActivityFilterRequest( - Category.OTHER_ACTIVITIES, null, null, false, false, null); + Category.OTHER_ACTIVITIES, null, null, false, false, null); private final ActivityFilterRequest teenPossibleFilterReq = new ActivityFilterRequest( - null, null, null, true, false, null); + null, null, null, true, false, null); private final ActivityFilterRequest beforeDeadlineFilterReq = new ActivityFilterRequest( - null, null, null, false, true, null); + null, null, null, false, true, null); // distance sorting private final ActivityFindDistanceOrderRequest distanceOrderReq = new ActivityFindDistanceOrderRequest( - new BigDecimal("126.11111111"), new BigDecimal("37.11111111"), 9999999); + new BigDecimal("37.11111111"), new BigDecimal("126.11111111"), 9999999); @Test void 새_활동_저장() { @@ -122,7 +123,7 @@ class ActivityJpaRepositoryTest { // then assertThat(activityJpaRepository.findById(1L).get().getActTitle()) - .isEqualTo(jpaEntity1.getActTitle()); + .isEqualTo(jpaEntity1.getActTitle()); } @Test @@ -131,8 +132,8 @@ class ActivityJpaRepositoryTest { activityJpaRepository.save(jpaEntity1); // when List content = activityJpaRepository - .findSlice(noFilterReq, PageRequest.of(0, 10)) - .getContent(); + .findSlice(noFilterReq, PageRequest.of(0, 10)) + .getContent(); // then assertThat(content.size()).isEqualTo(1); } @@ -156,7 +157,7 @@ class ActivityJpaRepositoryTest { // when List content = activityJpaRepository.findSlice(noFilterReq, pageable) - .getContent(); + .getContent(); // then assertThat(content.size()).isEqualTo(2); @@ -171,18 +172,18 @@ class ActivityJpaRepositoryTest { activityJpaRepository.save(jpaEntity2); activityJpaRepository.save(jpaEntity3); Pageable pageable = PageRequest - .of(0, 3, Direction.ASC, "noticeEndDate"); + .of(0, 3, Direction.ASC, "noticeEndDate"); // when List content = activityJpaRepository.findSlice(noFilterReq, pageable) - .getContent(); + .getContent(); // then assertThat(content.size()).isEqualTo(3); assertThat(content.get(0).getNoticeEndDate().isBefore(content.get(1).getNoticeEndDate())) - .isTrue(); + .isTrue(); assertThat(content.get(1).getNoticeEndDate().isBefore(content.get(2).getNoticeEndDate())) - .isTrue(); + .isTrue(); } @Test @@ -193,20 +194,20 @@ class ActivityJpaRepositoryTest { activityJpaRepository.save(jpaEntity2); activityJpaRepository.save(jpaEntity3); Pageable pageable = PageRequest - .of(0, 3, Direction.ASC, "noticeEndDate"); + .of(0, 3, Direction.ASC, "noticeEndDate"); // when List content1 = activityJpaRepository - .findSlice(noFilterReq, pageable).getContent(); + .findSlice(noFilterReq, pageable).getContent(); List content2 = activityJpaRepository - .findSlice(beforeDeadlineFilterReq, pageable).getContent(); + .findSlice(beforeDeadlineFilterReq, pageable).getContent(); // then assertThat(content1.size()).isEqualTo(3); // 필터링 X assertThat(content2.size()).isEqualTo(2); // 필터링 O assertThat(content2.getFirst().getNoticeEndDate() - .isBefore(content2.getLast().getNoticeEndDate())) - .isTrue(); + .isBefore(content2.getLast().getNoticeEndDate())) + .isTrue(); } @Test @@ -218,7 +219,7 @@ class ActivityJpaRepositoryTest { // when List content = activityJpaRepository.findSlice(otherCategoryFilterReq, - pageable).getContent(); + pageable).getContent(); // then assertThat(content.size()).isEqualTo(1); @@ -234,7 +235,7 @@ class ActivityJpaRepositoryTest { // when List content = activityJpaRepository.findSlice(teenPossibleFilterReq, - pageable).getContent(); + pageable).getContent(); // then assertThat(content.size()).isEqualTo(1); @@ -251,7 +252,7 @@ class ActivityJpaRepositoryTest { // when List content = activityJpaRepository.findSlice(beforeDeadlineFilterReq, - pageable).getContent(); + pageable).getContent(); // then assertThat(content.size()).isEqualTo(1); @@ -268,8 +269,8 @@ class ActivityJpaRepositoryTest { // when List content = activityJpaRepository.findSliceDistanceOrder( - noFilterReq, distanceOrderReq, pageable) - .getContent(); + noFilterReq, distanceOrderReq, pageable) + .getContent(); // then assertThat(content.size()).isEqualTo(3); From db717f4afb0dd3c084b06bffe9d0d957f55360d2 Mon Sep 17 00:00:00 2001 From: Awhn Date: Tue, 12 Nov 2024 21:54:36 +0900 Subject: [PATCH 11/11] =?UTF-8?q?fix:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=83=81=20=EC=9C=84=EA=B2=BD=EB=8F=84?= =?UTF-8?q?=EA=B0=80=20=EB=B0=98=EB=8C=80=EB=A1=9C=20=EC=9E=91=EC=84=B1?= =?UTF-8?q?=EB=90=9C=20=EB=B6=80=EB=B6=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InstituteJpaRepositoryTest.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/gamsa/activity/repository/InstituteJpaRepositoryTest.java b/src/test/java/com/gamsa/activity/repository/InstituteJpaRepositoryTest.java index 45f82c2..0a4c7dd 100644 --- a/src/test/java/com/gamsa/activity/repository/InstituteJpaRepositoryTest.java +++ b/src/test/java/com/gamsa/activity/repository/InstituteJpaRepositoryTest.java @@ -1,16 +1,17 @@ package com.gamsa.activity.repository; -import static org.assertj.core.api.Assertions.assertThat; - import com.gamsa.activity.entity.InstituteJpaEntity; import com.gamsa.common.config.TestConfig; -import java.math.BigDecimal; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.context.annotation.Import; +import java.math.BigDecimal; + +import static org.assertj.core.api.Assertions.assertThat; + @DataJpaTest @Import(TestConfig.class) class InstituteJpaRepositoryTest { @@ -19,13 +20,13 @@ class InstituteJpaRepositoryTest { private InstituteJpaRepository instituteJpaRepository; private final InstituteJpaEntity jpaEntity = InstituteJpaEntity.builder() - .instituteId(1L) - .name("도서관") - .location("서울시") - .latitude(new BigDecimal("123456789.12341234")) - .longitude(new BigDecimal("987654321.43214321")) - .phone("010xxxxxxxx") - .build(); + .instituteId(1L) + .name("도서관") + .location("서울시") + .latitude(new BigDecimal("37.56100278")) + .longitude(new BigDecimal("126.9996417")) + .phone("010xxxxxxxx") + .build(); @Test @DisplayName("새 봉사기관 저장") @@ -34,6 +35,6 @@ void save() { instituteJpaRepository.save(jpaEntity); // then assertThat(instituteJpaRepository.findById(1L).get().getName()) - .isEqualTo(jpaEntity.getName()); + .isEqualTo(jpaEntity.getName()); } } \ No newline at end of file