Last active
August 6, 2019 07:14
-
-
Save kamal-kambe/e40c05adcd4101362ba4c34e2ac67860 to your computer and use it in GitHub Desktop.
Revisions
-
kamal-kambe revised this gist
Aug 6, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import ( ) type Base interface { GetData() json.RawMessage } type base struct { @@ -20,7 +20,7 @@ func (f *baseFactory) NewBase() Base { } } func (b *base) GetData() json.RawMessage { data := make(map[string]interface{}) updatedModels := b.bRepo.GetUpdatedModels() -
kamal-kambe revised this gist
Aug 1, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,7 +23,7 @@ func (f *baseFactory) NewBase() Base { func (b *base) GetData(lastVersion uint) json.RawMessage { data := make(map[string]interface{}) updatedModels := b.bRepo.GetUpdatedModels() data["market_data"] := b.bRepo.GetRows(updatedModels) jsonData, _ := json.Marshal(data) -
kamal-kambe created this gist
Aug 1, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ package service import ( "encoding/json" ) type Base interface { GetDiff(lastVersion uint) json.RawMessage } type base struct { bRepo BaseRepository cache Cache } func (f *baseFactory) NewBase() Base { return &base{ bRepo: f.NewBaseRepository(), cache: f.cache, } } func (b *base) GetData(lastVersion uint) json.RawMessage { data := make(map[string]interface{}) updatedModels := b.bRepo.GetUpdatedModels() data["market_data"] := b.bRepo.GetRows(updatedModels) jsonData, _ := json.Marshal(data) return jsonData }