...
This commit is contained in:
18
examples/hero/heromodels/heromodels_comments.vsh
Executable file
18
examples/hero/heromodels/heromodels_comments.vsh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env -S v -n -w -cg -gc none -cc tcc -d use_openssl -enable-globals run
|
||||
|
||||
import freeflowuniverse.herolib.hero.heromodels
|
||||
|
||||
mut mydb := heromodels.new()!
|
||||
|
||||
mut o := mydb.comments.new(comment: 'Hello, world!')!
|
||||
|
||||
o.tags = mydb.comments.db.tags_get(['tag1', 'tag2'])!
|
||||
|
||||
oid := mydb.comments.set(o)!
|
||||
mut o2 := mydb.comments.get(oid)!
|
||||
|
||||
println(oid)
|
||||
println(o2)
|
||||
|
||||
mut objects := mydb.comments.list()!
|
||||
println(objects)
|
||||
@@ -9,17 +9,17 @@ fn main() {
|
||||
mut handler := openrpc.new_heromodels_handler()!
|
||||
|
||||
my_calendar := heromodels.calendar_new(
|
||||
name: "My Calendar"
|
||||
description: "My Calendar"
|
||||
name: 'My Calendar'
|
||||
description: 'My Calendar'
|
||||
securitypolicy: 1
|
||||
tags: ["tag1", "tag2"]
|
||||
group_id: 1,
|
||||
events: []u32{},
|
||||
color: "#000000",
|
||||
timezone: "UTC",
|
||||
is_public: true,
|
||||
tags: ['tag1', 'tag2']
|
||||
group_id: 1
|
||||
events: []u32{}
|
||||
color: '#000000'
|
||||
timezone: 'UTC'
|
||||
is_public: true
|
||||
)!
|
||||
|
||||
response := handler.handle(jsonrpc.new_request('calendar_set', json.encode(my_calendar)))!
|
||||
println(response)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user