parent
d8b6669d12
commit
2274b476d6
|
@ -0,0 +1,34 @@
|
|||
import { Get, JsonController, OnUndefined, Param } from 'routing-controllers';
|
||||
import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
|
||||
import { getConnectionManager, Repository } from 'typeorm';
|
||||
import { RunnerNotFoundError } from '../errors/RunnerErrors';
|
||||
import { Runner } from '../models/entities/Runner';
|
||||
import { ResponseUser } from '../models/responses/ResponseUser';
|
||||
|
||||
|
||||
@JsonController('/runners')
|
||||
@OpenAPI({ security: [{ "AuthToken": [] }, { "RefreshTokenCookie": [] }] })
|
||||
export class RunnerSelfServiceController {
|
||||
private runnerRepository: Repository<Runner>;
|
||||
|
||||
/**
|
||||
* Gets the repository of this controller's model/entity.
|
||||
*/
|
||||
constructor() {
|
||||
this.runnerRepository = getConnectionManager().get().getRepository(Runner);
|
||||
}
|
||||
|
||||
@Get('/me/:jwt')
|
||||
@ResponseSchema(ResponseUser)
|
||||
@ResponseSchema(RunnerNotFoundError, { statusCode: 404 })
|
||||
@OnUndefined(RunnerNotFoundError)
|
||||
@OpenAPI({ description: 'Lists all information about yourself. <br> Please provide your runner jwt for auth.' })
|
||||
async get(@Param('jwt') jwt: string) {
|
||||
//TODO:
|
||||
}
|
||||
|
||||
public async getRunner(jwt: string): Promise<Runner> {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue