fix: 修复健康检查路径,添加 authorization-service 健康检查控制器
This commit is contained in:
parent
99589f666a
commit
f3ac5d3718
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(dir:*)",
|
||||||
|
"Bash(npm install)",
|
||||||
|
"Bash(npx prisma:*)",
|
||||||
|
"Bash(npm test:*)",
|
||||||
|
"Bash(npm run build:*)",
|
||||||
|
"Bash(wsl -e bash -c:*)",
|
||||||
|
"Bash(if exist dist rmdir /s /q dist)",
|
||||||
|
"Bash(if exist nul del /f /q nul)",
|
||||||
|
"Bash(if exist coverage rmdir /s /q coverage)",
|
||||||
|
"Bash(git add:*)",
|
||||||
|
"Bash(git restore:*)",
|
||||||
|
"Bash(git commit:*)"
|
||||||
|
],
|
||||||
|
"deny": [],
|
||||||
|
"ask": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { Controller, Get } from '@nestjs/common'
|
||||||
|
import { ApiTags, ApiOperation } from '@nestjs/swagger'
|
||||||
|
|
||||||
|
@ApiTags('Health')
|
||||||
|
@Controller('health')
|
||||||
|
export class HealthController {
|
||||||
|
@Get()
|
||||||
|
@ApiOperation({ summary: '健康检查' })
|
||||||
|
check() {
|
||||||
|
return {
|
||||||
|
status: 'ok',
|
||||||
|
service: 'authorization-service',
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
export * from './authorization.controller'
|
export * from './authorization.controller'
|
||||||
export * from './admin-authorization.controller'
|
export * from './admin-authorization.controller'
|
||||||
|
export * from './health.controller'
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import { AuthorizationApplicationService, REFERRAL_REPOSITORY, TEAM_STATISTICS_R
|
||||||
import { MonthlyAssessmentScheduler } from '@/application/schedulers'
|
import { MonthlyAssessmentScheduler } from '@/application/schedulers'
|
||||||
|
|
||||||
// API
|
// API
|
||||||
import { AuthorizationController, AdminAuthorizationController } from '@/api/controllers'
|
import { AuthorizationController, AdminAuthorizationController, HealthController } from '@/api/controllers'
|
||||||
|
|
||||||
// Shared
|
// Shared
|
||||||
import { JwtStrategy } from '@/shared/strategies'
|
import { JwtStrategy } from '@/shared/strategies'
|
||||||
|
|
@ -69,7 +69,7 @@ const MockTeamStatisticsRepository = {
|
||||||
RedisModule,
|
RedisModule,
|
||||||
KafkaModule,
|
KafkaModule,
|
||||||
],
|
],
|
||||||
controllers: [AuthorizationController, AdminAuthorizationController],
|
controllers: [AuthorizationController, AdminAuthorizationController, HealthController],
|
||||||
providers: [
|
providers: [
|
||||||
// Prisma
|
// Prisma
|
||||||
PrismaService,
|
PrismaService,
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@ services:
|
||||||
kafka:
|
kafka:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:3004/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:3004/api/v1/health"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
@ -453,7 +453,7 @@ services:
|
||||||
kafka:
|
kafka:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:3009/health"]
|
test: ["CMD", "curl", "-f", "http://localhost:3009/api/v1/health"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue