mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-14 20:14:47 +00:00
Gifs API (#223)
* gifs service * Commit from GitHub Actions (Publish APIs & Clients) Co-authored-by: domwong <domwong@users.noreply.github.com>
This commit is contained in:
@@ -11,8 +11,8 @@ func UpdateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Update(&db.UpdateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"id": "1",
|
||||
"age": 43,
|
||||
"id": "1",
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
7
examples/gifs/search/curl/search.sh
Executable file
7
examples/gifs/search/curl/search.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
curl "https://api.m3o.com/v1/gifs/Search" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"limit": 2,
|
||||
"query": "dogs"
|
||||
}'
|
||||
17
examples/gifs/search/go/search.go
Executable file
17
examples/gifs/search/go/search.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/gifs"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Search for a gif
|
||||
func Search() {
|
||||
gifsService := gifs.NewGifsService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := gifsService.Search(&gifs.SearchRequest{
|
||||
Limit: 2,
|
||||
Query: "dogs",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
13
examples/gifs/search/node/search.js
Executable file
13
examples/gifs/search/node/search.js
Executable file
@@ -0,0 +1,13 @@
|
||||
import * as gifs from "m3o/gifs";
|
||||
|
||||
// Search for a gif
|
||||
async function Search() {
|
||||
let gifsService = new gifs.GifsService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await gifsService.search({
|
||||
limit: 2,
|
||||
query: "dogs",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await Search();
|
||||
Reference in New Issue
Block a user