-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
lang-v
committed
Nov 14, 2020
1 parent
20d6175
commit 31268fc
Showing
63 changed files
with
2,064 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
app/src/main/java/com/novel/qingwen/bmob/response/DataResponse.kt
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
app/src/main/java/com/novel/qingwen/bmob/response/LoginResponse.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.novel.qingwen.net.bean | ||
|
||
data class Avatar( | ||
val avatar: String, | ||
val code: Int, | ||
val msg: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.novel.qingwen.net.bean | ||
|
||
data class BaseResponse(var msg:String,var code:Int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.novel.qingwen.net.bean | ||
|
||
data class BookShelf(val msg:String, val code:Int,var data:String?=null) |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/novel/qingwen/net/bean/LoginResult.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.novel.qingwen.net.bean | ||
|
||
data class LoginResult( | ||
var avatar: String, | ||
var code: Int, | ||
var email: String, | ||
var msg: String, | ||
var nick: String, | ||
val password: String, | ||
var token: String, | ||
var username: String | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package com.novel.qingwen.room | ||
|
||
import androidx.room.Database | ||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import com.novel.qingwen.room.dao.BookInfoDao | ||
import com.novel.qingwen.room.dao.ChapterDao | ||
import com.novel.qingwen.room.dao.ConfigDao | ||
import com.novel.qingwen.room.dao.UserDataDao | ||
import com.novel.qingwen.room.entity.BookInfo | ||
import com.novel.qingwen.room.entity.Chapter | ||
import com.novel.qingwen.room.entity.Config | ||
import com.tencent.bugly.Bugly.applicationContext | ||
import com.novel.qingwen.room.entity.UserData | ||
|
||
@Database(entities = [Chapter::class,Config::class,BookInfo::class],version = 2,exportSchema = false) | ||
@Database(entities = [Chapter::class,Config::class,BookInfo::class,UserData::class],version = 3,exportSchema = false) | ||
abstract class AppDatabase:RoomDatabase() { | ||
abstract fun chapterDao(): ChapterDao | ||
abstract fun configDao():ConfigDao | ||
abstract fun bookInfoDao():BookInfoDao | ||
abstract fun userDataDao():UserDataDao | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/novel/qingwen/room/dao/UserDataDao.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.novel.qingwen.room.dao | ||
|
||
import androidx.room.* | ||
import com.novel.qingwen.room.entity.Config | ||
import com.novel.qingwen.room.entity.UserData | ||
|
||
@Dao | ||
interface UserDataDao { | ||
@Insert(entity = UserData::class) | ||
fun insert(userData: UserData) | ||
|
||
@Query("select * from UserData where id=:id") | ||
fun loadById(id: Int = 0): UserData | ||
|
||
@Query("update UserData set token=:token, username=:username, nick=:nick,email=:email,avatar=:avatar,password=:password where id=0") | ||
fun update( | ||
token: String, | ||
username: String, | ||
nick: String, | ||
email: String, | ||
avatar: String, | ||
password: String | ||
) | ||
} |
16 changes: 16 additions & 0 deletions
16
app/src/main/java/com/novel/qingwen/room/entity/UserData.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.novel.qingwen.room.entity | ||
|
||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
|
||
@Entity(tableName = "UserData") | ||
data class UserData( | ||
@PrimaryKey val id:Int = 0, | ||
@ColumnInfo(name = "token") var token: String, | ||
@ColumnInfo(name = "username") var username: String, | ||
@ColumnInfo(name = "nick") var nick: String, | ||
@ColumnInfo(name = "password") var password: String, | ||
@ColumnInfo(name = "email") var email: String, | ||
@ColumnInfo(name = "avatar") var avatar: String | ||
) |
Oops, something went wrong.