-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated model and removed author service #35
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except the two minor comments, the rest looks good to me.
service/es_model_populator.go
Outdated
default: | ||
return esModel, nil | ||
} | ||
} | ||
|
||
func (mp *EsModelPopulator) ConvertAggregateConceptToESConceptModel(concept AggregateConceptModel, conceptType string, publishRef string) (interface{}, error) { | ||
func ConvertAggregateConceptToESConceptModel(concept AggregateConceptModel, conceptType string, publishRef string) (interface{}, error) { | ||
esModel := convertAggregateConceptToESConceptModel(concept, conceptType, publishRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment to above... I think that you can get rid of this function just by using the code at line 55.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
service/es_model_populator.go
Outdated
} | ||
|
||
func (mp *EsModelPopulator) ConvertConceptToESConceptModel(concept ConceptModel, conceptType string, publishRef string) (interface{}, error) { | ||
func ConvertConceptToESConceptModel(concept ConceptModel, conceptType string, publishRef string) (interface{}, error) { | ||
esModel := convertToESConceptModel(concept, conceptType, publishRef) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something really minor. I think that you can get rid of this function just by using the code at line 59. In my opinion, convertToESConceptModel
has confusing name and it is useless since it is implemented by a single line of code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
service/es_model_populator.go
Outdated
if err != nil { | ||
return nil, err | ||
isFTAuthor := strconv.FormatBool(concept.IsAuthor) | ||
if isFTAuthor == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since strconv.FormatBool
returns only "true" or "false" strings, this condition is never true. So, this if
statement is not necessary anymore.
service/es_model_populator.go
Outdated
} | ||
return *person, nil | ||
return *esPersonModel, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above about pointers
service/es_model_populator.go
Outdated
} | ||
return *person, nil | ||
return *esPersonModel, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused... esPersonModel
is returned as a pointer to a pointer of EsPersonConceptModel
(because you used &
at line 25 and *
at line 29) and esModel
is returned as copy... I have the impression that you can simply return both variables as a copy.
No description provided.