mirror of
https://gitlab.com/mobicoop/v3/service/user.git
synced 2026-03-31 20:56:15 +00:00
extract health to module
This commit is contained in:
21
src/modules/health/adapters/primaries/health.proto
Normal file
21
src/modules/health/adapters/primaries/health.proto
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package health;
|
||||
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
||||
7
src/modules/health/health.module.ts
Normal file
7
src/modules/health/health.module.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { HealthController } from './adapters/primaries/health.controller';
|
||||
|
||||
@Module({
|
||||
controllers: [HealthController],
|
||||
})
|
||||
export class HealthModule {}
|
||||
@@ -33,20 +33,3 @@ message Users {
|
||||
}
|
||||
|
||||
message Empty {}
|
||||
|
||||
service Health {
|
||||
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
|
||||
}
|
||||
|
||||
message HealthCheckRequest {
|
||||
string service = 1;
|
||||
}
|
||||
|
||||
message HealthCheckResponse {
|
||||
enum ServingStatus {
|
||||
UNKNOWN = 0;
|
||||
SERVING = 1;
|
||||
NOT_SERVING = 2;
|
||||
}
|
||||
ServingStatus status = 1;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { ConfigModule, ConfigService } from '@nestjs/config';
|
||||
import { CqrsModule } from '@nestjs/cqrs';
|
||||
import { redisStore } from 'cache-manager-ioredis-yet';
|
||||
import { DatabaseModule } from '../database/database.module';
|
||||
import { HealthController } from './adapters/primaries/health.controller';
|
||||
import { UsersController } from './adapters/primaries/users.controller';
|
||||
import { Messager } from './adapters/secondaries/messager';
|
||||
import { UsersRepository } from './adapters/secondaries/users.repository';
|
||||
@@ -47,7 +46,7 @@ import { UserProfile } from './mappers/user.profile';
|
||||
inject: [ConfigService],
|
||||
}),
|
||||
],
|
||||
controllers: [UsersController, HealthController],
|
||||
controllers: [UsersController],
|
||||
providers: [
|
||||
UserProfile,
|
||||
UsersRepository,
|
||||
|
||||
Reference in New Issue
Block a user