Skip to content

Commit

Permalink
update 1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Nov 21, 2019
1 parent 99af292 commit a927e67
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "com.shuyu.github.kotlin"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.0.7"
versionCode 8
versionName "1.0.8"
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ object AppConfig {

const val GRAPHIC_HOST = "https://ghchart.rshah.org/"

const val API_TOKEN = "4d65e2a5626103f92a71867d7b49fea0"

const val PAGE_SIZE = 30

const val HTTP_TIME_OUT = 20 * 1000L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Application
import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.shuyu.github.kotlin.R
import com.shuyu.github.kotlin.common.config.AppConfig
import com.shuyu.github.kotlin.common.net.*
import com.shuyu.github.kotlin.common.utils.HtmlUtils
import com.shuyu.github.kotlin.common.utils.compareVersion
Expand Down Expand Up @@ -90,11 +91,9 @@ class ReposRepository @Inject constructor(private val retrofit: Retrofit, privat


val trendService = retrofit.create(RepoService::class.java)
.getTrendData(true, language, since)
.getTrendDataAPI(true, AppConfig.API_TOKEN, since,language)
.flatMap {
FlatMapResponse2Result(it)
}.map {
TrendConversion.htmlToRepo(it)
}.doOnNext {
reposDao.saveTrendDao(Response.success(GsonUtils.toJsonString(it)), language, since, true)
}.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface RepoService {
): Observable<Response<ArrayList<Repository>>>



@GET("users/{user}/starred")
fun getStarredRepos(
@Header("forceNetWork") forceNetWork: Boolean,
Expand Down Expand Up @@ -220,6 +219,15 @@ interface RepoService {
@Path("languageType") languageType: String,
@Query("since") since: String): Observable<Response<String>>

@GET("https://guoshuyu.cn/github/trend/list")
@Headers("Content-Type: text/plain;charset=utf-8")
fun getTrendDataAPI(
@Header("forceNetWork") forceNetWork: Boolean,
@Header("api-token") apiToken: String,
@Query("since") since: String,
@Query("languageType") languageType: String
): Observable<Response<List<TrendingRepoModel>>>

@GET("repos/{owner}/{repo}/readme")
@Headers("Content-Type: text/plain;charset=utf-8", "Accept: application/vnd.github.html")
fun getReadmeHtml(
Expand Down

0 comments on commit a927e67

Please sign in to comment.