Skip to content

Commit

Permalink
Rename Apis.
Browse files Browse the repository at this point in the history
  • Loading branch information
drakeet committed Nov 10, 2015
1 parent f9c8ad2 commit 6b22da1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/**
* Created by drakeet on 8/9/15.
*/
public interface IDrakeet {
public interface DrakeetApi {

@Headers({ "X-LC-Id: 0azfScvBLCC9tAGRAwIhcC40",
"X-LC-Key: gAuE93qAusvP8gk1VW8DtOUb",
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/me/drakeet/meizhi/DrakeetFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
public class DrakeetFactory {

protected static final Object monitor = new Object();
static IGank sGankIOSingleton = null;
static IDrakeet sDrakeetSingleton = null;
static GankApi sGankIOSingleton = null;
static DrakeetApi sDrakeetSingleton = null;
public static final int meizhiSize = 10;
public static final int gankSize = 5;


public static IGank getGankIOSingleton() {
public static GankApi getGankIOSingleton() {
synchronized (monitor) {
if (sGankIOSingleton == null) {
sGankIOSingleton = new DrakeetRetrofit().getGankService();
Expand All @@ -41,7 +41,7 @@ public static IGank getGankIOSingleton() {
}


public static IDrakeet getDrakeetSingleton() {
public static DrakeetApi getDrakeetSingleton() {
synchronized (monitor) {
if (sDrakeetSingleton == null) {
sDrakeetSingleton = new DrakeetRetrofit().getDrakeetService();
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/me/drakeet/meizhi/DrakeetRetrofit.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*/
public class DrakeetRetrofit {

final IGank gankService;
final IDrakeet drakeetService;
final GankApi gankService;
final DrakeetApi drakeetService;

// @formatter:off
final static Gson gson = new GsonBuilder()
Expand All @@ -55,17 +55,17 @@ public class DrakeetRetrofit {
RestAdapter gankRestAdapter = builder.build();
builder.setEndpoint("https://leancloud.cn:443/1.1/classes");
RestAdapter drakeetRestAdapter = builder.build();
gankService = gankRestAdapter.create(IGank.class);
drakeetService = drakeetRestAdapter.create(IDrakeet.class);
gankService = gankRestAdapter.create(GankApi.class);
drakeetService = drakeetRestAdapter.create(DrakeetApi.class);
}


public IGank getGankService() {
public GankApi getGankService() {
return gankService;
}


public IDrakeet getDrakeetService() {
public DrakeetApi getDrakeetService() {
return drakeetService;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* Created by drakeet on 8/9/15.
*/
public interface IGank {
public interface GankApi {

@GET("/data/福利/" + DrakeetFactory.meizhiSize + "/{page}") Observable<MeizhiData> getMeizhiData(
@Path("page") int page);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/me/drakeet/meizhi/ui/base/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import me.drakeet.meizhi.IGank;
import me.drakeet.meizhi.GankApi;
import me.drakeet.meizhi.DrakeetFactory;
import me.drakeet.meizhi.R;
import me.drakeet.meizhi.ui.AboutActivity;
Expand All @@ -37,7 +37,7 @@
*/
public class BaseActivity extends AppCompatActivity {

public static final IGank sGankIO = DrakeetFactory.getGankIOSingleton();
public static final GankApi sGankIO = DrakeetFactory.getGankIOSingleton();

private CompositeSubscription mCompositeSubscription;

Expand Down

0 comments on commit 6b22da1

Please sign in to comment.