Skip to content
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

Develop a new component for sms API; 为"短信 API" 开发新的组件 #830

Open
7 tasks
Tracked by #776
seeflood opened this issue Oct 28, 2022 · 14 comments
Open
7 tasks
Tracked by #776
Assignees
Labels

Comments

@seeflood
Copy link
Member

seeflood commented Oct 28, 2022

What would you like to be added:

Develop a new component for sms API.

Choose an open source component or cloud service you like to implement this API.

For example, you can choose any one in the list below:

  • Cloud service provided by Alibaba cloud
  • Cloud service provided by AWS
  • Cloud service provided by Azure
  • Cloud service provided by Google cloud
  • Cloud service provided by tencent cloud
  • Cloud service provided by qiniu cloud
  • anything else

Reference:

API quickstart doc: https://mosn.io/layotto/#/zh/start/sms/start

API definition(the .proto file): https://github.com/mosn/layotto/blob/main/spec/proto/extension/v1/sms/sms.proto

API reference: https://mosn.io/layotto/api/v1/sms.html

API design discussion : #716

chinese:
选择一个你喜欢的开源组件或云服务实现sms API,
参考资料见上。

Why is this needed:

We need more components to make this API useful

@seeflood seeflood added good first issue Good for newcomers help wanted Extra attention is needed priority/medium kind/component labels Oct 28, 2022
@seeflood seeflood changed the title Develop a new component for sms API; 为 sms API 开发新的组件 Develop a new component for sms API; 为"短信 API" 开发新的组件 Oct 28, 2022
@azhsmesos
Copy link
Contributor

I have some questions: https://docs.qq.com/doc/DTXVSTVRXT0lzWHBW

@seeflood
Copy link
Member Author

seeflood commented Nov 5, 2022

@azhsmesos Hi, I don't have permission to open your doc

@azhsmesos
Copy link
Contributor

@azhsmesos Hi, I don't have permission to open your doc

sorry,【腾讯文档】layotto
https://docs.qq.com/doc/DTXVSTVRXT0lzWHBW

@seeflood
Copy link
Member Author

seeflood commented Nov 7, 2022

@azhsmesos Hi, I don't have permission to open your doc

sorry,【腾讯文档】layotto docs.qq.com/doc/DTXVSTVRXT0lzWHBW

@azhsmesos Hi, I answered your questions in your doc

@azhsmesos
Copy link
Contributor

@azhsmesos Hi, I don't have permission to open your doc

sorry,【腾讯文档】layotto docs.qq.com/doc/DTXVSTVRXT0lzWHBW

@azhsmesos Hi, I answered your questions in your doc

ok

@azhsmesos
Copy link
Contributor

@azhsmesos Hi, I don't have permission to open your doc

sorry,【腾讯文档】layotto docs.qq.com/doc/DTXVSTVRXT0lzWHBW

@azhsmesos Hi, I answered your questions in your doc

Please look at my development ideas again in docs,I'm not sure I'm on the right track,so you can comment directly in the document

@alilestera
Copy link
Contributor

Alibaba cloud SMS docs looks too chaos, its sdk repository has two different smsapi version. One is 20170525/v3, another is 20180501/v2, but the latest docs only has 20170525/v2. If really need to develop new component for alibaba cloud sms, it is hard to choose right version.

@alilestera
Copy link
Contributor

please assign this task to me, develop a new component for tencent cloud sms, and I working on it now.

@alilestera
Copy link
Contributor

alilestera commented Jul 3, 2023

I found a problem in Tencent cloud sms api, when we set template parameters to a sms request, it need slice of string, not key-value pair that defined in sms.proto file. I checked Alibaba cloud sms docs, it indeed use key-value pair, but Tencent cloud sms not.
I have a idea, we can add a string to metadata in SendSmsWithTemplateRequest to represent the order of keys, like

var keysOrder = "code,msg,other"
var templateParams = map[string]string{
	"msg":   "okgogogo",
	"code":  "7890",
	"other": "a...",
}
// result = {"7890", "okgogogo", "a..."}

use commas to separate every key.
Not all cloud sms have to use this solution, but Tencent cloud sms can.

Can this solution accept?

@seeflood
Copy link
Member Author

seeflood commented Jul 3, 2023

@alilestera For Tencent Cloud, you can use map<string, string> template_params to simulate a string array, for example:

{
    "0":"xxx",
    "1":"yyy",
}

There is no need to use the metadata field.

@alilestera
Copy link
Contributor

alilestera commented Jul 3, 2023

@alilestera For Tencent Cloud, you can use map<string, string> template_params to simulate a string array, for example:

{
    "0":"xxx",
    "1":"yyy",
}

There is no need to use the metadata field.

You are right. I will follow your idea.

@alilestera
Copy link
Contributor

@seeflood I found another problem. Alibaba cloud sms SendSms API's response is an object like:

{
  "Code": "OK",
  "Message": "OK",
  "BizId": "9006197469364984****",
  "RequestId": "F655A8D5-B967-440B-8683-DAD6FF8DE990"
}

Send short message to different phone numbers at once, the response still have only one "Code", one "Message" and one "RequestId". So the sms API can adapt to it.

But Tencent cloud sms is different. if send short message to different phone numbers at once, the response have one "RequestId" and a set of "SendStatus". Every "SendStatus" has own "Code", "Message" and other information.
So how to solve this to let the sms API adapt Tencent cloud sms API?

@zhenjunMa
Copy link
Contributor

@alilestera 可以参考下之前的设计:#716 看是否能兼容

This was referenced Sep 6, 2023
@alilestera
Copy link
Contributor

Sorry, I've been a bit busy this past time and I've been planning to finish it up recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants