This commit is contained in:
Ben Wilson
2023-06-24 20:20:41 -04:00
parent f61e9f1417
commit 9315d200ff
11 changed files with 199 additions and 62 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { DateTimeTransformer } from '../utils/DateTimeTransformer';
import { TrackedEntity } from '../utils/TrackedEntity.entity';
@Entity()
@@ -18,7 +19,7 @@ export class ClientEntity extends TrackedEntity {
@Column({ length: 8, type: 'varchar' })
sessionId: string;
@Column({ type: 'datetime' })
@Column({ type: 'datetime', transformer: new DateTimeTransformer() })
startTime: Date;
+11 -1
View File
@@ -40,7 +40,17 @@ export class ClientService {
})
}
public async getById(address: string, clientName: string, sessionId: string): Promise<ClientEntity> {
public async getByName(address: string, clientName: string): Promise<ClientEntity[]> {
return await this.clientRepository.find({
where: {
address,
clientName
}
})
}
public async getBySessionId(address: string, clientName: string, sessionId: string): Promise<ClientEntity> {
return await this.clientRepository.findOne({
where: {
address,