Newer
Older
CitrusClient / app / src / main / java / com / example / citrusclient / rest / AccountsRest.java
package com.example.citrusclient.rest;

import dalvik.annotation.optimization.FastNative;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface AccountsRest {

//    @FormUrlEncoded
//    @GET("accounts")
//    Call<Void> getAllAccounts(
//
//    );

    @FormUrlEncoded
    @POST("accounts")
    Call<String> signup(
            @Field("account_id") String account_id,
            @Field("password") String password
    );

    @FormUrlEncoded
    @POST("accounts/{account_id}/login")
    Call<String> login(
            @Path("account_id") String account_id,
            @Field("password") String password
    );

    //仮
    //パスワード変更
    @FormUrlEncoded
    @PUT("accounts/{account_id}/password")
    Call<String> changePW(
            @Path("account_id") String account_id,
            @Field("new_password") String new_password,
            @Field("old_password") String old_password,
            @Field("token") String token
    );

    //仮
    //アカウント削除
    @FormUrlEncoded
    @DELETE("accounts/{account_id}")
    Call<String> deleteId(
            @Path("account_id") String account_id,
            @Query("token") String token,
            @Query("password") String password
    );
    //仮
    //アカウントの色を返す
    @GET("accounts/{account_id}/accountColor")
    Call<String> getAccountColor(
            @Path("account_id") String account_id
    );

    //仮
    //アカウントカラー変更
    @FormUrlEncoded
    @PUT("accounts/{account_id}/accountColor")
    Call<String> changeColor(
            @Path("account_id") String account_id,
            @Field("accountColor") String accountColor,
            @Field("token") String token
    );

    //仮
    //アカウント変更
    @FormUrlEncoded
    @PUT("accounts/{account_id}")
    Call<String> changeAccount(
            @Path("account_id") String account_id,
            @Field("new_account_id") String new_account_id,
            @Field("old_password") String old_password,
            @Field("token") String token
    );
}