-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] 统一服务消息 uniformMessage.send 增加 #6
Comments
我看它的用途是用一个接口统一公众号和小程序的模版消息,可小程序的模版消息业务不是已经下线了么?如果你只发公众号模版消息的话,用它单独的接口不可以吗?还是这个接口有我没注意到的什么其他特殊的呢? |
你说的也有道理,确实可以使用公众号模板进行发送,这其实就像什么呢 Nullable 或 int? 还有它们值的判空如 public int? Id |
啊这... 🤦♂️ 如果你确实需要这个接口,可以参考文档《如何扩展额外的 API?》一节自行扩展;或者你也可以发个 PR 过来。 但暂时不会发布一个新版本出来,毕竟这是一个可有可无的 API,为此发一版本没啥必要你说是吧?可以考虑当有其他新的 API 加入后再一同发布。 P.S. 其实 Nullable 的结构体不建议用 |
我已经在我项目中扩展了,就是使用时搜索没找到这个API,所以提了这个功能,这个你可以按你的想法来,必竞每个人的标准都不一样。 |
因为 但如果你是个泛型方法呢?你在这个方法里并不知道外面传进来的是个 P.S. 其实对于 Primitive Types 而言,C# 的编译器是做了优化的,你会在读 IL 层代码时发现, int? i = 0;
if (i != null) {
i++;
}
if (i.HasValue) {
i++;
}
// 以上的判空部分均被翻译为:
// call System.Boolean System.Nullable`1<System.Int32>::get_HasValue()
// 完整 IL 代码请见下图 普通的引用类型判空的 IL 代码就不贴了,感兴趣的话你可以自己尝试一下,对比看看有何不同。 |
Support this on release v1.7.0. 请注意新增的接口模型中不包含微信已标记为废弃的 感谢建议,下次欢迎直接 PR,开源项目需要社区的共同参与 🙏 |
受教受教,谢谢。没想到反映这么迅速,要不我就直接提交PR了 |
统一服务消息uniformMessage.send 这个挺常用的,还没有API
The text was updated successfully, but these errors were encountered: