MCPcopy Create free account
hub / github.com/OreosLab/bili / ServerChanPush

Class ServerChanPush

src/main/java/top/misec/push/impl/ServerChanPush.java:17–48  ·  view source on GitHub ↗

server酱推送 . Server酱旧版推送渠道即将下线,使用Turbo版本ServerChanTurboPush替代 . @author itning @since 2021/3/22 16:37

Source from the content-addressed store, hash-verified

15 * @since 2021/3/22 16:37
16 */
17public class ServerChanPush extends AbstractPush {
18
19 @Override
20 protected String generatePushUrl(PushMetaInfo metaInfo) {
21 return ApiList.SERVER_PUSH + metaInfo.getToken() + ".send";
22 }
23
24 @Override
25 protected boolean checkPushStatus(JsonObject jsonObject) {
26 if (null == jsonObject) {
27 return false;
28 }
29
30 JsonElement code = jsonObject.get("code");
31 JsonElement errno = jsonObject.get("errno");
32
33 if (null != code && code.getAsInt() == 0) {
34 return true;
35 }
36
37 if (null != errno && errno.getAsInt() == 0) {
38 return true;
39 }
40
41 return false;
42 }
43
44 @Override
45 protected String generatePushBody(PushMetaInfo metaInfo, String content) {
46 return "text=BILIBILI-HELPER任务简报&desp=" + content.replaceAll("=", ":");
47 }
48}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…