diff --git a/app/src/main/java/com/example/citrusclient/Citrus.java b/app/src/main/java/com/example/citrusclient/Citrus.java index 75ac9dc..97469e1 100644 --- a/app/src/main/java/com/example/citrusclient/Citrus.java +++ b/app/src/main/java/com/example/citrusclient/Citrus.java @@ -8,6 +8,9 @@ private String token; private String accountId; private Integer curBookId; + private Integer curYear; + private Integer curMonth; + private Integer curDay; //getter public String getToken(){ @@ -17,6 +20,9 @@ return accountId; } public Integer getCurBookId(){return curBookId;} + public Integer getCurYear() {return curYear;} + public Integer getCurMouth(){return curMonth;} + public Integer getCurDay(){return curDay;} //setter public void setToken(String token){ @@ -26,4 +32,7 @@ this.accountId = accountId; } public void setCurBookId(Integer curBookId){this.curBookId = curBookId;} + public void setCurYear(Integer curYear){this.curYear = curYear;} + public void setCurMonth(Integer curMonth){this.curMonth = curMonth;} + public void setCurDay(Integer curDay){this.curDay = curDay;} } diff --git a/app/src/main/java/com/example/citrusclient/rest/ScheduleRest.java b/app/src/main/java/com/example/citrusclient/rest/ScheduleRest.java index 341f85e..be891fe 100644 --- a/app/src/main/java/com/example/citrusclient/rest/ScheduleRest.java +++ b/app/src/main/java/com/example/citrusclient/rest/ScheduleRest.java @@ -16,7 +16,7 @@ public interface ScheduleRest { - String BASE_URL = "/accounts/{account_id}/schedule"; + String BASE_URL = "accounts/{account_id}/schedule"; @GET(BASE_URL) Call call = scheduleRest.createSchedule(accountId, year, month, day, title, startTime, endTime, bookId, token); @@ -100,6 +113,12 @@ } + /** + * アカウントを指定してallSchedulesLiveDataを更新する + * + * @param accountId アカウントid + * @param token トークン + */ public void updateAllSchedules(String accountId, String token){ Call>>>> call = scheduleRest.getAllSchedules(accountId, token); @@ -119,6 +138,14 @@ }); } + + /** + * アカウントと年を指定してschedulesByYearを更新する + * + * @param accountId アカウントid + * @param year 年 + * @param token トークン + */ public void updateSchedulesByYear(String accountId, int year, String token){ Call>>> call = scheduleRest.getSchedulesByYear(accountId, year, token); call.enqueue(new Callback>>>() { @@ -138,6 +165,15 @@ } + + /** + * アカウントと年と月を指定してschedulesByMonthを更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param token トークン + */ public void updateSchedulesByMonth(String accountId, int year, int month, String token){ Call>> call = scheduleRest.getSchedulesByMonth(accountId, year, month, token); call.enqueue(new Callback>>() { @@ -156,6 +192,16 @@ }); } + + /** + * アカウントと年と月と日を指定してスケジュールを更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param token トークン + */ public void updateSchedulesByDay(String accountId, int year, int month, int day, String token){ Call> call = scheduleRest.getSchedulesByDay(accountId, year, month, day, token); call.enqueue(new Callback>() { @@ -172,6 +218,17 @@ }); } + + /** + * アカウントと年と月と日とスケジュールのidを指定してスケジュールを更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id id + * @param token トークン + */ public void updateScheduleById(String accountId, int year, int month, int day, int id, String token){ Call call = scheduleRest.getScheduleById(accountId, year, month, day, id, token); call.enqueue(new Callback() { @@ -188,6 +245,16 @@ }); } + /** + * アカウントid, 年, 月, 日, スケジュールidを指定してスケジュールを削除する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id スケジュールid + * @param token トークン + */ public void deleteScheduleById(String accountId, int year, int month, int day, int id, String token){ Call call = scheduleRest.deleteScheduleById(accountId, year, month, day, id, token); call.enqueue(new Callback() { @@ -207,6 +274,17 @@ } + /** + * アカウントid, 年, 月, 日, スケジュールidを指定してスケジュールの開始日時を更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id スケジュールid + * @param token トークン + * @param startTime 開始日時 + */ public void setStartTime(String accountId, int year, int month, int day, int id, String token, String startTime){ Call call = scheduleRest.putStartTime(accountId, year, month, day, id, token, startTime); call.enqueue(new Callback() { @@ -226,6 +304,18 @@ }); } + /** + * + * アカウントid, 年, 月, 日, スケジュールidを指定してスケジュールの終了日時を更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id スケジュールid + * @param token トークン + * @param endTime 終了日時 + */ public void setEndTime(String accountId, int year, int month, int day, int id, String token, String endTime){ Call call = scheduleRest.putEndTime(accountId, year, month, day, id, token, endTime); call.enqueue(new Callback() { @@ -245,6 +335,17 @@ }); } + /** + * アカウントid, 年, 月, 日, スケジュールidを指定してスケジュールのタイトルを更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id スケジュールid + * @param token トークン + * @param title タイトル + */ public void setTitle(String accountId, int year, int month, int day, int id, String token, String title){ Call call = scheduleRest.putTitle(accountId, year, month, day, id, token, title); call.enqueue(new Callback() { @@ -264,6 +365,17 @@ }); } + /** + * アカウントid, 年, 月, 日, スケジュールidを指定してスケジュールの所属する本を更新する + * + * @param accountId アカウントid + * @param year 年 + * @param month 月 + * @param day 日 + * @param id スケジュールid + * @param token トークン + * @param bookId 本のid + */ public void setBookId(String accountId, int year, int month, int day, int id, String token, int bookId){ Call call = scheduleRest.putBookId(accountId, year, month, day, id, token, bookId); call.enqueue(new Callback() {