HMS-Core / hms-push-serverdemo-java

Java sample code encapsulates APIs of the HUAWEI Push Kit server. It provides many sample programs for your reference or usage.
https://developer.huawei.com/consumer/cn/doc/development/HMS-Guides/push-introduction
Apache License 2.0
44 stars 36 forks source link

提个简单的建议 #6

Open singgel opened 3 years ago

singgel commented 3 years ago

Description SDK的封装可以参考小米的push-SDK

Expected behavior 1.希望SDK提供异步操作的方法 2.希望对消息的返回体封装丰富一些,后面会提供demo(毕竟这个实际影响业务编写) 3.希望增加metric接口方便线上监控

Current behavior 1.目前SDK里面集成fastjson这种有安全漏洞的序列化依赖 2.目前SDK对消息的返回体真是处理的太粗糙了

Screenshots 定义了一个SendResponse返回体,只有80000000才会封装 1.对于非80000000的返回code和message没有封装(特别是message竟然没有了,影响实际业务编写) 2.对于http的exception,直接把状态码给。。。。(这个503频控让业务咋搞,实在不行咱学苹果不限速了) image

Environment all Environment

Other 一步步来,看好你

singgel commented 3 years ago

demo response: 从小米的SDK粘贴过来的

    private static final long serialVersionUID = 8030699726843716781L;
    private final String messageId;
    private final String traceId;
    private final ErrorCode errorCode;
    private final JSONObject data;
    private final String reason;

    private Result(Result.Builder builder) {
        this.messageId = builder.messageId;
        this.data = builder.data;
        this.errorCode = builder.errorCode;
        this.reason = builder.reason;
        this.traceId = builder.traceId;
    }

使用体验上: 可以看下小米的push文档:https://dev.mi.com/console/doc/detail?pId=230

华为从2.0到这个版本进步很多了,加油华为人

qurenneng commented 10 months ago

这就是遥遥领先吗,还是根本就不在乎。。。。