mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 22:53:30 +00:00
added postChat message route on extension
This commit is contained in:
@@ -96,7 +96,14 @@ func armatak_service_ManageEmergency_getEmergency() {}
|
|||||||
|
|
||||||
func armatak_service_ManageEmergency_deleteEmergency() {}
|
func armatak_service_ManageEmergency_deleteEmergency() {}
|
||||||
|
|
||||||
func armatak_service_ManageChat_postChatToAll() {}
|
func armatak_service_ManageChat_postChatToAll(args []string) (string, error) {
|
||||||
|
payload := Message{
|
||||||
|
Message: args[0],
|
||||||
|
Sender: "ARMATAK",
|
||||||
|
}
|
||||||
|
|
||||||
|
return postRequest(args[1]+"/ManageChat/postChatToAll", payload, args[2])
|
||||||
|
}
|
||||||
|
|
||||||
func armatak_service_ManageRoute_postRoute() {}
|
func armatak_service_ManageRoute_postRoute() {}
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,8 @@ type GeoObject struct {
|
|||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Timeout int `json:"timeout,omitempty"`
|
Timeout int `json:"timeout,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Message struct {
|
||||||
|
Message string `json:"uid"`
|
||||||
|
Sender string `json:"sender"`
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func sanitazeArgs(args []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getRequest(route string) (string, error) {
|
func getRequest(route string) (string, error) {
|
||||||
endpoint := FreeTAKServerURL + route
|
endpoint := route
|
||||||
|
|
||||||
req, err := http.Get(endpoint)
|
req, err := http.Get(endpoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user