server酱推送 . Server酱旧版推送渠道即将下线,使用Turbo版本ServerChanTurboPush替代 . @author itning @since 2021/3/22 16:37
| 15 | * @since 2021/3/22 16:37 |
| 16 | */ |
| 17 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…