Signed-off-by: Drasko DRASKOVIC <drasko.draskovic@gmail.com>
This commit is contained in:
parent
8036c74207
commit
d413508b25
|
@ -8,12 +8,6 @@ var tables []string = []string{
|
|||
id timeuuid,
|
||||
publisher text,
|
||||
protocol text,
|
||||
bn text,
|
||||
bt double,
|
||||
bu text,
|
||||
bv double,
|
||||
bs double,
|
||||
bver int,
|
||||
n text,
|
||||
u text,
|
||||
v double,
|
||||
|
|
|
@ -35,7 +35,6 @@ func normalize(msg writer.RawMessage) ([]writer.Message, error) {
|
|||
Channel: msg.Channel,
|
||||
Publisher: msg.Publisher,
|
||||
Protocol: msg.Protocol,
|
||||
Version: v.BaseVersion,
|
||||
Name: v.Name,
|
||||
Unit: v.Unit,
|
||||
StringValue: v.StringValue,
|
||||
|
@ -75,11 +74,11 @@ func (repo *msgRepository) Save(raw writer.RawMessage) error {
|
|||
|
||||
for _, msg := range msgs {
|
||||
cql := `INSERT INTO messages_by_channel
|
||||
(channel, id, publisher, protocol, bver, n, u, v, vs, vb, vd, s, t, ut, l)
|
||||
VALUES (?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||
(channel, id, publisher, protocol, n, u, v, vs, vb, vd, s, t, ut, l)
|
||||
VALUES (?, now(), ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||
|
||||
err = repo.session.Query(cql, msg.Channel, msg.Publisher, msg.Protocol,
|
||||
msg.Version, msg.Name, msg.Unit, msg.Value, msg.StringValue, msg.BoolValue,
|
||||
msg.Name, msg.Unit, msg.Value, msg.StringValue, msg.BoolValue,
|
||||
msg.DataValue, msg.ValueSum, msg.Time, msg.UpdateTime, msg.Link).Exec()
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -6,7 +6,6 @@ type Message struct {
|
|||
Channel string
|
||||
Publisher string
|
||||
Protocol string
|
||||
Version int `json:"bver,omitempty"`
|
||||
Name string `json:"n,omitempty"`
|
||||
Unit string `json:"u,omitempty"`
|
||||
Value float64 `json:"v,omitempty"`
|
||||
|
|
Loading…
Reference in New Issue