omitempty is not null

This commit is contained in:
mr 2024-07-22 10:57:00 +02:00
parent bbe4b3eee7
commit a5741d5831
9 changed files with 28 additions and 6 deletions

View File

@ -42,27 +42,32 @@ func GetLogger() zerolog.Logger {
func LoadOne(collection LibDataEnum, id string) LibData {
d, code, err := models.Model(collection.EnumIndex()).GetAccessor().LoadOne(id)
return LibData{Data: d, Code: code, Err: err.Error()}
if err != nil { return LibData{Data: d, Code: code, Err: err.Error()} }
return LibData{Data: d, Code: code }
}
func UpdateOne(collection LibDataEnum, set map[string]interface{}, id string) LibData {
d, code, err := models.Model(collection.EnumIndex()).GetAccessor().UpdateOne(set, id)
return LibData{Data: d, Code: code, Err: err.Error()}
if err != nil { return LibData{Data: d, Code: code, Err: err.Error()} }
return LibData{Data: d, Code: code }
}
func DeleteOne(collection LibDataEnum, id string) LibData {
d, code, err := models.Model(collection.EnumIndex()).GetAccessor().DeleteOne(id)
return LibData{Data: d, Code: code, Err: err.Error()}
if err != nil { return LibData{Data: d, Code: code, Err: err.Error()} }
return LibData{Data: d, Code: code }
}
func StoreOne(collection LibDataEnum, object map[string]interface{}) LibData {
model := models.Model(collection.EnumIndex())
d, code, err := model.GetAccessor().StoreOne(model.Deserialize(object))
return LibData{Data: d, Code: code, Err: err.Error()}
if err != nil { return LibData{Data: d, Code: code, Err: err.Error()} }
return LibData{Data: d, Code: code }
}
func CopyOne(collection LibDataEnum, object map[string]interface{}) LibData {
model := models.Model(collection.EnumIndex())
d, code, err := model.GetAccessor().CopyOne(model.Deserialize(object))
return LibData{Data: d, Code: code, Err: err.Error()}
if err != nil { return LibData{Data: d, Code: code, Err: err.Error()} }
return LibData{Data: d, Code: code }
}

View File

@ -1 +1 @@
{"sts":[{"expiry":1753172543.797721,"host":"KRwoeRoAGB723I8uE7JpeWqerzN/Pxk/AmwjzlZKhxE=","mode":"force-https","sts_include_subdomains":false,"sts_observed":1721636543.797727},{"expiry":1753171621.715392,"host":"bvX4PpTCW5oYCQv3FySIixdkmM+paN/l+o4e/8K1m3o=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1721635621.715397},{"expiry":1724227619.042417,"host":"4cSRm3ZaWx4KVCd+M3ed0gO9bp0ajI76eY5o5OomVHI=","mode":"force-https","sts_include_subdomains":false,"sts_observed":1721635619.042422}],"version":2}
{"sts":[{"expiry":1753174453.301236,"host":"KRwoeRoAGB723I8uE7JpeWqerzN/Pxk/AmwjzlZKhxE=","mode":"force-https","sts_include_subdomains":false,"sts_observed":1721638453.301241},{"expiry":1753171621.715392,"host":"bvX4PpTCW5oYCQv3FySIixdkmM+paN/l+o4e/8K1m3o=","mode":"force-https","sts_include_subdomains":true,"sts_observed":1721635621.715397},{"expiry":1724227619.042417,"host":"4cSRm3ZaWx4KVCd+M3ed0gO9bp0ajI76eY5o5OomVHI=","mode":"force-https","sts_include_subdomains":false,"sts_observed":1721635619.042422}],"version":2}

View File

@ -7,3 +7,4 @@
2024-07-22 10:10:17.112 [error] electron #36: https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream - error POST net::ERR_NETWORK_CHANGED
2024-07-22 10:11:01.677 [error] electron #39: https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream - error POST net::ERR_NETWORK_CHANGED
2024-07-22 10:16:35.150 [error] electron #50: https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream - error POST net::ERR_NETWORK_CHANGED
2024-07-22 10:54:06.711 [error] electron #65: https://mobile.events.data.microsoft.com/OneCollector/1.0?cors=true&content-type=application/x-json-stream - error POST net::ERR_NETWORK_CHANGED

View File

@ -98,3 +98,11 @@
packages=7
duration=296.109537ms
[Info - 10:52:17] 2024/07/22 10:52:17 go/packages.Load #10
view_id="1"
snapshot=48
directory=/home/mr/Documents/OC/oc-workflow
query=[/home/mr/Documents/OC/oc-workflow/... builtin]
packages=7
duration=225.171574ms

View File

@ -106,3 +106,11 @@
2024-07-22 10:23:37.020 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [1ms]
2024-07-22 10:23:37.027 [info] > git config --local branch.main.vscode-merge-base [3ms]
2024-07-22 10:23:37.033 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/origin/main refs/remotes/origin/main [1ms]
2024-07-22 10:52:17.030 [info] > git config --get commit.template [5ms]
2024-07-22 10:52:17.032 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [1ms]
2024-07-22 10:52:17.035 [warning] ENOENT: no such file or directory, open '/home/mr/Documents/OC/oc-workflow/.git/refs/remotes/origin/main'
2024-07-22 10:52:17.037 [info] > git rev-parse refs/remotes/origin/main [2ms]
2024-07-22 10:52:17.042 [info] > git status -z -uall [2ms]
2024-07-22 10:52:17.048 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [2ms]
2024-07-22 10:52:17.053 [info] > git config --local branch.main.vscode-merge-base [1ms]
2024-07-22 10:52:17.059 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/origin/main refs/remotes/origin/main [2ms]