feat: expose email and sms APIs as services to SDK (#202)

Signed-off-by: Kininaru <shiftregister233@outlook.com>

invalid receivers
This commit is contained in:
Kininaru
2021-07-30 14:15:10 +08:00
committed by GitHub
parent 512a451800
commit 7a2230f63e
5 changed files with 187 additions and 5 deletions

View File

@ -33,9 +33,8 @@ type Object struct {
}
func getUsernameByClientIdSecret(ctx *context.Context) string {
requestUri := ctx.Request.RequestURI
clientId := parseQuery(requestUri, "clientId")
clientSecret := parseQuery(requestUri, "clientSecret")
clientId := ctx.Input.Query("clientId")
clientSecret := ctx.Input.Query("clientSecret")
if len(clientId) == 0 || len(clientSecret) == 0 {
return ""
}

View File

@ -95,5 +95,8 @@ func initAPI() {
beego.Router("/api/get-records", &controllers.ApiController{}, "GET:GetRecords")
beego.Router("/api/get-records-filter", &controllers.ApiController{}, "POST:GetRecordsByFilter")
beego.Router("/api/send-email", &controllers.ApiController{}, "POST:SendEmail")
beego.Router("/api/send-sms", &controllers.ApiController{}, "POST:SendSms")
}