package org.ntlab.citrusserver.resources;
import org.ntlab.citrusserver.entities.Schedule;
import org.ntlab.citrusserver.repositories.ScheduleManager;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Path("/accounts")
@Component
public class ScheduleRest {
private final ScheduleManager scheduleManager;
@Autowired
public ScheduleRest(ScheduleManager sm){
scheduleManager = sm;
}
//@Path("/{account_id}/schedule")
//@GET//登録されたスケジュールのidを返す
//@Produces(MediaType.APPLICATION_JSON)
//@Path("/{account_id}/schedule/{year}")
//@GET//登録されたスケジュールのidを年単位で返す
//@Produces(MediaType.APPLICATION_JSON)
//@Path("/{account_id}/schedule/{year}/{month}")
//@GET//登録されたスケジュールのidを月単位で返す
//@Produces(MediaType.APPLICATION_JSON)
//@Path("/{account_id}/schedule/{year}/{month}/{day}")
//@GET//登録されたスケジュールのidを日ごとで返す
//@Produces(MediaType.APPLICATION_JSON)
//@Path("/{account_id}/schedule/{year}/{month}/{day}")
//@POST//スケジュールの新規作成
//@Produces(MediaType.APPLICATION_JSON)
@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}")
@GET//スケジュールの情報を返す
@Produces(MediaType.APPLICATION_JSON)
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;
}
//@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}")
//@DELETE//特定のスケジュールを削除する
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
//@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}/start_time")
//@PUT//スケジュールの開始時刻の新規作成・変更
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
//@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}/end_time")
//@PUT//スケジュールの終了時刻の新規作成・変更
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
//@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}/title")
//@PUT//スケジュールのタイトルの変更
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
//@Path("/{account_id}/schedule/{year}/{month}/{day}/{schedule_id}/book_id")
//@PUT//スケジュールの所属している本の新規設定・変更
//@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
}