Compare commits
3 Commits
e931822010
...
0c94d16b19
Author | SHA1 | Date | |
---|---|---|---|
0c94d16b19 | |||
d69589c781 | |||
d171c72dcf |
@ -6,39 +6,37 @@ import {
|
|||||||
Param,
|
Param,
|
||||||
ParseIntPipe,
|
ParseIntPipe,
|
||||||
Post,
|
Post,
|
||||||
Query,
|
Query, UseGuards
|
||||||
} from "@nestjs/common";
|
} from '@nestjs/common';
|
||||||
import { AuthorsService } from "apps/backend/src/app/authors/authors.service";
|
import { AuthorsService } from "apps/backend/src/app/authors/authors.service";
|
||||||
|
import { AdminGuard } from 'apps/backend/src/app/auth/auth.guard';
|
||||||
|
|
||||||
@Controller("authors")
|
@Controller("authors")
|
||||||
export class AuthorsController {
|
export class AuthorsController {
|
||||||
constructor(private readonly authorService: AuthorsService) {}
|
constructor(private readonly authorService: AuthorsService) {}
|
||||||
|
|
||||||
@Get()
|
@Get("find")
|
||||||
async findMany(
|
async findMany(
|
||||||
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
||||||
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
|
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
|
||||||
@Query("search", new DefaultValuePipe("")) search: string,
|
@Query("search", new DefaultValuePipe("")) search: string,
|
||||||
) {
|
) {}
|
||||||
const query = { limit, offset, search };
|
|
||||||
}
|
|
||||||
|
|
||||||
//POST a new group
|
//TODO DTO
|
||||||
@Post("new")
|
@Post("new")
|
||||||
async newAuthor() {}
|
async newAuthor() {}
|
||||||
|
|
||||||
//DELETE a group
|
@UseGuards(AdminGuard)
|
||||||
@Delete(":authorId")
|
@Delete(":autor")
|
||||||
async deleteAuthor(@Param("authorId") authorId: string) {}
|
async deleteAuthor(@Param("machineId") machineId: string) {}
|
||||||
|
|
||||||
//GET files associated to authors with limit and offset
|
//TODO Patch
|
||||||
@Get(":authorId")
|
|
||||||
async getForAuthor(
|
@Get(":author/files")
|
||||||
|
async getFilesForAuthor(
|
||||||
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
||||||
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
|
@Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number,
|
||||||
@Query("search", new DefaultValuePipe("")) search: string,
|
@Query("search", new DefaultValuePipe("")) search: string,
|
||||||
@Param("authorId") authorId: string,
|
@Param("machineId") machineId: string,
|
||||||
) {
|
) {}
|
||||||
const query = { limit, offset, search };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ export class GroupsController {
|
|||||||
@Query("search", new DefaultValuePipe("")) search: string,
|
@Query("search", new DefaultValuePipe("")) search: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
//TODO DTO
|
||||||
@Post("new")
|
@Post("new")
|
||||||
async newGroup() {}
|
async newGroup() {}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ export class MachinesController {
|
|||||||
@Query("search", new DefaultValuePipe("")) search: string,
|
@Query("search", new DefaultValuePipe("")) search: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
//TODO DTO
|
||||||
@UseGuards(AdminGuard)
|
@UseGuards(AdminGuard)
|
||||||
@Post("new")
|
@Post("new")
|
||||||
async newMachine() {}
|
async newMachine() {}
|
||||||
@ -34,6 +35,8 @@ export class MachinesController {
|
|||||||
|
|
||||||
//TODO Patch
|
//TODO Patch
|
||||||
|
|
||||||
|
//TODO CRUD fileType associated to machine
|
||||||
|
|
||||||
@Get(":machineId/files")
|
@Get(":machineId/files")
|
||||||
async getFilesForMachine(
|
async getFilesForMachine(
|
||||||
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
@Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user