Skip to content

Commit 04e38ac

Browse files
committed
整理代码
1 parent 630e686 commit 04e38ac

12 files changed

+113
-9
lines changed

.idea/gradle.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ buildscript {
1515
allprojects {
1616
repositories {
1717
jcenter()
18+
maven { url = 'http://localhost:8081/repository/maven-public/' }
1819
}
1920
}
2021

sdk/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ android {
55
buildToolsVersion "25.0.0"
66

77
defaultConfig {
8-
minSdkVersion 14
8+
minSdkVersion 15
99
targetSdkVersion 24
1010
versionCode 1
1111
versionName "1.0"
12-
1312
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1413

1514
}
@@ -29,4 +28,5 @@ dependencies {
2928
testCompile 'junit:junit:4.12'
3029
compile 'org.jsoup:jsoup:1.10.1'
3130
compile 'com.mcxiaoke.volley:library:1.0.19'
31+
compile 'com.rae.core:lib:1.0.0'
3232
}

sdk/src/main/AndroidManifest.xml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="rae.com.cnblogs.sdk">
2+
package="com.rae.cnblogs.sdk">
33

4-
<application android:allowBackup="true"
5-
android:label="@string/app_name"
6-
android:supportsRtl="true"
7-
>
4+
<application
5+
android:allowBackup="true"
6+
android:label="@string/app_name"
7+
android:supportsRtl="true"
8+
>
89

910
</application>
1011

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.rae.cnblogs.sdk;
2+
3+
/**
4+
* Created by ChenRui on 2016/11/28 23:43.
5+
*/
6+
public enum ApiErrorCode {
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.rae.cnblogs.sdk;
2+
3+
import android.content.Context;
4+
5+
/**
6+
* 博客园接口实例化
7+
* Created by ChenRui on 2016/11/28 23:38.
8+
*/
9+
public final class CnblogsApiFactory {
10+
private Context mContext;
11+
12+
private CnblogsApiFactory(Context context) {
13+
mContext = context;
14+
}
15+
16+
public IBlogApi getBlogApi() {
17+
return null;
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.rae.cnblogs.sdk;
2+
3+
import com.rae.cnblogs.sdk.bean.Blog;
4+
5+
/**
6+
* 博客相关API
7+
* Created by ChenRui on 2016/11/28 23:34.
8+
*/
9+
public interface IBlogApi {
10+
11+
/**
12+
* 获取首页博客列表
13+
*
14+
* @param page 页码
15+
*/
16+
void getHomeBlogs(int page, ICnblogsListener<Blog> listener);
17+
18+
/**
19+
* 获取分类博客列表
20+
*
21+
* @param page 页码
22+
* @param parentId 父ID
23+
* @param categoryId 分类ID
24+
*/
25+
void getBlogs(int page, int parentId, int categoryId, ICnblogsListener<Blog> listener);
26+
27+
/**
28+
* 获取博客文章内容
29+
*
30+
* @param id 博客ID
31+
*/
32+
void getContents(String id, ICnblogsListener<Blog> listener);
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.rae.cnblogs.sdk;
2+
3+
import java.util.List;
4+
5+
/**
6+
* 接口回调
7+
* Created by ChenRui on 2016/11/28 23:41.
8+
*/
9+
public interface ICnblogsListener<T> {
10+
11+
/**
12+
* 回调成功
13+
*
14+
* @param data
15+
*/
16+
void onApiSuccess(List<T> data);
17+
18+
/**
19+
* 回调失败
20+
*
21+
* @param errorCode
22+
*/
23+
void onApiError(ApiErrorCode errorCode);
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.rae.cnblogs.sdk.bean;
2+
3+
/**
4+
* Created by ChenRui on 2016/11/28 23:45.
5+
*/
6+
public class Blog {
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.rae.cnblogs.sdk.impl;
2+
3+
/**
4+
* 接口父类
5+
* Created by ChenRui on 2016/11/28 23:41.
6+
*/
7+
abstract class AbsCnblogsApi {
8+
9+
}

0 commit comments

Comments
 (0)