This commit is contained in:
2021-05-01 00:54:53 +00:00
parent 89d6f18ab0
commit ac0704c6c5
4 changed files with 9 additions and 9 deletions

2
.vscode/launch.json vendored
View File

@@ -53,7 +53,7 @@
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles", "AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles", "AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles", "AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
"AYANOVA_SERVER_TEST_MODE": "true", "AYANOVA_SERVER_TEST_MODE": "false",
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small", "AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7", "AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\" "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"

View File

@@ -194,9 +194,9 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(new return Ok(ApiOkResponse.Response(new
{ {
customerpost = new PostalAddressRecord(cust.PostAddress, cust.PostCity, cust.PostRegion, cust.PostCountry, cust.PostCode), customerpost = new PostalAddressRecord(cust.Name, cust.PostAddress, cust.PostCity, cust.PostRegion, cust.PostCountry, cust.PostCode),
customerphys = new AddressRecord(cust.Address, cust.City, cust.Region, cust.Country, cust.Latitude, cust.Longitude), customerphys = new AddressRecord(cust.Name, cust.Address, cust.City, cust.Region, cust.Country, cust.Latitude, cust.Longitude),
headofficepost = (head != null ? new PostalAddressRecord(head.PostAddress, head.PostCity, head.PostRegion, head.PostCountry, head.PostCode) : new PostalAddressRecord("", "", "", "", "")) headofficepost = (head != null ? new PostalAddressRecord(head.Name, head.PostAddress, head.PostCity, head.PostRegion, head.PostCountry, head.PostCode) : new PostalAddressRecord("", "", "", "", "", ""))
})); }));
} }

View File

@@ -152,11 +152,11 @@ namespace AyaNova.Api.Controllers
/// <summary> /// <summary>
/// Get service (physical) address for this Unit /// Get service address for this Unit
/// </summary> /// </summary>
/// <param name="id"></param> /// <param name="id"></param>
/// <returns>Service address</returns> /// <returns>Service address</returns>
[HttpGet("service-address/{id}")] [HttpGet("address/{id}")]
public async Task<IActionResult> GetUnitServiceAddress([FromRoute] long id) public async Task<IActionResult> GetUnitServiceAddress([FromRoute] long id)
{ {
if (!serverState.IsOpen) if (!serverState.IsOpen)
@@ -171,7 +171,7 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(new return Ok(ApiOkResponse.Response(new
{ {
unit = new AddressRecord(unt.Address, unt.City, unt.Region, unt.Country, unt.Latitude, unt.Longitude) unit = new AddressRecord(unt.Serial, unt.Address, unt.City, unt.Region, unt.Country, unt.Latitude, unt.Longitude)
})); }));
} }

View File

@@ -2,7 +2,7 @@
namespace AyaNova.Models namespace AyaNova.Models
{ {
//physical //physical
public record AddressRecord(string Address, string City, string Region, string Country, decimal? Latitude, decimal? Longitude); public record AddressRecord(string Name, string Address, string City, string Region, string Country, decimal? Latitude, decimal? Longitude);
//postal //postal
public record PostalAddressRecord(string PostAddress, string PostCity, string PostRegion, string PostCountry, string PostCode); public record PostalAddressRecord(string Name, string PostAddress, string PostCity, string PostRegion, string PostCountry, string PostCode);
} }