From fb107c7318284bcc9b6b231f4c11f38640617684 Mon Sep 17 00:00:00 2001 From: Z <390057892@qq.com> Date: Sat, 10 Apr 2021 13:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/litepal.xml | 1 - .../com/novel/read/data/db/BookDatabase.kt | 7 ---- .../java/com/novel/read/data/db/UserDao.kt | 16 ---------- .../com/novel/read/data/db/entity/User.kt | 29 ----------------- .../com/novel/read/data/model/UserResp.kt | 32 ------------------- .../com/novel/read/help/ReadBookConfig.kt | 4 +-- .../com/novel/read/network/api/BookService.kt | 9 ------ .../read/network/repository/BookRepository.kt | 12 ------- 8 files changed, 2 insertions(+), 108 deletions(-) delete mode 100644 app/src/main/java/com/novel/read/data/db/UserDao.kt delete mode 100644 app/src/main/java/com/novel/read/data/db/entity/User.kt delete mode 100644 app/src/main/java/com/novel/read/data/model/UserResp.kt diff --git a/app/src/main/assets/litepal.xml b/app/src/main/assets/litepal.xml index 6c0b221..1c58b6a 100644 --- a/app/src/main/assets/litepal.xml +++ b/app/src/main/assets/litepal.xml @@ -7,7 +7,6 @@ - \ No newline at end of file diff --git a/app/src/main/java/com/novel/read/data/db/BookDatabase.kt b/app/src/main/java/com/novel/read/data/db/BookDatabase.kt index 2b0b795..662adc4 100644 --- a/app/src/main/java/com/novel/read/data/db/BookDatabase.kt +++ b/app/src/main/java/com/novel/read/data/db/BookDatabase.kt @@ -21,7 +21,6 @@ class BookDatabase private constructor() { private var readRecordDao: ReadRecordDao? = null private var bookMarkDao: BookMarkDao? = null private var searchHistoryDao: SearchHistoryDao? = null - private var userDao: UserDao? = null fun getChapterDao(): ChapterDao { if (chapterDao == null) { @@ -58,10 +57,4 @@ class BookDatabase private constructor() { return searchHistoryDao!! } - fun getUserDao(): UserDao { - if (userDao == null) { - userDao = UserDao() - } - return userDao!! - } } \ No newline at end of file diff --git a/app/src/main/java/com/novel/read/data/db/UserDao.kt b/app/src/main/java/com/novel/read/data/db/UserDao.kt deleted file mode 100644 index fc66fd9..0000000 --- a/app/src/main/java/com/novel/read/data/db/UserDao.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.novel.read.data.db - -import com.novel.read.data.db.entity.User -import org.litepal.LitePal -import org.litepal.extension.deleteAll - -class UserDao { - - fun saveUser(user: User) = user.saveOrUpdate("userId=?", user.userId.toString()) - - fun getUser(): User? = - LitePal.findFirst(User::class.java) - - fun deleteUser() = LitePal.deleteAll() - -} \ No newline at end of file diff --git a/app/src/main/java/com/novel/read/data/db/entity/User.kt b/app/src/main/java/com/novel/read/data/db/entity/User.kt deleted file mode 100644 index cb63dd1..0000000 --- a/app/src/main/java/com/novel/read/data/db/entity/User.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.novel.read.data.db.entity - -import org.litepal.crud.LitePalSupport -import java.io.Serializable - -data class User( - val createTime: Long, - val email: String, - val headImageUrl: String, - val idToken: String, - val introduction: String?, - val ip: String, - val isEmailVerified: Int, - val lastLoginTime: Long?, - val nickName: String?, - val oldNickName: String?, - val os: String, - val password: String, - val phone: String, - val provider: String, - val sex: Int, - val updateTime: Long?, - val userId: Long, - val userName: String, - val validFlag: Int, - val vipEndTime: Long?, - val vipStartTime: Long?, - val vipStatus: Int -) : LitePalSupport(), Serializable \ No newline at end of file diff --git a/app/src/main/java/com/novel/read/data/model/UserResp.kt b/app/src/main/java/com/novel/read/data/model/UserResp.kt deleted file mode 100644 index 942093e..0000000 --- a/app/src/main/java/com/novel/read/data/model/UserResp.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.novel.read.data.model - -import com.novel.read.data.db.entity.User - -data class UserResp( - val user: User -) -// -//data class User( -// val createTime: Long, -// val email: String, -// val headImageUrl: String, -// val idToken: String, -// val introduction: Any, -// val ip: String, -// val isEmailVerified: Int, -// val lastLoginTime: Any, -// val nickName: String, -// val oldNickName: Any, -// val os: String, -// val password: String, -// val phone: String, -// val provider: String, -// val sex: Any, -// val updateTime: Any, -// val userId: Long, -// val userName: String, -// val validFlag: Int, -// val vipEndTime: Any, -// val vipStartTime: Any, -// val vipStatus: Int -//) \ No newline at end of file diff --git a/app/src/main/java/com/novel/read/help/ReadBookConfig.kt b/app/src/main/java/com/novel/read/help/ReadBookConfig.kt index cce8f96..79b36ff 100644 --- a/app/src/main/java/com/novel/read/help/ReadBookConfig.kt +++ b/app/src/main/java/com/novel/read/help/ReadBookConfig.kt @@ -234,8 +234,8 @@ object ReadBookConfig { } var paddingBottom: Int -// get() = config.paddingBottom - get() = 20 + get() = config.paddingBottom +// get() = 20 set(value) { config.paddingBottom = value } diff --git a/app/src/main/java/com/novel/read/network/api/BookService.kt b/app/src/main/java/com/novel/read/network/api/BookService.kt index 2f08735..1e3b662 100644 --- a/app/src/main/java/com/novel/read/network/api/BookService.kt +++ b/app/src/main/java/com/novel/read/network/api/BookService.kt @@ -45,15 +45,6 @@ interface BookService { @POST("api/edition/editionUpdate") suspend fun appUpdate(@Body body: RequestBody): ApiResult - @POST("api/user/googleLogin") - suspend fun googleLogin(@Body loginReq: LoginReq): ApiResult - - @POST("api/order/getCommodityList") - suspend fun getGoods(): ApiResult> - - @POST("api/order/addBookOrder") - suspend fun buyVip(): ApiResult> - @Streaming @GET() suspend fun getImage(@Url fileUrl: String): ResponseBody diff --git a/app/src/main/java/com/novel/read/network/repository/BookRepository.kt b/app/src/main/java/com/novel/read/network/repository/BookRepository.kt index 744094f..5802278 100644 --- a/app/src/main/java/com/novel/read/network/repository/BookRepository.kt +++ b/app/src/main/java/com/novel/read/network/repository/BookRepository.kt @@ -104,18 +104,6 @@ class BookRepository { ServiceCreator.apiService.feedback(mapToBody(map)).apiData() } - suspend fun login(loginReq: LoginReq) = withContext(Dispatchers.IO) { - ServiceCreator.apiService.googleLogin(loginReq).apiData() - } - - suspend fun getGoods() = withContext(Dispatchers.IO) { - ServiceCreator.apiService.getGoods().apiData() - } - - suspend fun buyVip() = withContext(Dispatchers.IO) { - ServiceCreator.apiService.buyVip().apiData() - } - private fun mapToBody(map: HashMap): RequestBody { return RequestBody.create( MediaType.parse("application/json;charset=UTF-8"),