Skip to content

Commit 7d6ec02

Browse files
authored
Push some controllers to contexts (#311)
Push SignupController, LoginController and API controllers for Connect Four and Chat to their respective contexts #269.
1 parent 7c3a484 commit 7d6ec02

File tree

24 files changed

+138
-141
lines changed

24 files changed

+138
-141
lines changed

config/chat/routing.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
chat_write_message:
2+
path: /api/chat/chats/{chatId}/write-message
3+
methods: [POST]
4+
controller: chat.chat-controller::writeMessageAction
5+
defaults: { _format: json }
6+
7+
chat_messages:
8+
path: /api/chat/chats/{chatId}/messages
9+
methods: [GET]
10+
controller: chat.chat-controller::messagesAction
11+
defaults: { _format: json }
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
chat.chat-controller:
3+
class: Gaming\Chat\Presentation\Http\ChatController
4+
arguments: ['@chat.command-bus', '@chat.query-bus', '@web-interface.security', '@gaming.usernames']
5+
tags: ['controller.service_arguments']

config/connect-four/routing.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,27 @@ connect_four_challenge:
1717
path: /challenge/{id}
1818
methods: [GET]
1919
controller: connect-four.challenge-controller::showAction
20+
21+
connect_four_abort_game:
22+
path: /api/connect-four/games/{gameId}/abort
23+
methods: [POST]
24+
controller: connect-four.game-controller::abortAction
25+
defaults: { _format: json }
26+
27+
connect_four_resign_game:
28+
path: /api/connect-four/games/{gameId}/resign
29+
methods: [POST]
30+
controller: connect-four.game-controller::resignAction
31+
defaults: { _format: json }
32+
33+
connect_four_join_game:
34+
path: /api/connect-four/games/{gameId}/join
35+
methods: [POST]
36+
controller: connect-four.game-controller::joinAction
37+
defaults: { _format: json }
38+
39+
connect_four_move_game:
40+
path: /api/connect-four/games/{gameId}/move
41+
methods: [POST]
42+
controller: connect-four.game-controller::moveAction
43+
defaults: { _format: json }

config/connect-four/services/controller.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ services:
1414
- '@gaming.usernames'
1515
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
1616
tags: ['controller.service_arguments', 'container.service_subscriber']
17+
18+
connect-four.game-controller:
19+
class: Gaming\ConnectFour\Port\Adapter\Http\GameController
20+
arguments: ['@connect-four.command-bus', '@web-interface.security']
21+
tags: ['controller.service_arguments']

config/identity/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ gaming_platform_bus:
1010
identity_command: ~
1111
identity_query: ~
1212

13+
twig:
14+
paths: { '%kernel.project_dir%/src/Identity/Port/Adapter/Http/View': identity }
15+
1316
doctrine:
1417
dbal:
1518
connections:

config/identity/routing.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
_symfony_logout:
2+
resource: security.route_loader.logout
3+
type: service
4+
5+
identity_signup:
6+
path: /signup
7+
methods: [GET, POST]
8+
controller: identity.signup-controller::indexAction
9+
10+
identity_signup_verify_email:
11+
path: /signup/verify-email
12+
methods: [GET]
13+
controller: identity.signup-controller::verifyEmailAction
14+
15+
identity_signup_confirm:
16+
path: /signup/confirm
17+
methods: [GET, POST]
18+
controller: identity.signup-controller::confirmAction
19+
20+
identity_login:
21+
path: /login
22+
methods: [GET, POST]
23+
controller: identity.login-controller::indexAction
24+
25+
identity_login_check_inbox:
26+
path: /login/check-inbox
27+
methods: [GET]
28+
controller: identity.login-controller::checkInboxAction
29+
30+
identity_login_check:
31+
path: /login/check
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
identity.signup-controller:
3+
class: Gaming\Identity\Port\Adapter\Http\SignupController
4+
arguments:
5+
- '@uri_signer'
6+
- '@web-interface.security'
7+
- '@identity.command-bus'
8+
- '@gaming.form-violation-mapper'
9+
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
10+
tags: ['controller.service_arguments', 'container.service_subscriber']
11+
12+
identity.login-controller:
13+
class: Gaming\Identity\Port\Adapter\Http\LoginController
14+
arguments:
15+
- '@security.authentication_utils'
16+
- '@security.authenticator.firewall_aware_login_link_handler'
17+
- '@uri_signer'
18+
- '@identity.query-bus'
19+
- '@gaming.form-violation-mapper'
20+
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
21+
tags: ['controller.service_arguments', 'container.service_subscriber']

config/web-interface/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ security:
2424
pattern: ^/
2525
lazy: true
2626
login_link:
27-
check_route: login_check
27+
check_route: identity_login_check
2828
signature_properties: ['userIdentifier']
2929
logout:
3030
path: /logout

config/web-interface/routing.yml

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
_symfony_logout:
2-
resource: security.route_loader.logout
3-
type: service
4-
5-
###############################################
6-
# Pages #
7-
###############################################
8-
91
lobby:
102
path: /
113
methods: [GET]
@@ -26,80 +18,8 @@ game:
2618
methods: [GET]
2719
controller: web-interface.page-controller::gameAction
2820

29-
signup:
30-
path: /signup
31-
methods: [GET, POST]
32-
controller: web-interface.signup-controller::indexAction
33-
34-
signup_verify_email:
35-
path: /signup/verify-email
36-
methods: [GET]
37-
controller: web-interface.signup-controller::verifyEmailAction
38-
39-
signup_confirm:
40-
path: /signup/confirm
41-
methods: [GET, POST]
42-
controller: web-interface.signup-controller::confirmAction
43-
44-
login:
45-
path: /login
46-
methods: [GET, POST]
47-
controller: web-interface.login-controller::indexAction
48-
49-
login_check_inbox:
50-
path: /login/check-inbox
51-
methods: [GET]
52-
controller: web-interface.login-controller::checkInboxAction
53-
54-
login_check:
55-
path: /login/check
56-
5721
server_time:
5822
path: /api/server-time
5923
methods: [GET]
6024
controller: web-interface.server-time-controller::serverTimeAction
6125
defaults: { _format: json }
62-
63-
###############################################
64-
# Chat Service #
65-
###############################################
66-
67-
write_message:
68-
path: /api/chat/chats/{chatId}/write-message
69-
methods: [POST]
70-
controller: web-interface.chat-controller::writeMessageAction
71-
defaults: { _format: json }
72-
73-
messages:
74-
path: /api/chat/chats/{chatId}/messages
75-
methods: [GET]
76-
controller: web-interface.chat-controller::messagesAction
77-
defaults: { _format: json }
78-
79-
###############################################
80-
# Connect Four Service #
81-
###############################################
82-
83-
abort:
84-
path: /api/connect-four/games/{gameId}/abort
85-
methods: [POST]
86-
controller: web-interface.connect-four-controller::abortAction
87-
defaults: { _format: json }
88-
89-
resign:
90-
path: /api/connect-four/games/{gameId}/resign
91-
methods: [POST]
92-
controller: web-interface.connect-four-controller::resignAction
93-
defaults: { _format: json }
94-
95-
join:
96-
path: /api/connect-four/games/{gameId}/join
97-
methods: [POST]
98-
controller: web-interface.connect-four-controller::joinAction
99-
defaults: { _format: json }
100-
101-
move:
102-
path: /api/connect-four/games/{gameId}/move
103-
methods: [POST]
104-
controller: web-interface.connect-four-controller::moveAction
105-
defaults: { _format: json }

config/web-interface/services/controller.yml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,6 @@ services:
55
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
66
tags: ['controller.service_arguments', 'container.service_subscriber']
77

8-
web-interface.signup-controller:
9-
class: Gaming\WebInterface\Presentation\Http\SignupController
10-
arguments:
11-
- '@uri_signer'
12-
- '@web-interface.security'
13-
- '@identity.command-bus'
14-
- '@gaming.form-violation-mapper'
15-
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
16-
tags: ['controller.service_arguments', 'container.service_subscriber']
17-
18-
web-interface.login-controller:
19-
class: Gaming\WebInterface\Presentation\Http\LoginController
20-
arguments:
21-
- '@security.authentication_utils'
22-
- '@security.authenticator.firewall_aware_login_link_handler'
23-
- '@uri_signer'
24-
- '@identity.query-bus'
25-
- '@gaming.form-violation-mapper'
26-
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
27-
tags: ['controller.service_arguments', 'container.service_subscriber']
28-
29-
web-interface.chat-controller:
30-
class: Gaming\WebInterface\Presentation\Http\ChatController
31-
arguments: ['@chat.command-bus', '@chat.query-bus', '@web-interface.security', '@gaming.usernames']
32-
tags: ['controller.service_arguments']
33-
34-
web-interface.connect-four-controller:
35-
class: Gaming\WebInterface\Presentation\Http\ConnectFourController
36-
arguments: ['@connect-four.command-bus', '@web-interface.security']
37-
tags: ['controller.service_arguments']
38-
398
web-interface.server-time-controller:
409
class: Gaming\WebInterface\Presentation\Http\ServerTimeController
4110
tags: ['controller.service_arguments']

0 commit comments

Comments
 (0)