added service logging

This commit is contained in:
Niclas Thobaben 2021-07-18 14:02:45 +02:00
parent 3b64155b7a
commit e501ad186c
2 changed files with 11 additions and 5 deletions

View file

@ -19,14 +19,20 @@ module.exports = (() => {
console.log(`Generate Service: ${service.namespace}`)
console.log(`See: ${url}`)
const logPath = '/var/log/apibuilder/users'
const urlPath = path.join(logPath, `${service.namespace}.${service.name}`)
const logPath = '/var/log/apibuilder'
const urlPath = path.join(logPath, 'users', `${service.namespace}.${service.name}`)
const servicePath = path.join(logPath, 'services', `${service.namespace}.${service.name}`)
if(!fs.existsSync(logPath)) {
fs.mkdirSync(logPath, { recursive: true })
if(!fs.existsSync('/var/log/apibuilder/users')) {
fs.mkdirSync('/var/log/apibuilder/users', { recursive: true })
}
if(!fs.existsSync('/var/log/apibuilder/services')) {
fs.mkdirSync('/var/log/apibuilder/services', { recursive: true })
}
fs.writeFileSync(urlPath, url)
fs.writeFileSync(servicePath, JSON.stringify(service, null, 4))
let generated = { files: gen.invocation(service), source: '' }

View file

@ -23,7 +23,7 @@ import lombok.*;
public class {{name}} {
@TargetAggregateIdentifier
private {{id.type.name}} id;
private String id;
{{#fields}}
@JsonProperty("{{name}}")