mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 15:25:19 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
@@ -53,10 +53,12 @@ func (t *DbService) Update(request *UpdateRequest) (*UpdateResponse, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CountRequest struct {
|
type CountRequest struct {
|
||||||
|
// specify the table name
|
||||||
Table string `json:"table"`
|
Table string `json:"table"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type CountResponse struct {
|
type CountResponse struct {
|
||||||
|
// the number of records in the table
|
||||||
Count int32 `json:"count"`
|
Count int32 `json:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,5 +76,5 @@
|
|||||||
"prepare": "npm run build"
|
"prepare": "npm run build"
|
||||||
},
|
},
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"version": "1.0.580"
|
"version": "1.0.581"
|
||||||
}
|
}
|
||||||
@@ -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,8 +12,8 @@ func UpdateArecord() {
|
|||||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := dbService.Update(&db.UpdateRequest{
|
rsp, err := dbService.Update(&db.UpdateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
"age": 43,
|
|
||||||
"id": "1",
|
"id": "1",
|
||||||
|
"age": 43,
|
||||||
},
|
},
|
||||||
Table: "users",
|
Table: "users",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user