|
@@ -25,7 +25,7 @@ export class SysConfigController {
|
|
|
const config = await this.sysConfigService.create(request.body)
|
|
const config = await this.sysConfigService.create(request.body)
|
|
|
return reply.code(201).send(config)
|
|
return reply.code(201).send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -34,7 +34,7 @@ export class SysConfigController {
|
|
|
const config = await this.sysConfigService.update(request.params.name, request.body, request.body.teamId)
|
|
const config = await this.sysConfigService.update(request.params.name, request.body, request.body.teamId)
|
|
|
return reply.send(config)
|
|
return reply.send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -43,7 +43,7 @@ export class SysConfigController {
|
|
|
await this.sysConfigService.delete(request.params.name)
|
|
await this.sysConfigService.delete(request.params.name)
|
|
|
return reply.send({ success: true })
|
|
return reply.send({ success: true })
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -52,7 +52,7 @@ export class SysConfigController {
|
|
|
const config = await this.sysConfigService.getSysConfig(request.params.name)
|
|
const config = await this.sysConfigService.getSysConfig(request.params.name)
|
|
|
return reply.send(config)
|
|
return reply.send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -62,7 +62,7 @@ export class SysConfigController {
|
|
|
const configs = await this.sysConfigService.list(Number(page), Number(size), name, type, teamId)
|
|
const configs = await this.sysConfigService.list(Number(page), Number(size), name, type, teamId)
|
|
|
return reply.send(configs)
|
|
return reply.send(configs)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -71,7 +71,7 @@ export class SysConfigController {
|
|
|
const types = await this.sysConfigService.getConfigTypes()
|
|
const types = await this.sysConfigService.getConfigTypes()
|
|
|
return reply.send(types)
|
|
return reply.send(types)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -88,7 +88,7 @@ export class SysConfigController {
|
|
|
const config = await this.sysConfigService.createTeamConfig(body, userId, userRole, teamId)
|
|
const config = await this.sysConfigService.createTeamConfig(body, userId, userRole, teamId)
|
|
|
return reply.code(201).send(config)
|
|
return reply.code(201).send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -105,7 +105,7 @@ export class SysConfigController {
|
|
|
const config = await this.sysConfigService.updateTeamConfig(name, body, userId, userRole, teamId)
|
|
const config = await this.sysConfigService.updateTeamConfig(name, body, userId, userRole, teamId)
|
|
|
return reply.send(config)
|
|
return reply.send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -122,7 +122,7 @@ export class SysConfigController {
|
|
|
await this.sysConfigService.deleteTeamConfig(name, userId, userRole, teamId)
|
|
await this.sysConfigService.deleteTeamConfig(name, userId, userRole, teamId)
|
|
|
return reply.send({ success: true })
|
|
return reply.send({ success: true })
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -144,7 +144,7 @@ export class SysConfigController {
|
|
|
)
|
|
)
|
|
|
return reply.send(config)
|
|
return reply.send(config)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -165,7 +165,7 @@ export class SysConfigController {
|
|
|
)
|
|
)
|
|
|
return reply.send(configs)
|
|
return reply.send(configs)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -178,7 +178,7 @@ export class SysConfigController {
|
|
|
const configs = await this.sysConfigService.getUserTeamConfigs(userId)
|
|
const configs = await this.sysConfigService.getUserTeamConfigs(userId)
|
|
|
return reply.send(configs)
|
|
return reply.send(configs)
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- return reply.code(500).send(error)
|
|
|
|
|
|
|
+ return reply.code(500).send({ message: '操作失败' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|