From a79ce2886708ad48daafadcab36cb4c6acca862c Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Thu, 5 Jul 2018 13:05:57 +0000 Subject: [PATCH] proper struct field names --- crm/docs/src/spec.json | 4 ++-- crm/docs/src/spec/module.json | 4 ++-- crm/module.structs.go | 24 ++++++++++++------------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crm/docs/src/spec.json b/crm/docs/src/spec.json index 0d014ceda..e672920ed 100644 --- a/crm/docs/src/spec.json +++ b/crm/docs/src/spec.json @@ -34,8 +34,8 @@ "path": "module", "authentication": [], "struct": [ - { "name": "id", "type": "uint64" }, - { "name": "name", "type": "string" } + { "name": "ID", "type": "uint64" }, + { "name": "Name", "type": "string" } ], "apis": [ { diff --git a/crm/docs/src/spec/module.json b/crm/docs/src/spec/module.json index 036225bd6..14e34b17f 100644 --- a/crm/docs/src/spec/module.json +++ b/crm/docs/src/spec/module.json @@ -5,11 +5,11 @@ "Interface": "Module", "Struct": [ { - "name": "id", + "name": "ID", "type": "uint64" }, { - "name": "name", + "name": "Name", "type": "string" } ], diff --git a/crm/module.structs.go b/crm/module.structs.go index ff764302c..82ada002e 100644 --- a/crm/module.structs.go +++ b/crm/module.structs.go @@ -2,8 +2,8 @@ package crm // Modules type Module struct { - id uint64 - name string + ID uint64 + Name string changed []string } @@ -12,25 +12,25 @@ func (Module) new() *Module { return &Module{} } -func (m *Module) Getid() uint64 { - return m.id +func (m *Module) GetID() uint64 { + return m.ID } -func (m *Module) Setid(value uint64) *Module { - if m.id != value { +func (m *Module) SetID(value uint64) *Module { + if m.ID != value { m.changed = append(m.changed, "id") - m.id = value + m.ID = value } return m } -func (m *Module) Getname() string { - return m.name +func (m *Module) GetName() string { + return m.Name } -func (m *Module) Setname(value string) *Module { - if m.name != value { +func (m *Module) SetName(value string) *Module { + if m.Name != value { m.changed = append(m.changed, "name") - m.name = value + m.Name = value } return m }