diff --git a/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java b/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java index 5e6432b..d336014 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java @@ -1,6 +1,7 @@ package org.ntlab.citrusserver.resources; import org.ntlab.citrusserver.entities.Schedule; +import org.ntlab.citrusserver.repositories.AccountManager; import org.ntlab.citrusserver.repositories.ScheduleManager; import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; @@ -12,9 +13,12 @@ public class ScheduleRest { private final ScheduleManager scheduleManager; + private final AccountManager accountManager; + @Autowired - public ScheduleRest(ScheduleManager sm){ + public ScheduleRest(ScheduleManager sm, AccountManager ac){ scheduleManager = sm; + accountManager = ac; } //@Path("/{account_id}/schedule") @@ -44,8 +48,11 @@ public Schedule getScheduleInfo(@PathParam("account_id") String account_id, @PathParam("year") Integer year, @PathParam("month") Integer month, @PathParam("day") Integer day, @PathParam("schedule_id") Integer schedule_id, @QueryParam("token") String token) { - Schedule schedule = scheduleManager.getScheduleId(account_id, year, month, day, schedule_id);//token後でつける - return schedule; + if(accountManager.checkToken(account_id,token)) { + Schedule schedule = scheduleManager.getScheduleId(account_id, year, month, day, schedule_id);//token後でつける + return schedule; + } + return null; } //@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}")