blzb-android/app/src/main/java/com/cheng/bole/net/ApiService.kt

442 lines
12 KiB
Kotlin
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.cheng.bole.net
import com.cheng.bole.bean.BidDetailBean
import com.cheng.bole.bean.BidItemBean
import com.cheng.bole.bean.BidTypeBean
import com.cheng.bole.bean.AreaBean
import com.cheng.bole.bean.CompanyBean
import com.cheng.bole.bean.CorpInfoBean
import com.cheng.bole.bean.GuideTotalBidInfoBean
import com.cheng.bole.bean.GuideUpdateInfoBean
import com.cheng.bole.bean.HotWordBean
import com.cheng.bole.bean.MerchantGoodsBean
import com.cheng.bole.bean.QualificationInfoBean
import com.cheng.bole.bean.SeatItemBean
import com.cheng.bole.bean.SourceBean
import com.cheng.bole.bean.SubscriptionBean
import com.cheng.bole.bean.SubscriptionMessageBean
import com.cheng.bole.bean.UserAuthBean
import com.cheng.bole.net.model.HttpBaseResult
import com.cheng.bole.net.model.HttpListResult
import com.ylqh.cube.bean.CouponActivityEntity
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Part
import retrofit2.http.Path
import retrofit2.http.Query
import retrofit2.http.QueryMap
interface ApiService {
/**
* 获取服务器时间
*/
@GET("/api/time")
suspend fun getServerTime(): HttpBaseResult<String>
/**
* 获取客户端配置
*/
@GET("/api/user/config")
suspend fun getUserConfig(
@Query("oaid") oaid: String,
@Query("os_version") osVersion: Int,
@Query("ua") ua: String,
@Query("imei") imei: String,
@Query("cid") cid: String,
): HttpBaseResult<com.cheng.bole.bean.UserConfigEntity>
/**
* 发送验证码
*/
@POST("/api/user/code")
suspend fun sendCode(@Body params: Map<String, String>): HttpBaseResult<com.cheng.bole.bean.SendCodeEntity>
/**
* 登录
*/
@POST("/api/user/login")
suspend fun login(@Body requestBody: RequestBody): HttpBaseResult<com.cheng.bole.bean.LoginEntity>
/**
* 退出登录
*/
@POST("/api/user/logout")
suspend fun logout(): HttpBaseResult<Any>
/**
*更新用户信息
*/
@PUT("/api/user")
suspend fun changUser(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 注销
*/
@POST("/api/user/destroy")
suspend fun userDestroy(): HttpBaseResult<Any>
/**
* 获取用户信息
*/
@GET("/api/user")
suspend fun userInfo(): HttpBaseResult<com.cheng.bole.bean.UserEntity>
/**
* 获取账号列表
*/
@GET("/api/user/account")
suspend fun accountList(@Query("scene") scene: String): HttpBaseResult<List<com.cheng.bole.bean.AccountEntity>>
/**
* 上传图片
*/
@Multipart
@POST("/api/user/upload")
suspend fun upload(@Part part: MultipartBody.Part, @Query("scene") scene: String): HttpBaseResult<com.cheng.bole.bean.UploadImgEntity>
/**
*删除用户文件
*/
@DELETE("/api/user/upload")
suspend fun delUserFile(@Query("id") id: String): HttpBaseResult<Any>
/**
* 联系客服
*/
@GET("/api/weixin/service")
suspend fun wxService(): HttpBaseResult<com.cheng.bole.bean.WxServiceEntity>
/**
* 事件上报
*/
@POST("/api/user/event")
suspend fun eventReport(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 推送回执接口
*/
@PUT("/api/push/receipt")
suspend fun reportPushReceipt(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 意见反馈
*/
@POST("/api/user/feedback")
suspend fun feedback(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 获取VIP套餐列表
*/
@GET("/api/order/goods")
suspend fun getGoodsList(@Query("type") type: String = "member"): HttpBaseResult<List<com.cheng.bole.bean.VipGoodsEntity>>
/**
* 优惠券列表
*/
@GET("/api/activity/coupon")
suspend fun couponList(@QueryMap params: Map<String, String>): HttpBaseResult<HttpListResult<com.cheng.bole.bean.CouponEntity>>
/**
* 获取优惠活动列表
*/
@GET("/api/activity")
suspend fun couponActivityList(@Query("scene") scene: String): HttpBaseResult<List<CouponActivityEntity>>
/**
* 领取活动优惠券
*/
@POST("/api/activity")
suspend fun getActivityCoupons(@Query("activity_id") ids: String): HttpBaseResult<Any>
/**
* 创建支付订单
*/
@POST("/api/order")
suspend fun payCreateOrder(@Body requestBody: RequestBody): HttpBaseResult<com.cheng.bole.bean.OrderPayEntity>
/**
* 权限验证
*/
@GET("/api/user/auth")
suspend fun checkAuth(@Query("scene") scene: String? = "info"): HttpBaseResult<UserAuthBean>
/**
* 权限上报
*/
@POST("/api/user/auth")
suspend fun sendAuth(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 引导页推荐热词树
*/
@GET("/api/hot_word")
suspend fun getHotWordList(): HttpBaseResult<List<HotWordBean>>
/**
* 城市列表
*/
@GET("/api/city")
suspend fun getAreaList(): HttpBaseResult<List<AreaBean>>
/**
* 获取当前城市
*/
@GET("/api/city/default")
suspend fun getUserCity(): HttpBaseResult<AreaBean>
/**
* 总计商机
*/
@GET("/api/search/preview")
suspend fun getTotalBidInfo(
@Query("keyword") keywords: String,
@Query("city_id") cityIds: String,
@Query("second_kind_num") kindCount: String
): HttpBaseResult<GuideTotalBidInfoBean>
/**
* 每日更新
*/
@GET("/api/info/update/num")
suspend fun getUpdateNum(@Query("size") size: String): HttpBaseResult<List<GuideUpdateInfoBean>>
/**
* 会员页轮播提示
*/
@GET("/api/pay/tips")
suspend fun getPayUserTips(): HttpBaseResult<List<String>>
/**
* 订阅列表
*/
@GET("/api/recommend/subscription")
suspend fun getSubscriptionList(): HttpBaseResult<HttpListResult<SubscriptionBean>>
/**
* 订阅推荐列表
*/
@GET("/api/recommend")
suspend fun getRecommendList(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<BidItemBean>>
/**
* 添加订阅
*/
@POST("/api/recommend/subscription")
suspend fun addSubscription(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 修改订阅
*/
@PUT("/api/recommend/subscription")
suspend fun updateSubscription(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 删除订阅
*/
@DELETE("/api/recommend/subscription")
suspend fun deleteSubscription(@Query("id") id: String): HttpBaseResult<Any>
/**
* 招标公告类型
*/
@GET("api/info/type")
suspend fun getBidTypeList(): HttpBaseResult<List<BidTypeBean>>
/**
* 标讯详情
*
* sourcesearch 搜索 | recommend 首页 | push 推送| favorite 关注列表| history 历史记录
*/
@GET("/api/info/json")
suspend fun getBidDetail(
@Query("id") id: String,
@Query("source") source: String,
@Query("info_source") infoSource: String
): HttpBaseResult<BidDetailBean>
/**
* 收藏列表
*/
@GET("/api/info/favorite/search")
suspend fun getFavoriteList(): HttpBaseResult<HttpListResult<BidItemBean>>
/**
* 收藏标讯
*/
@POST("/api/info/favorite")
suspend fun favorite(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 取消收藏标讯
*/
@DELETE("/api/info/favorite")
suspend fun favoriteCancel(@Query("infoId") id: String): HttpBaseResult<Any>
/**
* 热词推荐
*/
@GET("/api/search/words")
suspend fun getHotKeywords(@QueryMap map: Map<String, String>): HttpBaseResult<List<String>>
/**
* 热门数据源
*/
@GET("/api/source/hot")
suspend fun getHotSources(): HttpBaseResult<HttpListResult<SourceBean>>
/**
* 搜索数据源
*/
@GET("/api/source/search")
suspend fun searchSource(@Query("keyword") keyword: String, @Query("size") size: String = "10"): HttpBaseResult<HttpListResult<SourceBean>>
/**
* 搜索页最新标讯和本地标讯
*/
@GET("/api/info/ks/search")
suspend fun getNewestLocalBidList(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<BidItemBean>>
/**
* 项目搜索
*/
@GET("/api/search")
suspend fun search(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<BidItemBean>>
/**
* 供应商搜索
*/
@GET("/api/user/goods/search")
suspend fun searchSupplier(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<MerchantGoodsBean>>
/**
* 浏览历史
*/
@GET("/api/info/history")
suspend fun getViewHistoryList(): HttpBaseResult<HttpListResult<BidDetailBean>>
/**
* 添加代办
*/
@POST("/api/agency/clew")
suspend fun addAgency(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 资质代办列表
*/
@GET("/api/agency/cert")
suspend fun getAgencyList(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<QualificationInfoBean>>
/**
* 我的标讯列表
*/
@GET("/api/user/info")
suspend fun getMyBidList(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<BidDetailBean>>
/**
* 查询标讯
*/
@GET("/api/user/info/{id}")
suspend fun getBidInfo(@Path("id") id: String): HttpBaseResult<BidItemBean>
/**
* 添加标讯
*/
@POST("/api/user/info")
suspend fun addBidInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 修改标讯
*/
@PUT("/api/user/info")
suspend fun updateBidInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 删除标讯
*/
@DELETE("/api/user/info/{id}")
suspend fun deleteBidInfo(@Path("id") id: String): HttpBaseResult<Any>
/**
* 我的商品列表
*/
@GET("/api/user/goods")
suspend fun getMyGoodsList(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<MerchantGoodsBean>>
/**
* 查询商品
*/
@GET("/api/user/goods/{id}")
suspend fun getGoodsInfo(@Path("id") id: String): HttpBaseResult<MerchantGoodsBean>
/**
* 添加商品
*/
@POST("/api/user/goods")
suspend fun addGoodsInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 修改商品
*/
@PUT("/api/user/goods")
suspend fun updateGoodsInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 删除商品
*/
@DELETE("/api/user/goods/{id}")
suspend fun deleteGoodsInfo(@Path("id") id: String): HttpBaseResult<Any>
/**
* 获取用户公司信息
*/
@GET("/api/user/company")
suspend fun getCompanyInfo(): HttpBaseResult<CompanyBean>
/**
* 提交用户公司信息
*/
@POST("/api/user/company")
suspend fun addCompanyInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 修改用户公司信息
*/
@PUT("/api/user/company")
suspend fun updateCompanyInfo(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 席位信息
*/
@GET("/api/corp")
suspend fun getSeatInfo(): HttpBaseResult<CorpInfoBean>
/**
* 席位列表
*/
@GET("/api/corp/user")
suspend fun getSeatList(@Query("page") page: String = "1", @Query("size") size: String = "100"): HttpBaseResult<HttpListResult<SeatItemBean>>
/**
* 添加席位
*/
@POST("/api/corp/user")
suspend fun addSeat(@Body requestBody: RequestBody): HttpBaseResult<Any>
/**
* 删除席位
*/
@DELETE("/api/corp/user")
suspend fun deleteSeat(@Query("id") id: String): HttpBaseResult<Any>
/**
* 订阅消息列表
*/
@GET("/api/message/ks")
suspend fun getSubscriptionMessage(@QueryMap map: Map<String, String>): HttpBaseResult<HttpListResult<SubscriptionMessageBean>>
}