File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828use OCP \Capabilities \ICapability ;
2929
3030class Capabilities implements ICapability {
31+ /**
32+ * @return array{files: array{comments: bool}}
33+ */
3134 public function getCapabilities (): array {
3235 return [
3336 'files ' => [
Original file line number Diff line number Diff line change 2727use OCP \AppFramework \Controller ;
2828use OCP \AppFramework \Http \NotFoundResponse ;
2929use OCP \AppFramework \Http \RedirectResponse ;
30- use OCP \AppFramework \Http \ Response ;
30+ use OCP \AppFramework \Http ;
3131use OCP \Comments \IComment ;
3232use OCP \Comments \ICommentsManager ;
3333use OCP \Files \IRootFolder ;
3838use OCP \Notification \IManager ;
3939
4040/**
41- * Class NotificationsController
42- *
4341 * @package OCA\Comments\Controller
4442 */
4543class NotificationsController extends Controller {
@@ -73,8 +71,17 @@ public function __construct(
7371 /**
7472 * @PublicPage
7573 * @NoCSRFRequired
74+ *
75+ * View a notification
76+ *
77+ * @param string $id ID of the notification
78+ *
79+ * @return RedirectResponse<Http::STATUS_SEE_OTHER, array{}>|NotFoundResponse<Http::STATUS_NOT_FOUND, array{}>
80+ *
81+ * 303: Redirected to notification
82+ * 404: Notification not found
7683 */
77- public function view (string $ id ): Response {
84+ public function view (string $ id ): RedirectResponse | NotFoundResponse {
7885 $ currentUser = $ this ->userSession ->getUser ();
7986 if (!$ currentUser instanceof IUser) {
8087 return new RedirectResponse (
Original file line number Diff line number Diff line change 1+ {
2+ "openapi" : " 3.0.3" ,
3+ "info" : {
4+ "title" : " comments" ,
5+ "version" : " 0.0.1" ,
6+ "description" : " Files app plugin to add comments to files" ,
7+ "license" : {
8+ "name" : " agpl"
9+ }
10+ },
11+ "components" : {
12+ "securitySchemes" : {
13+ "basic_auth" : {
14+ "type" : " http" ,
15+ "scheme" : " basic"
16+ },
17+ "bearer_auth" : {
18+ "type" : " http" ,
19+ "scheme" : " bearer"
20+ }
21+ },
22+ "schemas" : {
23+ "Capabilities" : {
24+ "type" : " object" ,
25+ "required" : [
26+ " files"
27+ ],
28+ "properties" : {
29+ "files" : {
30+ "type" : " object" ,
31+ "required" : [
32+ " comments"
33+ ],
34+ "properties" : {
35+ "comments" : {
36+ "type" : " boolean"
37+ }
38+ }
39+ }
40+ }
41+ }
42+ }
43+ },
44+ "paths" : {
45+ "/index.php/apps/comments/notifications/view/{id}" : {
46+ "get" : {
47+ "operationId" : " notifications-view" ,
48+ "summary" : " View a notification" ,
49+ "tags" : [
50+ " notifications"
51+ ],
52+ "security" : [
53+ {},
54+ {
55+ "bearer_auth" : []
56+ },
57+ {
58+ "basic_auth" : []
59+ }
60+ ],
61+ "parameters" : [
62+ {
63+ "name" : " id" ,
64+ "in" : " path" ,
65+ "description" : " ID of the notification" ,
66+ "required" : true ,
67+ "schema" : {
68+ "type" : " string"
69+ }
70+ }
71+ ],
72+ "responses" : {
73+ "303" : {
74+ "description" : " Redirected to notification" ,
75+ "headers" : {
76+ "Location" : {
77+ "schema" : {
78+ "type" : " string"
79+ }
80+ }
81+ }
82+ },
83+ "404" : {
84+ "description" : " Notification not found" ,
85+ "content" : {
86+ "text/html" : {
87+ "schema" : {
88+ "type" : " string"
89+ }
90+ }
91+ }
92+ }
93+ }
94+ }
95+ }
96+ },
97+ "tags" : []
98+ }
You can’t perform that action at this time.
0 commit comments