From 87cfc67e9b6b44f916262f640194f9e764fc3072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B6=98=EC=8B=9D?= <142300831+Choon0414@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:20:56 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20coopshop=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EA=B0=80=20=EC=97=86=EB=8A=94=20=EB=A1=9C=EC=BB=AC=EC=97=90?= =?UTF-8?q?=EC=84=9C=EB=8F=84=20=EB=8F=99=EC=9E=91=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20flyway=20=EC=BF=BC=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/AdminCoopSemesterResponse.java | 14 +-- .../dto/AdminCoopSemestersResponse.java | 20 +++- .../coopshop/dto/CoopShopsResponse.java | 14 +-- .../V77__insert_coop_shop_semester.sql | 100 +++++++++++------- 4 files changed, 96 insertions(+), 52 deletions(-) diff --git a/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemesterResponse.java b/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemesterResponse.java index 5407a9269..047f61c03 100644 --- a/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemesterResponse.java +++ b/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemesterResponse.java @@ -31,6 +31,10 @@ public record AdminCoopSemesterResponse( @JsonFormat(pattern = "yyyy-MM-dd") LocalDate toDate, + @Schema(description = "업데이트 일자", example = "2024-09-01 14:02:48", requiredMode = REQUIRED) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + LocalDateTime updatedAt, + @Schema(description = "생협 매장 정보 리스트", requiredMode = REQUIRED) List coopShops ) { @@ -40,6 +44,7 @@ public static AdminCoopSemesterResponse from(CoopSemester coopSemester) { coopSemester.getSemester(), coopSemester.getFromDate(), coopSemester.getToDate(), + coopSemester.getUpdatedAt(), coopSemester.getCoopShops().stream().map(InnerCoopShop::from).toList() ); } @@ -62,11 +67,7 @@ public record InnerCoopShop( String location, @Schema(example = "공휴일 휴무", description = "생협 매장 특이사항") - String remarks, - - @JsonFormat(pattern = "yyyy-MM-dd") - @Schema(example = "2024-06-26", description = "학식 운영시간 업데이트 날짜", requiredMode = REQUIRED) - LocalDateTime updatedAt + String remarks ) { public static InnerCoopShop from(CoopShop coopShop) { @@ -78,8 +79,7 @@ public static InnerCoopShop from(CoopShop coopShop) { .toList(), coopShop.getPhone(), coopShop.getLocation(), - coopShop.getRemarks(), - coopShop.getUpdatedAt() + coopShop.getRemarks() ); } diff --git a/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemestersResponse.java b/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemestersResponse.java index 939a1b983..79a81475b 100644 --- a/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemestersResponse.java +++ b/src/main/java/in/koreatech/koin/admin/coopShop/dto/AdminCoopSemestersResponse.java @@ -4,10 +4,12 @@ import static io.swagger.v3.oas.annotations.media.Schema.RequiredMode.REQUIRED; import java.time.LocalDate; +import java.time.LocalDateTime; import java.util.List; import org.springframework.data.domain.Page; +import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonNaming; import in.koreatech.koin.domain.coopshop.model.CoopSemester; @@ -35,10 +37,23 @@ public record AdminCoopSemestersResponse( @JsonNaming(value = SnakeCaseStrategy.class) public record InnerSemester( + @Schema(description = "학기 고유 id", example = "1", requiredMode = REQUIRED) Integer id, + + @Schema(description = "학기", example = "24-2학기", requiredMode = REQUIRED) String semester, + + @Schema(description = "학기 기간 시작일", example = "2024-09-02", requiredMode = REQUIRED) + @JsonFormat(pattern = "yyyy-MM-dd") LocalDate fromDate, - LocalDate toDate + + @Schema(description = "학기 기간 마감일", example = "2024-12-20", requiredMode = REQUIRED) + @JsonFormat(pattern = "yyyy-MM-dd") + LocalDate toDate, + + @Schema(description = "업데이트 일자", example = "2024-09-01 14:02:48", requiredMode = REQUIRED) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + LocalDateTime updatedAt ) { public static InnerSemester from(CoopSemester coopSemester) { @@ -46,7 +61,8 @@ public static InnerSemester from(CoopSemester coopSemester) { coopSemester.getId(), coopSemester.getSemester(), coopSemester.getFromDate(), - coopSemester.getToDate() + coopSemester.getToDate(), + coopSemester.getUpdatedAt() ); } } diff --git a/src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java b/src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java index d9a8ad4f2..2c8154ffa 100644 --- a/src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java +++ b/src/main/java/in/koreatech/koin/domain/coopshop/dto/CoopShopsResponse.java @@ -28,6 +28,10 @@ public record CoopShopsResponse( @JsonFormat(pattern = "yyyy-MM-dd") LocalDate toDate, + @Schema(description = "업데이트 일자", example = "2024-09-02 14:02:48", requiredMode = REQUIRED) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + LocalDateTime updatedAt, + @Schema(example = "하계방학", description = "운영 학기", requiredMode = REQUIRED) List coopShops ) { @@ -37,6 +41,7 @@ public static CoopShopsResponse from(CoopSemester coopSemester) { coopSemester.getSemester(), coopSemester.getFromDate(), coopSemester.getToDate(), + coopSemester.getUpdatedAt(), coopSemester.getCoopShops().stream() .map(InnerCoopShop::from) .toList() @@ -61,11 +66,7 @@ public record InnerCoopShop( String location, @Schema(example = "공휴일 휴무", description = "생협 매장 특이사항") - String remarks, - - @JsonFormat(pattern = "yyyy-MM-dd") - @Schema(example = "2024-06-26", description = "학식 운영시간 업데이트 날짜", requiredMode = REQUIRED) - LocalDateTime updatedAt + String remarks ) { public static InnerCoopShop from(CoopShop coopShop) { @@ -77,8 +78,7 @@ public static InnerCoopShop from(CoopShop coopShop) { .toList(), coopShop.getPhone(), coopShop.getLocation(), - coopShop.getRemarks(), - coopShop.getUpdatedAt() + coopShop.getRemarks() ); } diff --git a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql index 4698cb17f..de871c448 100644 --- a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql +++ b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql @@ -1,40 +1,68 @@ +ALTER TABLE coop_semester AUTO_INCREMENT = 1; +ALTER TABLE coop_shop AUTO_INCREMENT = 2; +ALTER TABLE coop_opens AUTO_INCREMENT = 7; + insert into `coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) values ('24-2학기', '2024-09-02', '2024-12-20', 1); INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) - VALUES - ('복지관식당', '041-560-1778', 'NULL', '능수관', 1), - ('대즐', '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', 1), - ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', 1), - ('세탁소', '041-552-1489', '학생회관 2층', 'NULL', 1), - ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', 1), - ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', 1), - ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', 1), - ('오락실', '041-560-1472', '학생회관 1층', 'NULL', 1); - -update `coop_shop` set `semester_id` = 1 where `id` = 1; -update `coop_opens` set `day_of_week` = 'WEEKDAYS' where `id` = 1; -update `coop_opens` set `day_of_week` = 'WEEKDAYS' where `id` = 2; -update `coop_opens` set `day_of_week` = 'WEEKDAYS' where `id` = 3; -update `coop_opens` set `day_of_week` = 'WEEKEND' where `id` = 4; -update `coop_opens` set `day_of_week` = 'WEEKEND' where `id` = 5; -update `coop_opens` set `day_of_week` = 'WEEKEND' where `id` = 6; - -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) - VALUES - (2, '점심', 'WEEKDAYS', '11:40', '13:30'), - (2, '점심', 'WEEKEND', '미운영', '미운영'), - (3, 'NULL', 'WEEKDAYS', '08:30', '21:00'), - (3, 'NULL', 'SATURDAY', '11:00', '18:00'), - (4, 'NULL', 'WEEKDAYS', '09:00', '18:00'), - (4, 'NULL', 'WEEKEND', '휴점', '휴점'), - (5, 'NULL', 'WEEKDAYS', '11:30', '18:00'), - (5, 'NULL', 'WEEKEND', '휴점', '휴점'), - (6, 'NULL', 'WEEKDAYS', '08:30', '18:00'), - (6, 'NULL', 'WEEKEND', '휴점', '휴점'), - (7, 'NULL', 'WEEKDAYS', '24시간', '24시간'), - (7, 'NULL', 'WEEKEND', '24시간', '24시간'), - (8, 'NULL', 'WEEKDAYS', '09:30', '17:00'), - (8, 'NULL', 'WEEKEND', '휴점', '휴점'), - (9, 'NULL', 'WEEKDAYS', '24시간', '24시간'), - (9, 'NULL', 'WEEKEND', '24시간', '24시간'); +VALUES ('복지관식당', '041-560-1778', '복지관 2층', '능수관', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), '점심', 'WEEKDAYS', '11:40', '13:30'), + (last_insert_id(), '점심', 'WEEKEND', '미운영', '미운영'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('대즐', '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '08:30', '21:00'), + (last_insert_id(), NULL, 'SATURDAY', '11:00', '18:00'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '09:00', '18:00'), + (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('세탁소', '041-552-1489', '학생회관 2층', NULL, 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '11:30', '18:00'), + (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '08:30', '18:00'), + (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '24시간', '24시간'), + (last_insert_id(), NULL, 'WEEKEND', '24시간', '24시간'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '09:30', '17:00'), + (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); + +INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) +VALUES ('오락실', '041-560-1472', '학생회관 1층', NULL, 1); +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (last_insert_id(), 'NULL', 'WEEKDAYS', '24시간', '24시간'), + (last_insert_id(), 'NULL', 'WEEKEND', '24시간', '24시간'); + +UPDATE coop_shop +SET semester_id = 1 +WHERE name = '학생식당'; + +UPDATE coop_opens +SET day_of_week = 'WEEKDAYS' +WHERE coop_shop_id = 1 + AND day_of_week = '평일'; + +UPDATE coop_opens +SET day_of_week = 'WEEKEND' +WHERE coop_shop_id = 1 + AND day_of_week = '주말'; From 8c098f03c1a067b53ef9a49abde8f23fde87e62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B6=98=EC=8B=9D?= <142300831+Choon0414@users.noreply.github.com> Date: Wed, 9 Oct 2024 21:30:31 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../in/koreatech/koin/acceptance/CoopShopApiTest.java | 11 +++++------ .../koin/admin/acceptance/AdminCoopShopApiTest.java | 9 +++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/in/koreatech/koin/acceptance/CoopShopApiTest.java b/src/test/java/in/koreatech/koin/acceptance/CoopShopApiTest.java index eaf8098f1..bfdae459e 100644 --- a/src/test/java/in/koreatech/koin/acceptance/CoopShopApiTest.java +++ b/src/test/java/in/koreatech/koin/acceptance/CoopShopApiTest.java @@ -44,6 +44,7 @@ void setUp() { "semester": "23-2학기", "from_date": "2023-09-02", "to_date": "2023-12-20", + "updated_at" : "2024-01-15 12:00:00", "coop_shops": [ { "id": 1, @@ -58,8 +59,7 @@ void setUp() { ], "phone": "041-000-0000", "location": "학생회관 1층", - "remarks": "공휴일 휴무", - "updated_at" : "2024-01-15" + "remarks": "공휴일 휴무" }, { "id": 2, @@ -67,8 +67,7 @@ void setUp() { "opens": [], "phone": "041-000-0000", "location": "학생회관 2층", - "remarks": "연중무휴", - "updated_at" : "2024-01-15" + "remarks": "연중무휴" } ] } @@ -116,6 +115,7 @@ void setUp() { "semester": "23-겨울학기", "from_date": "2023-12-21", "to_date": "2024-02-28", + "updated_at" : "2024-01-15 12:00:00", "coop_shops": [ { "id": 3, @@ -130,8 +130,7 @@ void setUp() { ], "phone": "041-000-0000", "location": "학생회관 2층", - "remarks": "연중무휴", - "updated_at" : "2024-01-15" + "remarks": "연중무휴" } ] } diff --git a/src/test/java/in/koreatech/koin/admin/acceptance/AdminCoopShopApiTest.java b/src/test/java/in/koreatech/koin/admin/acceptance/AdminCoopShopApiTest.java index 751587204..132b17f18 100644 --- a/src/test/java/in/koreatech/koin/admin/acceptance/AdminCoopShopApiTest.java +++ b/src/test/java/in/koreatech/koin/admin/acceptance/AdminCoopShopApiTest.java @@ -62,12 +62,14 @@ void setUp() { "semester": "23-2학기", "from_date": "2023-09-02", "to_date": "2023-12-20", + "updated_at" : "2024-01-15 12:00:00" }, { "id": 2, "semester": "23-겨울학기", "from_date": "2023-12-21", "to_date": "2024-02-28", + "updated_at" : "2024-01-15 12:00:00" } ] } @@ -87,6 +89,7 @@ void setUp() { "semester": "23-2학기", "from_date": "2023-09-02", "to_date": "2023-12-20", + "updated_at" : "2024-01-15 12:00:00", "coop_shops": [ { "id": 1, @@ -101,8 +104,7 @@ void setUp() { ], "phone": "041-000-0000", "location": "학생회관 1층", - "remarks": "공휴일 휴무", - "updated_at" : "2024-01-15" + "remarks": "공휴일 휴무" }, { "id": 2, @@ -110,8 +112,7 @@ void setUp() { "opens": [], "phone": "041-000-0000", "location": "학생회관 2층", - "remarks": "연중무휴", - "updated_at" : "2024-01-15" + "remarks": "연중무휴" } ] } From 6a45e91d1390e67612c2a2601a0de6e86840c963 Mon Sep 17 00:00:00 2001 From: JeongWon-CHO Date: Thu, 10 Oct 2024 04:18:18 +0900 Subject: [PATCH 3/4] =?UTF-8?q?chore=20:=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98?= =?UTF-8?q?=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V77__insert_coop_shop_semester.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql index de871c448..4ce477921 100644 --- a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql +++ b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql @@ -50,8 +50,8 @@ VALUES (last_insert_id(), NULL, 'WEEKDAYS', '09:30', '17:00'), INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) VALUES ('오락실', '041-560-1472', '학생회관 1층', NULL, 1); INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), 'NULL', 'WEEKDAYS', '24시간', '24시간'), - (last_insert_id(), 'NULL', 'WEEKEND', '24시간', '24시간'); +VALUES (last_insert_id(), NULL, 'WEEKDAYS', '24시간', '24시간'), + (last_insert_id(), NULL, 'WEEKEND', '24시간', '24시간'); UPDATE coop_shop SET semester_id = 1 From 2c8d4d32c46e286302f39e56f8be722366f4ab90 Mon Sep 17 00:00:00 2001 From: JeongWon-CHO Date: Fri, 11 Oct 2024 22:36:12 +0900 Subject: [PATCH 4/4] =?UTF-8?q?chore=20:=20flyway=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V77__insert_coop_shop_semester.sql | 74 +++++++------------ 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql index 4ce477921..b4e61e4f5 100644 --- a/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql +++ b/src/main/resources/db/migration/V77__insert_coop_shop_semester.sql @@ -6,52 +6,34 @@ insert into `coop_semester` (`semester`, `from_date`, `to_date`, `is_applied`) values ('24-2학기', '2024-09-02', '2024-12-20', 1); INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('복지관식당', '041-560-1778', '복지관 2층', '능수관', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), '점심', 'WEEKDAYS', '11:40', '13:30'), - (last_insert_id(), '점심', 'WEEKEND', '미운영', '미운영'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('대즐', '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '08:30', '21:00'), - (last_insert_id(), NULL, 'SATURDAY', '11:00', '18:00'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '09:00', '18:00'), - (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('세탁소', '041-552-1489', '학생회관 2층', NULL, 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '11:30', '18:00'), - (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '08:30', '18:00'), - (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '24시간', '24시간'), - (last_insert_id(), NULL, 'WEEKEND', '24시간', '24시간'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '09:30', '17:00'), - (last_insert_id(), NULL, 'WEEKEND', '휴점', '휴점'); - -INSERT INTO `coop_shop` (`name`, `phone`, `location`, `remarks`, `semester_id`) -VALUES ('오락실', '041-560-1472', '학생회관 1층', NULL, 1); -INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) -VALUES (last_insert_id(), NULL, 'WEEKDAYS', '24시간', '24시간'), - (last_insert_id(), NULL, 'WEEKEND', '24시간', '24시간'); +VALUES ('복지관식당', '041-560-1778', '복지관 2층', '능수관', 1), + ('대즐', '041-560-1779', '복지관 1층', '배달 서비스, 공·일요일 미운영', 1), + ('서점', '041-560-1756', '복지관 1층', '점심시간 12:00 - 13:00', 1), + ('세탁소', '041-552-1489', '학생회관 2층', NULL, 1), + ('복사실', '041-560-1093', '학생회관 2층', '점심시간 11:30 - 12:30', 1), + ('복지관 참빛관 편의점', '041-560-1093', '복지관 1층, 참빛관 1층', '복지관 임시운영 별도공지', 1), + ('미용실', '041-560-1769', '학생회관 1층', '예약제운영', 1), + ('오락실', '041-560-1472', '학생회관 1층', NULL, 1); + +SET @FIRST_ID = LAST_INSERT_ID(); + +INSERT INTO coop_opens (`coop_shop_id`, `type`, `day_of_week`, `open_time`, `close_time`) +VALUES (@FIRST_ID, '점심', 'WEEKDAYS', '11:40', '13:30'), + (@FIRST_ID, '점심', 'WEEKEND', '미운영', '미운영'), + (@FIRST_ID + 1, NULL, 'WEEKDAYS', '08:30', '21:00'), + (@FIRST_ID + 1, NULL, 'SATURDAY', '11:00', '18:00'), + (@FIRST_ID + 2, NULL, 'WEEKDAYS', '09:00', '18:00'), + (@FIRST_ID + 2, NULL, 'WEEKEND', '휴점', '휴점'), + (@FIRST_ID + 3, NULL, 'WEEKDAYS', '11:30', '18:00'), + (@FIRST_ID + 3, NULL, 'WEEKEND', '휴점', '휴점'), + (@FIRST_ID + 4, NULL, 'WEEKDAYS', '08:30', '18:00'), + (@FIRST_ID + 4, NULL, 'WEEKEND', '휴점', '휴점'), + (@FIRST_ID + 5, NULL, 'WEEKDAYS', '24시간', '24시간'), + (@FIRST_ID + 5, NULL, 'WEEKEND', '24시간', '24시간'), + (@FIRST_ID + 6, NULL, 'WEEKDAYS', '09:30', '17:00'), + (@FIRST_ID + 6, NULL, 'WEEKEND', '휴점', '휴점'), + (@FIRST_ID + 7, NULL, 'WEEKDAYS', '24시간', '24시간'), + (@FIRST_ID + 7, NULL, 'WEEKEND', '24시간', '24시간'); UPDATE coop_shop SET semester_id = 1