|
|
package com.br_technology.securitytrain_master.base.network.api
|
|
|
|
|
|
import com.br_technology.securitytrain_master.ui.bean.CommonBean
|
|
|
import com.br_technology.securitytrain_master.ui.view.login.bean.LoginBean
|
|
|
import com.br_technology.securitytrain_master.ui.view.mine.bean.ContactServiceBean
|
|
|
import com.br_technology.securitytrain_master.ui.view.mine.bean.MineInfoBean
|
|
|
import com.wjx.android.wanandroidmvvm.network.ApiService
|
|
|
import com.wjx.android.wanandroidmvvm.network.response.BaseResponse
|
|
|
import io.reactivex.rxjava3.core.Observable
|
|
|
import retrofit2.http.*
|
|
|
|
|
|
/**
|
|
|
* Author by YSir
|
|
|
* Date on 2022/1/2.
|
|
|
* description 会员接口
|
|
|
* PS: Not easy to write code, please indicate.
|
|
|
*/
|
|
|
interface UserApi : ApiService {
|
|
|
/**
|
|
|
* 会员中心
|
|
|
*/
|
|
|
@GET("/api/user/index")
|
|
|
fun getUserCenter(): Observable<BaseResponse<MineInfoBean>>
|
|
|
|
|
|
/**
|
|
|
* 会员登录
|
|
|
* @param account 账号
|
|
|
* @param password 密码
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/login")
|
|
|
fun loginPwd(
|
|
|
@Field("account") account: String,
|
|
|
@Field("password") password: String
|
|
|
): Observable<BaseResponse<LoginBean>>
|
|
|
|
|
|
/**
|
|
|
* 手机验证码登录
|
|
|
* @param account 账号
|
|
|
* @param captcha 验证码
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/mobilelogin")
|
|
|
fun loginCaptcha(
|
|
|
@Field("account") account: String,
|
|
|
@Field("captcha") captcha: String
|
|
|
): Observable<BaseResponse<LoginBean>>
|
|
|
|
|
|
/**
|
|
|
* 三方登录
|
|
|
* @param platform 平台名称
|
|
|
* @param code Code码
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/third")
|
|
|
fun loginThird(
|
|
|
@Field("platform") platform: String,
|
|
|
): Observable<BaseResponse<LoginBean>>
|
|
|
|
|
|
/**
|
|
|
* 修改手机号
|
|
|
* @param mobile 手机号
|
|
|
* @param captcha 验证码
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/changemobile")
|
|
|
fun changeMobile(
|
|
|
@Field("mobile") mobile: String,
|
|
|
@Field("captcha") captcha: String
|
|
|
): Observable<BaseResponse<CommonBean>>
|
|
|
|
|
|
/**
|
|
|
* 获取图片验证码
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/base64EncodeImage")
|
|
|
fun changeMobile(): Observable<BaseResponse<String>>
|
|
|
|
|
|
// /**
|
|
|
// * 退出登录
|
|
|
// */
|
|
|
// @FormUrlEncoded
|
|
|
// @POST("/api/user/logout")
|
|
|
// fun logout(): Observable<BaseResponse<CommonBean>>
|
|
|
|
|
|
/**
|
|
|
* 修改会员个人信息
|
|
|
* @param avatar 头像图片地址
|
|
|
* @param nickname 昵称
|
|
|
* @param bio 个人简介
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/profile")
|
|
|
fun setUserProfile(
|
|
|
@Field("avatar") avatar: String,
|
|
|
@Field("nickname") nickname: String,
|
|
|
@Field("bio") bio: String
|
|
|
): Observable<BaseResponse<CommonBean>>
|
|
|
|
|
|
/**
|
|
|
* 联系客服
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/contact")
|
|
|
fun userContact(
|
|
|
): Observable<BaseResponse<ContactServiceBean>>
|
|
|
|
|
|
/**
|
|
|
* 投诉与建议(h5+app)
|
|
|
* @param platform string 是 平台:2=h5,3=app
|
|
|
* @param type string 是 投诉类型:1=功能异常,2=体验问题,3=功能建议,4=服务投诉,5=其他问题
|
|
|
* @param mobile string 是 手机号
|
|
|
* @param des string 是 描述
|
|
|
* @param sub_type string 否 建议类型:1=平台建议,2=企业建议
|
|
|
* @param images string 否 照片
|
|
|
* @param is_hide string 是 匿名提交:0=否,1=是
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/feedback_m")
|
|
|
fun feedback(
|
|
|
@Field("platform") platform: String,
|
|
|
@Field("type") type: String,
|
|
|
@Field("mobile") mobile: String,
|
|
|
@Field("des") des: String,
|
|
|
@Field("sub_type") sub_type: String,
|
|
|
@Field("is_hide") is_hide: Int
|
|
|
): Observable<BaseResponse<Any>>
|
|
|
|
|
|
// /**
|
|
|
// * 忘记密码
|
|
|
// */
|
|
|
// @FormUrlEncoded
|
|
|
// @POST("/api/user/resetpwd")
|
|
|
// fun resetPwd(
|
|
|
// @Field("mobile") mobile: String, // 手机号
|
|
|
// @Field("captcha") captcha: String, // 验证码
|
|
|
// @Field("newpassword") newpassword: String, // 新密码
|
|
|
// @Field("confirmpassword") confirmpassword: String // 确认密码
|
|
|
// ): Observable<BaseResponse<CommonBean>>
|
|
|
|
|
|
// /**
|
|
|
// * 修改密码
|
|
|
// */
|
|
|
// @FormUrlEncoded
|
|
|
// @POST("/api/user/changepwd")
|
|
|
// fun changePwd(
|
|
|
// @Field("mobile") mobile: String, // 手机号
|
|
|
// @Field("captcha") captcha: String, // 验证码
|
|
|
// @Field("oldpassword") oldpassword: String, // 原密码
|
|
|
// @Field("newpassword") newpassword: String, // 新密码
|
|
|
// @Field("confirmpassword") confirmpassword: String // 确认密码
|
|
|
// ): Observable<BaseResponse<CommonBean>>
|
|
|
|
|
|
/**
|
|
|
* 收藏/取消收藏
|
|
|
* @param type 收藏类型:1=资料库2=文本课程
|
|
|
* @param favorite_id 收藏id
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/favorite")
|
|
|
fun favorite(
|
|
|
@Field("type") type: String,
|
|
|
@Field("favorite_id") favorite_id: String
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 我的收藏(资料)
|
|
|
* @param page 页数
|
|
|
* @param page_num 每页显示数量
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_favorite_material")
|
|
|
fun favoriteMaterial(
|
|
|
@Field("page") page: Int,
|
|
|
@Field("page_num") page_num: String
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 我的收藏(文本课程)
|
|
|
* @param page 页数
|
|
|
* @param page_num 每页显示数量
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_favorite_lesson_word")
|
|
|
fun favoriteLesson(
|
|
|
@Field("page") page: Int,
|
|
|
@Field("page_num") page_num: String
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 我的证件(文本课程)
|
|
|
* @param page 页数
|
|
|
* @param page_num 每页显示数量
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_cert")
|
|
|
fun certList(
|
|
|
@Field("page") page: Int,
|
|
|
@Field("page_num") page_num: String
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 证件详情
|
|
|
* @param id 证件id
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_cert_detail")
|
|
|
fun certDetail(
|
|
|
@Field("id") id: Int
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 证件类型
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/cert_list")
|
|
|
fun certClassify(): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 证件失效时间
|
|
|
* @param cert_id 证件类型id
|
|
|
* @param start_time 生效时间
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/cert_end_time")
|
|
|
fun certEndTime(
|
|
|
@Field("cert_id") cert_id: Int,
|
|
|
@Field("start_time") start_time: String
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 新增/重新上传证件
|
|
|
* @param id integer 否 证件id
|
|
|
* @param cert_id integer 是 证件类型id
|
|
|
* @param image string 是 证件照片
|
|
|
* @param start_time string 是 生效时间-开始时间
|
|
|
* @param end_time string 是 生效时间-结束时间
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_cert_add")
|
|
|
fun certAdd(
|
|
|
// @Field("id") id: Int,
|
|
|
@Field("cert_id") cert_id: Int,
|
|
|
@Field("image") image: Int,
|
|
|
@Field("start_time") start_time: String,
|
|
|
@Field("end_time") end_time: String,
|
|
|
@FieldMap map: HashMap<String, String>
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 证件变更记录
|
|
|
* @param page 页数
|
|
|
* @param page_num 每页显示数量
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_cert_log")
|
|
|
fun certLog(
|
|
|
@Field("page") page: Int,
|
|
|
@Field("page_num") page_num: Int
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 删除证件
|
|
|
* @param id 证件id
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/my_cert_del")
|
|
|
fun certDel(
|
|
|
@Field("id") id: Int
|
|
|
): Observable<BaseResponse<String>>
|
|
|
|
|
|
/**
|
|
|
* 积分记录
|
|
|
* @param page 页数
|
|
|
* @param page_num 每页显示数量
|
|
|
*/
|
|
|
@FormUrlEncoded
|
|
|
@POST("/api/user/score_log")
|
|
|
fun scoreLog(
|
|
|
@Field("page") page: Int,
|
|
|
@Field("page_num") page_num: Int
|
|
|
): Observable<BaseResponse<String>>
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|