You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This time I working on develop a new component for Tencent cloud sms. But I found a problem between sms API and Tencent cloud sms API. Now I already have a solution idea, so I create this new issue to talk about the idea.
Problem
When we request sms service, we need to set template parameters to it. The template parameters type defined in sms.proto file is a set of key-value pairs which key is string and value is string too.
But in Tencent cloud sms api, it need a slice of strings, instead a set of key-value pairs. When we apply for short message text template, need to use number to decide where the parameter put in, like
// short message content
Verify code: [1], message: [2]
I also checked Alibaba cloud sms docs, not like Tencent cloud sms api, it need a set of key-value pairs instead a slice of strings. So we should not modify the sms.proto file
Solution Idea
We can add a string to metadata in SendSmsWithTemplateRequest to represent the order of keys, like
// keys order in metadatavarkeysOrder="code,msg,other"// template parameters, a set of key-value pairs in SendSmsWithTemplateRequestvartemplateParams=map[string]string{
"msg": "okgogogo",
"code": "7890",
"other": "a...",
}
// result = {"7890", "okgogogo", "a..."}
Use commas to separate every key. According the keys order to generate a slice of strings.
This time I working on develop a new component for Tencent cloud sms. But I found a problem between sms API and Tencent cloud sms API. Now I already have a solution idea, so I create this new issue to talk about the idea.
Problem
When we request sms service, we need to set template parameters to it. The template parameters type defined in
sms.proto
file is a set of key-value pairs which key is string and value is string too.But in Tencent cloud sms api, it need a slice of strings, instead a set of key-value pairs. When we apply for short message text template, need to use number to decide where the parameter put in, like
I also checked Alibaba cloud sms docs, not like Tencent cloud sms api, it need a set of key-value pairs instead a slice of strings. So we should not modify the
sms.proto
fileSolution Idea
We can add a string to metadata in
SendSmsWithTemplateRequest
to represent the order of keys, likeUse commas to separate every key. According the keys order to generate a slice of strings.
Can this solution idea accept?
Reference the issue #830
The text was updated successfully, but these errors were encountered: