mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 07:41:25 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
@@ -12,10 +12,10 @@ func CreateArecord() {
|
|||||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := dbService.Create(&db.CreateRequest{
|
rsp, err := dbService.Create(&db.CreateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
"age": 42,
|
|
||||||
"isActive": true,
|
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"name": "Jane",
|
"name": "Jane",
|
||||||
|
"age": 42,
|
||||||
|
"isActive": true,
|
||||||
},
|
},
|
||||||
Table: "users",
|
Table: "users",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ func PublishAmessage() {
|
|||||||
mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN"))
|
mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := mqService.Publish(&mq.PublishRequest{
|
rsp, err := mqService.Publish(&mq.PublishRequest{
|
||||||
Message: map[string]interface{}{
|
Message: map[string]interface{}{
|
||||||
"id": "1",
|
|
||||||
"type": "signup",
|
"type": "signup",
|
||||||
"user": "john",
|
"user": "john",
|
||||||
|
"id": "1",
|
||||||
},
|
},
|
||||||
Topic: "events",
|
Topic: "events",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ curl "http://localhost:8080/user/ResetPassword" \
|
|||||||
-d '{
|
-d '{
|
||||||
"code": "some-code-from-email",
|
"code": "some-code-from-email",
|
||||||
"confirmPassword": "newpass123",
|
"confirmPassword": "newpass123",
|
||||||
|
"email": "joe@example.com",
|
||||||
"newPassword": "newpass123"
|
"newPassword": "newpass123"
|
||||||
}'
|
}'
|
||||||
@@ -13,6 +13,7 @@ func ResetPassword() {
|
|||||||
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
|
rsp, err := userService.ResetPassword(&user.ResetPasswordRequest{
|
||||||
Code: "some-code-from-email",
|
Code: "some-code-from-email",
|
||||||
ConfirmPassword: "newpass123",
|
ConfirmPassword: "newpass123",
|
||||||
|
Email: "joe@example.com",
|
||||||
NewPassword: "newpass123",
|
NewPassword: "newpass123",
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ async function resetPassword() {
|
|||||||
let rsp = await userService.resetPassword({
|
let rsp = await userService.resetPassword({
|
||||||
code: "some-code-from-email",
|
code: "some-code-from-email",
|
||||||
confirmPassword: "newpass123",
|
confirmPassword: "newpass123",
|
||||||
|
email: "joe@example.com",
|
||||||
newPassword: "newpass123",
|
newPassword: "newpass123",
|
||||||
});
|
});
|
||||||
console.log(rsp);
|
console.log(rsp);
|
||||||
|
|||||||
@@ -2,5 +2,6 @@ curl "http://localhost:8080/user/VerifyEmail" \
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||||
-d '{
|
-d '{
|
||||||
|
"email": "joe@example.com",
|
||||||
"token": "t2323t232t"
|
"token": "t2323t232t"
|
||||||
}'
|
}'
|
||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
func VerifyEmail() {
|
func VerifyEmail() {
|
||||||
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
|
userService := user.NewUserService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
|
rsp, err := userService.VerifyEmail(&user.VerifyEmailRequest{
|
||||||
|
Email: "joe@example.com",
|
||||||
Token: "t2323t232t",
|
Token: "t2323t232t",
|
||||||
})
|
})
|
||||||
fmt.Println(rsp, err)
|
fmt.Println(rsp, err)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ const { UserService } = require("m3o/user");
|
|||||||
async function verifyEmail() {
|
async function verifyEmail() {
|
||||||
let userService = new UserService(process.env.MICRO_API_TOKEN);
|
let userService = new UserService(process.env.MICRO_API_TOKEN);
|
||||||
let rsp = await userService.verifyEmail({
|
let rsp = await userService.verifyEmail({
|
||||||
|
email: "joe@example.com",
|
||||||
token: "t2323t232t",
|
token: "t2323t232t",
|
||||||
});
|
});
|
||||||
console.log(rsp);
|
console.log(rsp);
|
||||||
|
|||||||
Reference in New Issue
Block a user