Skip to content

Commit a8c9c10

Browse files
committed
feat: das structure endpoints
1 parent 180e83a commit a8c9c10

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

app/controllers/v1/das.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Das from "#models/das";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasController extends BaseController<typeof Das> {
7+
protected readonly queryRelations = [
8+
"maps",
9+
"maps.content",
10+
"links",
11+
"stands",
12+
"stands.logo",
13+
];
14+
protected readonly crudRelations = ["maps", "links", "stands"];
15+
protected readonly model = Das;
16+
}

app/controllers/v1/das_links.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import DasLink from "#models/das_link";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasLinkController extends BaseController<typeof DasLink> {
7+
protected readonly queryRelations = ["das"];
8+
protected readonly crudRelations = [];
9+
protected readonly model = DasLink;
10+
}

app/controllers/v1/das_maps.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import DasMap from "#models/das_map";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasMapsController extends BaseController<typeof DasMap> {
7+
protected readonly queryRelations = ["das", "content"];
8+
protected readonly crudRelations = [];
9+
protected readonly model = DasMap;
10+
}

app/controllers/v1/das_stands.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import DasStand from "#models/das_stand";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasStandsController extends BaseController<
7+
typeof DasStand
8+
> {
9+
protected readonly queryRelations = ["das", "logo"];
10+
protected readonly crudRelations = [];
11+
protected readonly model = DasStand;
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import DasTimetableEntry from "#models/das_timetable_entry";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasTimetableEntriesController extends BaseController<
7+
typeof DasTimetableEntry
8+
> {
9+
protected readonly queryRelations = ["timetable"];
10+
protected readonly crudRelations = [];
11+
protected readonly model = DasTimetableEntry;
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import DasTimetable from "#models/das_timetable";
2+
3+
const { default: BaseController } = await (() =>
4+
import("#controllers/base_controller"))();
5+
6+
export default class DasTimetableController extends BaseController<
7+
typeof DasTimetable
8+
> {
9+
protected readonly queryRelations = ["das", "entries"];
10+
protected readonly crudRelations = ["entries"];
11+
protected readonly model = DasTimetable;
12+
}

0 commit comments

Comments
 (0)