added service logging
This commit is contained in:
parent
3b64155b7a
commit
e501ad186c
|
@ -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: '' }
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import lombok.*;
|
|||
public class {{name}} {
|
||||
|
||||
@TargetAggregateIdentifier
|
||||
private {{id.type.name}} id;
|
||||
private String id;
|
||||
|
||||
{{#fields}}
|
||||
@JsonProperty("{{name}}")
|
||||
|
|
Loading…
Reference in a new issue