This commit is contained in:
parent
9e854c3888
commit
0340d068e7
|
|
@ -51,7 +51,7 @@ check_service "Identity Service" "curl -f http://localhost:3000/health" "npm run
|
||||||
|
|
||||||
# 检查 Swagger 文档
|
# 检查 Swagger 文档
|
||||||
echo -e "${YELLOW}=== API 文档 ===${NC}"
|
echo -e "${YELLOW}=== API 文档 ===${NC}"
|
||||||
check_service "Swagger UI" "curl -f http://localhost:3000/api" "等待 Identity Service 启动"
|
check_service "Swagger UI" "curl -f http://localhost:3000/api/docs" "等待 Identity Service 启动"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${YELLOW}======================================${NC}"
|
echo -e "${YELLOW}======================================${NC}"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { Controller, Get } from '@nestjs/common';
|
||||||
|
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||||
|
import { Public } from '@/shared/decorators/public.decorator';
|
||||||
|
|
||||||
|
@ApiTags('健康检查')
|
||||||
|
@Controller()
|
||||||
|
export class HealthController {
|
||||||
|
@Public()
|
||||||
|
@Get('health')
|
||||||
|
@ApiOperation({ summary: '健康检查端点' })
|
||||||
|
health() {
|
||||||
|
return {
|
||||||
|
status: 'ok',
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
service: 'identity-service',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import { appConfig, databaseConfig, jwtConfig, redisConfig, kafkaConfig, smsConf
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
import { UserAccountController } from '@/api/controllers/user-account.controller';
|
import { UserAccountController } from '@/api/controllers/user-account.controller';
|
||||||
|
import { HealthController } from '@/api/controllers/health.controller';
|
||||||
|
|
||||||
// Application Services
|
// Application Services
|
||||||
import { UserApplicationService } from '@/application/services/user-application.service';
|
import { UserApplicationService } from '@/application/services/user-application.service';
|
||||||
|
|
@ -67,7 +68,7 @@ export class ApplicationModule {}
|
||||||
// ============ API Module ============
|
// ============ API Module ============
|
||||||
@Module({
|
@Module({
|
||||||
imports: [ApplicationModule],
|
imports: [ApplicationModule],
|
||||||
controllers: [UserAccountController],
|
controllers: [HealthController, UserAccountController],
|
||||||
})
|
})
|
||||||
export class ApiModule {}
|
export class ApiModule {}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue