feat(repos): 添加提交日志查询和分支查询
This commit is contained in:
26
src/repos/repos.resolver.ts
Normal file
26
src/repos/repos.resolver.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import { Args, Query, Resolver } from '@nestjs/graphql';
|
||||
import { ListLogsArgs } from './dtos/list-logs.args';
|
||||
import { ReposService } from './repos.service';
|
||||
import { LogsList } from './dtos/logs-list.model';
|
||||
import { ListBranchesArgs } from './dtos/list-branches.args';
|
||||
import { BranchesList } from './dtos/branches-list.model';
|
||||
|
||||
@Resolver()
|
||||
export class ReposResolver {
|
||||
con
|
||||
@Query(() => LogsList)
|
||||
async listLogs(@Args('listLogsArgs') dto: ListLogsArgs) {
|
||||
return await this.service.listLogs(dto);
|
||||
}
|
||||
@Query(() => BranchesList)
|
||||
async ListBranchesArgs(
|
||||
@Args('listBranchesArgs') dto: ListBranchesArgs,
|
||||
): Promise<BranchesList> {
|
||||
return await this.service.listBranches(dto).then((data) => {
|
||||
return {
|
||||
...data,
|
||||
branches: Object.values(data.branches),
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user