-
Notifications
You must be signed in to change notification settings - Fork 2
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
17 changed files
with
459 additions
and
120 deletions.
There are no files selected for viewing
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
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
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
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,27 @@ | ||
package com.prajna.dtboy.http; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
/** | ||
*/ | ||
|
||
public class Body { | ||
|
||
private Map<String, Object> kvs = new HashMap<>(); | ||
|
||
public static Body build() { | ||
Body body = new Body(); | ||
return body; | ||
} | ||
|
||
public Body addKvs(String key, Object value) { | ||
kvs.put(key, value); | ||
return this; | ||
} | ||
|
||
public Map<String, Object> done() { | ||
return this.kvs; | ||
} | ||
} |
11 changes: 5 additions & 6 deletions
11
library/src/main/java/com/prajna/dtboy/http/CachePolicy.java
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,12 +1,11 @@ | ||
package com.prajna.dtboy.http; | ||
|
||
/** | ||
* 缓存策略枚举 | ||
*/ | ||
public enum CachePolicy { | ||
NoCache, //不要缓存 | ||
CacheOnly, //只要缓存 | ||
CacheAndRemote, //双重回调 先使用缓存后使用服务器 | ||
IgnoreCache, //忽略缓存 会缓存起来但是 不会使用缓存 | ||
CacheOrRemote; //如果有网就请求 没网就缓存 | ||
NoCache, | ||
CacheOnly, | ||
CacheAndRemote, | ||
IgnoreCache, | ||
CacheOrRemote; | ||
} |
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
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
Oops, something went wrong.