forked from php-coder/query2app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.yaml
98 lines (94 loc) · 2.16 KB
/
endpoints.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
- path: /v1/categories/count
get:
query: SELECT COUNT(*) AS counter FROM categories
dto:
name: CounterDto
fields:
counter:
type: integer
- path: /v1/categories/stat
get:
aggregated_queries:
total: SELECT COUNT(*) FROM categories
in_russian: SELECT COUNT(*) FROM categories WHERE name_ru IS NOT NULL
in_english: SELECT COUNT(*) FROM categories WHERE name IS NOT NULL
fully_translated: SELECT COUNT(*) FROM categories WHERE name IS NOT NULL AND name_ru IS NOT NULL
- path: /v1/collections/:collectionId/categories/count
get:
query: |-
-- comment
SELECT COUNT(DISTINCT s.category_id) AS counter
-- comment2
FROM collections_series cs
-- comment3
JOIN series s
ON s.id = cs.series_id
WHERE cs.collection_id = :p.collectionId
dto:
fields:
counter:
type: integer
- path: /v1/categories
get_list:
query: |-
SELECT id
, name
, name_ru
, slug
FROM categories
dto:
name: CategoryDto
fields:
id:
type: integer
post:
query: |-
INSERT
INTO categories
( name
, name_ru
, slug
, created_at
, created_by
, updated_at
, updated_by
)
VALUES
( :b.name
, :b.name_ru
, :b.slug
, NOW()
, :b.user_id
, NOW()
, :b.user_id
)
dto:
name: CreateCategoryDto
- path: /v1/categories/:categoryId
get:
query: |-
SELECT id
, name
, name_ru
, slug
FROM categories
WHERE id = :p.categoryId
dto:
name: CategoryInfoDto
fields:
id:
type: integer
put:
query: |-
UPDATE categories
SET name = :b.name
, name_ru = :b.name_ru
, slug = :b.slug
, updated_at = NOW()
, updated_by = :b.user_id
WHERE id = :p.categoryId
delete:
query: |-
DELETE
FROM categories
WHERE id = :p.categoryId