Skip to content

Commit

Permalink
add modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cjp2600 committed Apr 16, 2019
1 parent 9c0b500 commit d71d40d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,11 @@ func (p *MongoPlugin) ToMongoGenerateFieldConversion(field *descriptor.FieldDesc
}

} else if bomField != nil && bomField.Tag.GetMongoObjectId() {

p.P(`if len(e.`, fieldName, `) > 0 {`)
p.P(`resp.`, fieldName, ` = bom.ToObj(e.`, fieldName, `)`)
p.P(`}`)

} else {
p.P(`resp.`, fieldName, ` = e.`, fieldName)
}
Expand Down

0 comments on commit d71d40d

Please sign in to comment.