mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 15:29:26 +00:00
Initial API setup: GET and POST handlers and base permission checks.
This commit is contained in:
parent
535cf06237
commit
8b8a84aa67
15 changed files with 538 additions and 18 deletions
25
be/app/structs/api-struct.go
Normal file
25
be/app/structs/api-struct.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package structs
|
||||
|
||||
type Allowed struct {
|
||||
Local []string
|
||||
Remote []string
|
||||
Auth []string
|
||||
}
|
||||
|
||||
var Endpoints = Allowed{
|
||||
Local: []string{
|
||||
"/macro/record",
|
||||
"/macro/list",
|
||||
"/macro/delete",
|
||||
"/macro/play",
|
||||
"/device/list",
|
||||
},
|
||||
Remote: []string{
|
||||
"/macro/list",
|
||||
"/device/access",
|
||||
"/device/auth",
|
||||
},
|
||||
Auth: []string{
|
||||
"/macro/play",
|
||||
},
|
||||
}
|
||||
6
be/app/structs/device-struct.go
Normal file
6
be/app/structs/device-struct.go
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
package structs
|
||||
|
||||
type Settings struct {
|
||||
Name string `json:"name"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
19
be/app/structs/macro-struct.go
Normal file
19
be/app/structs/macro-struct.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package structs
|
||||
|
||||
type MacroRequest struct {
|
||||
Macro string `json:"macro"`
|
||||
}
|
||||
|
||||
type Step struct {
|
||||
Type string `json:"type"`
|
||||
Key string `json:"key"`
|
||||
Code string `json:"code"`
|
||||
Location int `json:"location"`
|
||||
Direction string `json:"direction"`
|
||||
Value int `json:"value"`
|
||||
}
|
||||
|
||||
type NewMacro struct {
|
||||
Name string `json:"name"`
|
||||
Steps []Step `json:"steps"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue