Newer
Older
CosmosClient / app / src / main / java / com / example / cosmosclient / resources / UsersRest.java
package com.example.cosmosclient.resources;

import com.example.cosmosclient.entities.SigninResponse;
import com.example.cosmosclient.entities.SignupResponse;
import com.example.cosmosclient.entities.UserResponse;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface UsersRest {
    @POST("users/{uId}/login")
    @FormUrlEncoded
    Call<SigninResponse> login(@Path("uId") String uId,@Field("pw") String pw);

    @GET("users/{uId}")
    Call<UserResponse> getName(@Path("uId") String uId, @Query("token") String token);

    @POST("users")
    @FormUrlEncoded
    Call<SignupResponse> createUser(@Field("name") String name, @Field("pw") String pw, @Field("iconImage") String icon_image);
}