|
|
|
|
@ -73,7 +73,7 @@ public class Config { |
|
|
|
|
|
|
|
|
|
public static Config find(String url) { |
|
|
|
|
Config item = AppDatabase.get().getConfigDao().find(url); |
|
|
|
|
return item == null ? Config.create() : item.newTime(); |
|
|
|
|
return item == null ? Config.create() : item; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void save(String json) { |
|
|
|
|
@ -81,11 +81,6 @@ public class Config { |
|
|
|
|
ApiConfig.get().setCid(item.update().getId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Config newTime() { |
|
|
|
|
setTime(System.currentTimeMillis()); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Config json(String json) { |
|
|
|
|
setJson(json); |
|
|
|
|
return this; |
|
|
|
|
@ -96,6 +91,7 @@ public class Config { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Config update() { |
|
|
|
|
setTime(System.currentTimeMillis()); |
|
|
|
|
AppDatabase.get().getConfigDao().update(this); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|