-
-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy pathmessage.go
More file actions
102 lines (98 loc) · 3.52 KB
/
Copy pathmessage.go
File metadata and controls
102 lines (98 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package model
import (
"time"
)
// Message holds information about a message.
type Message struct {
ID uint `gorm:"autoIncrement;primaryKey;index"`
ApplicationID uint
Message string `gorm:"type:text"`
Title string `gorm:"type:text"`
Priority int
Extras []byte
Date time.Time
}
// MessageExternal Model
//
// The MessageExternal holds information about a message which was sent by an Application.
//
// swagger:model Message
type MessageExternal struct {
// The message id.
//
// read only: true
// required: true
// example: 25
ID uint `json:"id"`
// The application id that send this message.
//
// read only: true
// required: true
// example: 5
ApplicationID uint `form:"appid" query:"appid" json:"appid"`
// The message. Markdown (excluding html) is allowed.
//
// required: true
// example: **Backup** was successfully finished.
Message string `form:"message" query:"message" json:"message" binding:"required"`
// The title of the message.
//
// example: Backup
Title string `form:"title" query:"title" json:"title"`
// The priority of the message. If unset, then the default priority of the
// application will be used.
//
// example: 2
Priority *int `form:"priority" query:"priority" json:"priority"`
// The extra data sent along the message.
//
// The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type.
//
// The keys should be in the following format: <top-namespace>::[<sub-namespace>::]<action>
//
// These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.
//
// example: {"home::appliances::thermostat::change_temperature":{"temperature":23},"home::appliances::lighting::on":{"brightness":15}}
Extras map[string]any `form:"-" query:"-" json:"extras,omitempty"`
// The date the message was created.
//
// read only: true
// required: true
// example: 2018-02-27T19:36:10.5045044+01:00
Date time.Time `json:"date"`
}
// CreateMessage Model
//
// The CreateMessage holds information about a message that will be sent.
//
// swagger:model CreateMessage
type CreateMessage struct {
// The application id that send this message. Always set when returned via the API.
//
// example: 5
ApplicationID uint `form:"appid" query:"appid" json:"appid"`
// The message. Markdown (excluding html) is allowed.
//
// required: true
// example: **Backup** was successfully finished.
Message string `form:"message" query:"message" json:"message" binding:"required"`
// The title of the message.
//
// example: Backup
Title string `form:"title" query:"title" json:"title"`
// The priority of the message. If unset, then the default priority of the
// application will be used.
//
// example: 2
Priority *int `form:"priority" query:"priority" json:"priority"`
// The extra data sent along the message.
//
// The extra fields are stored in a key-value scheme. Only accepted in CreateMessage requests with application/json content-type.
//
// The keys should be in the following format: <top-namespace>::[<sub-namespace>::]<action>
//
// These namespaces are reserved and might be used in the official clients: gotify android ios web server client. Do not use them for other purposes.
//
// example: {"home::appliances::thermostat::change_temperature":{"temperature":23},"home::appliances::lighting::on":{"brightness":15}}
Extras map[string]any `form:"-" query:"-" json:"extras,omitempty"`
}