Make interfaces abstract
This commit is contained in:
@ -17,7 +17,8 @@ func NewMapperImpl() Mapper {
|
||||
return MapperImpl{}
|
||||
}
|
||||
|
||||
func (mapper MapperImpl) JournalApiToDb(apimodel api.JournalEntry) db.Journal {
|
||||
func (mapper MapperImpl) JournalApiToDb(am interface{}) interface{} {
|
||||
apimodel := am.(api.JournalEntry)
|
||||
date, err := time.Parse("2006-01-02", apimodel.Date)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Could not parse date `%s`", apimodel.Date)
|
||||
@ -53,7 +54,9 @@ func (mapper MapperImpl) JournalApiToDb(apimodel api.JournalEntry) db.Journal {
|
||||
}
|
||||
}
|
||||
|
||||
func (mapper MapperImpl) JournalDbToApi(dbmodel db.Journal) api.JournalEntry {
|
||||
func (mapper MapperImpl) JournalDbToApi(dm interface{}) interface{} {
|
||||
dbmodel := dm.(db.Journal)
|
||||
|
||||
dateValue, err := dbmodel.Date.Value()
|
||||
var date string
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user