-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
71 changed files
with
2,711 additions
and
865 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
10 changes: 0 additions & 10 deletions
10
app/src/main/java/com/anpe/coolbbsyou/data/domain/deviceInfo/DeviceInfo.kt
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
app/src/main/java/com/anpe/coolbbsyou/data/intent/MainIntent.kt
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/anpe/coolbbsyou/data/local/dao/LaterDao.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,23 @@ | ||
package com.anpe.coolbbsyou.data.local.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Delete | ||
import androidx.room.Query | ||
import androidx.room.Upsert | ||
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
@Dao | ||
interface LaterDao { | ||
@Upsert | ||
fun upsertLater(vararg laterEntity: LaterEntity) | ||
|
||
@Delete | ||
fun deleteLater(vararg laterEntity: LaterEntity) | ||
|
||
@Query("DELETE FROM LaterEntity") | ||
fun deleteAllLater() | ||
|
||
@Query("SELECT * FROM LaterEntity") | ||
fun getAllLater(): Flow<List<LaterEntity>> | ||
} |
22 changes: 0 additions & 22 deletions
22
app/src/main/java/com/anpe/coolbbsyou/data/local/dao/ProfileDao.kt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/anpe/coolbbsyou/data/local/database/LaterDatabase.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,30 @@ | ||
package com.anpe.coolbbsyou.data.local.database | ||
|
||
import android.content.Context | ||
import androidx.room.Database | ||
import androidx.room.Room | ||
import androidx.room.RoomDatabase | ||
import com.anpe.coolbbsyou.data.local.dao.LaterDao | ||
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity | ||
|
||
@Database(entities = [LaterEntity::class], version = 1, exportSchema = false) | ||
abstract class LaterDatabase: RoomDatabase() { | ||
companion object { | ||
private var instance: LaterDatabase? = null | ||
|
||
@Synchronized | ||
fun getDatabase(context: Context): LaterDatabase { | ||
if (instance == null) { | ||
instance = Room.databaseBuilder( | ||
context = context, | ||
klass = LaterDatabase::class.java, | ||
name = "later_database" | ||
).build() | ||
} | ||
|
||
return instance as LaterDatabase | ||
} | ||
} | ||
|
||
abstract fun getLaterDao(): LaterDao | ||
} |
30 changes: 0 additions & 30 deletions
30
app/src/main/java/com/anpe/coolbbsyou/data/local/database/ProfileDatabase.kt
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/anpe/coolbbsyou/data/local/entity/deviceInfo/DeviceInfoEntity.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,10 @@ | ||
package com.anpe.coolbbsyou.data.local.entity.deviceInfo | ||
|
||
data class DeviceInfoEntity( | ||
val aid: String, | ||
val mac: String, | ||
val manuFactor: String, | ||
val brand: String, | ||
val model: String, | ||
val buildNumber: String | ||
) |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/anpe/coolbbsyou/data/local/entity/later/LaterEntity.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,11 @@ | ||
package com.anpe.coolbbsyou.data.local.entity.later | ||
|
||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
|
||
@Entity | ||
data class LaterEntity( | ||
@PrimaryKey val feedId: Long, | ||
val feedTitle: String, | ||
val feedMessage: String, | ||
) |
12 changes: 0 additions & 12 deletions
12
app/src/main/java/com/anpe/coolbbsyou/data/local/entity/like/LikeEntity.kt
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
app/src/main/java/com/anpe/coolbbsyou/data/local/entity/profile/ProfileEntity.kt
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/anpe/coolbbsyou/data/local/repository/LocalRepository.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 |
---|---|---|
@@ -1,4 +1,26 @@ | ||
package com.anpe.coolbbsyou.data.local.repository | ||
|
||
import com.anpe.coolbbsyou.data.local.database.LaterDatabase | ||
import com.anpe.coolbbsyou.data.local.entity.later.LaterEntity | ||
import com.anpe.coolbbsyou.util.MyApplication | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.launch | ||
|
||
class LocalRepository { | ||
private val dao = LaterDatabase.getDatabase(MyApplication.context).getLaterDao() | ||
|
||
fun upsertLater(vararg laterEntity: LaterEntity) { | ||
CoroutineScope(Dispatchers.IO).launch { | ||
dao.upsertLater(*laterEntity) | ||
} | ||
} | ||
|
||
fun deleteAllLater() { | ||
CoroutineScope(Dispatchers.IO).launch { | ||
dao.deleteAllLater() | ||
} | ||
} | ||
|
||
fun getAllLater() = dao.getAllLater() | ||
} |
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/anpe/coolbbsyou/data/page/IndexPaging.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,14 @@ | ||
package com.anpe.coolbbsyou.data.page | ||
|
||
import androidx.paging.ExperimentalPagingApi | ||
import androidx.paging.LoadType | ||
import androidx.paging.PagingState | ||
import androidx.paging.RemoteMediator | ||
import com.anpe.coolbbsyou.data.remote.domain.index.Data | ||
|
||
@OptIn(ExperimentalPagingApi::class) | ||
class IndexPaging: RemoteMediator<Int, Data>() { | ||
override suspend fun load(loadType: LoadType, state: PagingState<Int, Data>): MediatorResult { | ||
TODO("Not yet implemented") | ||
} | ||
} |
Oops, something went wrong.