diff --git a/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java b/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java index e25f64f..410ab48 100644 --- a/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java +++ b/src/main/java/org/ntlab/citrusserver/resources/ScheduleRest.java @@ -66,17 +66,21 @@ // return null; // } -// @Path("/{account_id}/schedule/{year}/{month}/{day}") -// @POST//スケジュールの新規作成 -// @Consumes(MediaType.APPLICATION_FORM_URLENCODED) -// @Produces(MediaType.APPLICATION_JSON) -// public Schedule addSchedule(@PathParam("account_id") String accountId, @PathParam("year") Integer year, -// @PathParam("month") Integer month, @PathParam("day") Integer day,@QueryParam("token") String token) { -// if(accountManager.checkToken(accountId,token)) { -// return scheduleManager.addSchedule(accountId, year, month, day); -// } -// return null; -// } + @Path("/{account_id}/schedule/{year}/{month}/{day}") + @POST//スケジュールの新規作成 + @Consumes(MediaType.APPLICATION_FORM_URLENCODED) + @Produces(MediaType.APPLICATION_JSON) + public Schedule addSchedule(@PathParam("account_id") String accountId, @PathParam("year") Integer year, + @PathParam("month") Integer month, @PathParam("day") Integer day,@FormParam("title") String title, + @FormParam("start_time") String startTime,@FormParam("end_time") String endTime,@FormParam("book_id") Integer bookId, + @FormParam("token") String token) { + if(accountManager.checkToken(accountId,token)) { + return scheduleManager.addSchedule(accountId, year, month, day,title,startTime,endTime,bookId); + + }else { + return null; + } + } @Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}")