File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change 3
3
namespace App \Controller \API ;
4
4
5
5
use App \DataTransferObject \ApiInfo ;
6
+ use App \DataTransferObject \ApiInfoProvider ;
6
7
use App \DataTransferObject \ApiVersion ;
7
8
use App \DataTransferObject \DomJudgeApiInfo ;
8
9
use App \DataTransferObject \ExtendedContestStatus ;
@@ -99,6 +100,10 @@ public function getInfoAction(
99
100
version: self ::CCS_SPEC_API_VERSION ,
100
101
versionUrl: self ::CCS_SPEC_API_URL ,
101
102
name: 'DOMjudge ' ,
103
+ provider: new ApiInfoProvider (
104
+ name: 'DOMjudge ' ,
105
+ version: $ this ->getParameter ('domjudge.version ' ),
106
+ ),
102
107
domjudge: $ domjudge
103
108
);
104
109
}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public function __construct(
10
10
public readonly string $ version ,
11
11
public readonly string $ versionUrl ,
12
12
public readonly string $ name ,
13
+ public readonly ?ApiInfoProvider $ provider ,
13
14
#[Serializer \Exclude(if: '!object.domjudge ' )]
14
15
public readonly ?DomJudgeApiInfo $ domjudge ,
15
16
) {}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace App \DataTransferObject ;
4
+
5
+ use JMS \Serializer \Annotation as Serializer ;
6
+
7
+ class ApiInfoProvider
8
+ {
9
+ public function __construct (
10
+ public readonly string $ name ,
11
+ public readonly string $ version ,
12
+ #[Serializer \Exclude(if: '!object.buildDate ' )]
13
+ public readonly ?string $ buildDate = null ,
14
+ ) {}
15
+ }
You can’t perform that action at this time.
0 commit comments