Files
yusheng-android/moduleUtil/src/main/java/com/qxcm/moduleutil/http/ApiServer.java

220 lines
8.9 KiB
Java
Raw Normal View History

package com.qxcm.moduleutil.http;
import com.qxcm.moduleutil.bean.AlbumBean;
import com.qxcm.moduleutil.bean.CircleListBean;
import com.qxcm.moduleutil.bean.CommentBean;
import com.qxcm.moduleutil.bean.ExpandColumnBean;
import com.qxcm.moduleutil.bean.GiftLabelBean;
import com.qxcm.moduleutil.bean.HeatedBean;
import com.qxcm.moduleutil.bean.NewsDataBean;
import com.qxcm.moduleutil.bean.RealNameBean;
import com.qxcm.moduleutil.bean.RewardUserBean;
import com.qxcm.moduleutil.bean.RoonGiftModel;
import com.qxcm.moduleutil.bean.UserBean;
import com.qxcm.moduleutil.bean.UserInfo;
import com.qxcm.moduleutil.bean.UserTagBean;
import com.qxcm.moduleutil.widget.Constants;
import java.util.List;
import java.util.Map;
import io.reactivex.Observable;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface ApiServer {
@FormUrlEncoded //请求验证码
@POST(Constants.SEND_CODE)
Observable<BaseModel<Object>> sendCode(@Field("mobile") String mobile,@Field("event")String event);
@FormUrlEncoded
@POST(Constants.LOGIN)
Observable<BaseModel<List<UserBean>>> login(@Field("user_login") String user_login, @Field("sms_code") String sms_code);
@FormUrlEncoded
@POST(Constants.USER_LOGIN)
Observable<BaseModel<List<UserBean>>> userLogin(@Field("user_login") String user_login, @Field("password") String password);
@POST(Constants.UPLOAD_NICK_NAME)
Observable<BaseModel<String>> upUserNickname();
@FormUrlEncoded
@POST(Constants.UPLOAD_USER_PIC)
Observable<BaseModel<String>> upUserPic(@Field("sex") String sex);
@FormUrlEncoded
@POST(Constants.SWITCH_ACCOUNTS)
Observable<BaseModel<List<UserBean>>> switchAccounts(@Field("user_login") String user_id);
@FormUrlEncoded
@POST(Constants.FORGOT_PASSWORD)
Call<BaseModel<String>> forgotPassword(@Field("new_password") String new_password, @Field("mobile") String mobile, @Field("sms_code") String sms_code);
@FormUrlEncoded
@POST(Constants.USER_UPDATE)
Observable<BaseModel<UserBean>> userUpdate(@FieldMap Map<String, String> map);
@GET(Constants.AUTHORIZATION)
Observable<BaseModel<String>> authorization();
@FormUrlEncoded
@POST(Constants.CHANGE_PASSWORD)
Call<BaseModel<String>> getPostData(@Field("new_password") String new_password,@Field("mobile") String mobile,@Field("sms_code") String code,@Field("user_id") String userId);
@FormUrlEncoded
@POST(Constants.REAL_NAME_RESULT)
Call<BaseModel<String>> getRealNameResult(@Field("orderNo") String order_no);
@FormUrlEncoded
@POST(Constants.URL_LOGIN)
Observable<BaseModel<List<UserBean>>> oauthLogin(@Field("login_token") String login_token);
@FormUrlEncoded
@POST(Constants.URL_AUTH_CODE)
Observable<BaseModel<List<UserBean>>> authCode(@Field("auth_code") String login_token);
@FormUrlEncoded
@POST(Constants.URL_WX_CODE)
Observable<BaseModel<List<UserBean>>> authCode1(@Field("code") String login_token);
@FormUrlEncoded
@POST(Constants.REAL_NAME)
Observable<BaseModel<RealNameBean>> realName(@Field("real_name") String real_name, @Field("card_number") String card_number);
@FormUrlEncoded
@POST(Constants.GET_EXPAND_COLUMN)
Observable<BaseModel<List<ExpandColumnBean>>> getExpandColumn(@Field("type") String type);
@FormUrlEncoded
@POST(Constants.GET_OFFICIAL_NOTICE)
Observable<BaseModel<List<NewsDataBean>>> getOfficialNotice( @Field("page") String page, @Field("page_limit") String page_limit,@Field("type") String type);
@FormUrlEncoded
@POST(Constants.GET_ALBUM_LIST)
Observable<BaseModel<List<AlbumBean>>> getAlbumList(@Field("page") String page, @Field("page_limit") String page_limit, @Field("user_id") String user_id);
@FormUrlEncoded
@POST(Constants.CREATE_ALBUM)
Call<BaseModel<String> > createAlbum(@Field("name") String name, @Field("pwd")String pwd, @Field("image") String image);
@FormUrlEncoded
@POST(Constants.EDIT_ALBUM)
Call<BaseModel<String> > editAlbum(@Field("album_id") String album_id,@Field("name") String name, @Field("pwd")String pwd, @Field("image") String image);
@FormUrlEncoded
@POST(Constants.GET_REWARD_LIST)
Observable<BaseModel<List<RewardUserBean>>> getRewardList(@Field("id") String id, @Field("page") int page, @Field("page_limit") int page_limit);
@GET(Constants.GET_GIFT_LABEL)
Observable<BaseModel<List<GiftLabelBean>>> getGiftLabel(@Query("have_hot") String have_hot);
@GET(Constants.GIFT_LIST)//获取礼物列表
Observable<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label);
@GET(Constants.TOPIC_LIST)//获取话题
Observable<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
@FormUrlEncoded
@POST(Constants.PUBLISH_ZONE)
Call<BaseModel<String>> publishZone(@Field("images") String images, @Field("content") String content, @Field("topic_id") String topic_id, @Field("room_id") String room_id,@Field("ip") String ip);
@GET(Constants.GET_CATEGORIES)
Observable<BaseModel<List<HeatedBean>>> getCategories();
@GET(Constants.GET_CIRCLE_LIST)
Observable<BaseModel<List<CircleListBean>>> getCircleList(@Query("page") String page, @Query("page_limit") String page_limit);
@FormUrlEncoded
@POST(Constants.GET_USER_HOME_ZONE)
Observable<BaseModel<List<CircleListBean>>> getCircleUserList(@Field("user_id") String user_id,@Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded
@POST(Constants.LIKE_ZONE)
Call<BaseModel<String>> likeZone(@Field("id") String zone_id);
@FormUrlEncoded
@POST(Constants.TOPIC_ID)
Observable<BaseModel<List<CircleListBean>>> topicId(@Field("topic_id") String topic_id);
@FormUrlEncoded
@POST(Constants.ZONE_DETAIL)
Observable<BaseModel<CircleListBean>> zoneDetail(@Field("id") String topic_id);
@FormUrlEncoded
@POST(Constants.GET_USER_HOME)
Observable<BaseModel<UserInfo>> getUserHome(@Field("user_id") String user_id);
@FormUrlEncoded
@POST(Constants.DELETE_COMMENT)
Call<BaseModel<String>> deleteComment(@Field("id") String zone_id);
@FormUrlEncoded
@POST(Constants.GET_COMMENT_LIST)
Observable<BaseModel<CommentBean>> getCommentList(@Field("id") String id, @Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded
@POST(Constants.COMMENT_ZONE)
Call<BaseModel<String>> commentZone(@Field("id") String id, @Field("content") String content, @Field("pid") String pid, @Field("reply_to") String reply_to);
@FormUrlEncoded
@POST(Constants.CLEAR_LOGIN_INFO)
Call<BaseModel<String>> clearLoginInfo(@Field("token") String token);
@FormUrlEncoded
@POST(Constants.CANCEL)
Call<BaseModel<String>> cancel(@Field("token") String token);
@FormUrlEncoded
@POST(Constants.DELETE_ZONE)
Call<BaseModel<String>> deleteZone(@Field("id") String id);
@GET(Constants.GET_MY_INFO)
Observable<BaseModel<UserInfo>> getMyInfo();
@FormUrlEncoded
@POST(Constants.ED_USER_INFO)
Call<BaseModel<String>> editUserInfo(@Field("nickname") String nickname, @Field("birthday") String birthday, @Field("sex") String sex, @Field("avatar") String avatar, @Field("images") String images, @Field("profile") String profile, @Field("tag_id") String tag_id);
@FormUrlEncoded
@POST(Constants.ED_USER_BG)
Call<BaseModel<String>> editUserBg(@Field("images") String images);
@GET(Constants.GET_USER_TAG_LIST)
Observable<BaseModel<List<UserTagBean>>> getUserTagList();
@FormUrlEncoded
@POST(Constants.GET_LIKE_LIST)
Observable<BaseModel<List<CircleListBean.LikeList>>> getLikeList(@Field("id") String id);
@FormUrlEncoded
@POST(Constants.GET_ALBUM_DETAIL)
Observable<BaseModel<AlbumBean>> getAlbumDetail(@Field("album_id") String albumId, @Field("pwd") String pwd, @Field("page") String page, @Field("page_limit") String page_limit);
@FormUrlEncoded
@POST(Constants.POST_GZ)
Call<BaseModel<String>> userGuanz(@Field("user_id") String userId,@Field("type")String type);
@FormUrlEncoded
@POST(Constants.UP_ALBUM)
Call<BaseModel<String>> upAddAlbum(@Field("album_id") String album_id, @Field("images") String images, @Field("content") String content);
@FormUrlEncoded
@POST(Constants.MOVE_ALBUM)
Call<BaseModel<String>> moveAlbum(@Field("id") String id,@Field("new_album_id")String new_album_id);
@FormUrlEncoded
@POST(Constants.DELETE_ALBUM_IMAGE)
Call<BaseModel<String>> deleteAlbumImage(@Field("id") String id);
@FormUrlEncoded
@POST(Constants.DELETE_ALBUM)
Call<BaseModel<String>> deleteAlbum(@Field("album_id") String id);
@FormUrlEncoded
@POST(Constants.LIKE_ALBUM)
Call<BaseModel<String>> likeAlbum(@Field("album_id") String id);
}