added Commands to evens
parent
0f3ac20614
commit
7237e9e35c
|
@ -22,6 +22,17 @@ module.exports = (service) => {
|
|||
return model
|
||||
})
|
||||
models = javaModels.mapJavaModels(models, service.namespace, 'events')
|
||||
models = models.map(model => {
|
||||
let command = model.attributes.find(attr => attr.name === 'command')
|
||||
if(command) {
|
||||
model.command = command.value
|
||||
model.command.fields = model.command.fields.map(field => {
|
||||
field.type = javaType.mapJavaType(field.type, service.namespace)
|
||||
return field
|
||||
})
|
||||
}
|
||||
return model
|
||||
})
|
||||
|
||||
const modelFiles = models.map(model => {
|
||||
return {
|
||||
|
|
|
@ -30,4 +30,17 @@ public class {{name}} {{#implements.length}}implements {{#implements}}{{name}}{{
|
|||
private {{{type.name}}} {{name}};
|
||||
{{/fields}}
|
||||
|
||||
{{#command}}
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public static class {{name}}Command {
|
||||
|
||||
{{#fields}}{{#isAggregateId}}
|
||||
@TargetAggregateIdentifier{{//isAggregateId}}
|
||||
private {{{type.name}}} {{name}};
|
||||
{{/fields}}
|
||||
}
|
||||
{{/command}}
|
||||
|
||||
}
|
Loading…
Reference in New Issue