Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b601d8

Browse files
committed
CU-868f7n1u3 Adding in generic system level config for
1 parent16571c2 commit9b601d8

File tree

6 files changed

+793
-664
lines changed

6 files changed

+793
-664
lines changed

‎Core/Resgrid.Config/InfoConfig.cs‎

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespaceResgrid.Config
1+
usingSystem.Collections.Generic;
2+
3+
namespaceResgrid.Config
24
{
35
publicstaticclassInfoConfig
46
{
@@ -21,5 +23,39 @@ public static class InfoConfig
2123
publicstaticstringRelayAppKey="RelayAppKey";
2224

2325
publicstaticstringEmailProcessorKey="EmailProcessorKey";
26+
27+
publicstaticList<ResgridSystemLocation>Locations=newList<ResgridSystemLocation>()
28+
{
29+
newResgridSystemLocation()
30+
{
31+
Name="US-West",
32+
DisplayName="Resgrid North America",
33+
LocationInfo=
34+
"This is the Resgrid system hosted in the Western United States (private datacenter). This system services most Resgrid customers.",
35+
IsDefault=true,
36+
ApiUrl="https://api.resgrid.com",
37+
AllowsFreeAccounts=true
38+
},
39+
newResgridSystemLocation()
40+
{
41+
Name="EU-Central",
42+
DisplayName="Resgrid Europe",
43+
LocationInfo=
44+
"This is the Resgrid system hosted in Central Europe (on OVH). This system services Resgrid customers in the European Union to help with data compliance requirements.",
45+
IsDefault=false,
46+
ApiUrl="https://api.eu.resgrid.com",
47+
AllowsFreeAccounts=false
48+
}
49+
};
50+
}
51+
52+
publicclassResgridSystemLocation
53+
{
54+
publicstringName{get;set;}
55+
publicstringDisplayName{get;set;}
56+
publicstringLocationInfo{get;set;}
57+
publicboolIsDefault{get;set;}
58+
publicstringApiUrl{get;set;}
59+
publicboolAllowsFreeAccounts{get;set;}
2460
}
2561
}

‎Core/Resgrid.Config/SystemBehaviorConfig.cs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ public static class SystemBehaviorConfig
185185
/// </summary>
186186
publicstaticstringBlogUrl="https://blog.resgrid.com";
187187

188+
/// <summary>
189+
/// Sets the name of the location this Resgrid system is running in
190+
/// </summary>
191+
publicstaticstringLocationName="US-West";
192+
188193
publicstaticstringGetEnvPrefix()
189194
{
190195
switch(Environment)

‎Web/Resgrid.Web.Services/Controllers/v4/ConfigController.cs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ public ConfigController()
2424
}
2525
#endregion Members and Constructors
2626

27+
/// <summary>
28+
/// Gets the system config
29+
/// </summary>
30+
/// <returns></returns>
31+
[HttpGet("GetSystemConfig")]
32+
[ProducesResponseType(StatusCodes.Status200OK)]
33+
publicasyncTask<ActionResult<GetSystemConfigResult>>GetSystemConfig()
34+
{
35+
varresult=newGetSystemConfigResult();
36+
37+
result.PageSize=1;
38+
result.Status=ResponseHelper.Success;
39+
ResponseHelper.PopulateV4ResponseData(result);
40+
41+
returnresult;
42+
}
43+
2744
/// <summary>
2845
/// Gets the config values for a key
2946
/// </summary>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
usingSystem.Collections.Generic;
2+
usingResgrid.Config;
3+
4+
namespaceResgrid.Web.Services.Models.v4.Configs
5+
{
6+
/// <summary>
7+
/// Gets Configuration Information for the Resgrid System
8+
/// </summary>
9+
publicclassGetSystemConfigResult:StandardApiResponseV4Base
10+
{
11+
/// <summary>
12+
/// Response Data
13+
/// </summary>
14+
publicGetSystemConfigResultDataData{get;set;}
15+
16+
/// <summary>
17+
/// Default constructor
18+
/// </summary>
19+
publicGetSystemConfigResult()
20+
{
21+
Data=newGetSystemConfigResultData();
22+
}
23+
}
24+
25+
/// <summary>
26+
/// Information about the Resgrid System
27+
/// </summary>
28+
publicclassGetSystemConfigResultData
29+
{
30+
/// <summary>
31+
/// Resgrid Datacenter Locations
32+
/// </summary>
33+
publicList<ResgridSystemLocation>Locations{get;set;}
34+
35+
publicGetSystemConfigResultData()
36+
{
37+
Locations=InfoConfig.Locations;
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp