Commit fc5ed2c5 by AlexNasyr

multiple persons request realized

parent 5fe0353f
...@@ -12,23 +12,29 @@ namespace SocialMinistryDataExchange.Controllers { ...@@ -12,23 +12,29 @@ namespace SocialMinistryDataExchange.Controllers {
_repository = repository; _repository = repository;
} }
// тестовый запрос с фиксированным документом личности // тестовый запрос с фиксированным документом личности
[HttpGet] [HttpGet]
[Route("[controller]/getpersonFixDoc")] [Route("[controller]/getpersonFixDoc")]
public async Task<SMResponce> GetPersonFixDoc() { public async Task<List<SMResponce>> GetPersonFixDoc() {
var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMPersonRequest() { rowguid_eais = "223322", document_seria = "V-II", document_number = "123456" })); var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new List<SMPersonRequest>() { new SMPersonRequest() { rowguid_eais = "223322", document_seria = "V-II", document_number = "123456" } }));
//var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new List<SMPersonRequest>() { new SMPersonRequest() { rowguid_eais = "223322", document_seria = "V-II", document_number = "123456" }, new SMPersonRequest() { rowguid_eais = "322223", document_seria = "1234", document_number = "123456" } }));
return result; return result;
} }
// тестовый запрос для получения json формата
[HttpGet]
[Route("[controller]/getSMPersonNewDataRequest")]
public async Task<SMPersonNewDataRequest> GetSMPersonNewDataRequest() {
return new SMPersonNewDataRequest();
}
// запрос по серии/номеру документа личности // запрос по серии/номеру документа личности
//[HttpPost] //[HttpPost]
[HttpGet] [HttpGet]
[Route("[controller]/getpersonByDoc/{Rowguid}/{Seria}/{Number}")] [Route("[controller]/getpersonByDoc/{Rowguid}/{Seria}/{Number}")]
public async Task<SMResponce> GetPersonByDoc(string Rowguid, string Seria, string Number) { public async Task<List<SMResponce>> GetPersonByDoc(string Rowguid, string Seria, string Number) {
var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMPersonRequest() { rowguid_eais = Rowguid, document_seria = Seria, document_number = Number })); var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMPersonRequest() { rowguid_eais = Rowguid, document_seria = Seria, document_number = Number }));
return result; return result;
} }
// запрос статуса нуждаемости по guid личности // запрос статуса нуждаемости по guid личности
//[HttpPost] //[HttpPost]
[HttpGet] [HttpGet]
...@@ -38,10 +44,5 @@ namespace SocialMinistryDataExchange.Controllers { ...@@ -38,10 +44,5 @@ namespace SocialMinistryDataExchange.Controllers {
return result; return result;
} }
[HttpGet]
[Route("[controller]/getSMPersonNewDataRequest")]
public async Task<SMPersonNewDataRequest> GetSMPersonNewDataRequest() {
return new SMPersonNewDataRequest();
}
} }
} }
...@@ -3,7 +3,7 @@ using System.Threading.Tasks; ...@@ -3,7 +3,7 @@ using System.Threading.Tasks;
namespace SocialMinistryDataExchange.Model { namespace SocialMinistryDataExchange.Model {
public interface ISMRepository { public interface ISMRepository {
Task<SMResponce> GetPersonByDoc(string Document); Task<List<SMResponce>> GetPersonByDoc(string Document);
Task<SMDefenceDemandResponce> GetPersonDefenceDemandByID(string PersonID); Task<SMDefenceDemandResponce> GetPersonDefenceDemandByID(string PersonID);
} }
} }
...@@ -12,24 +12,29 @@ namespace SocialMinistryDataExchange.Model { ...@@ -12,24 +12,29 @@ namespace SocialMinistryDataExchange.Model {
public string MsgID { get; set; } public string MsgID { get; set; }
public DateTime MsgDataTime { get; set; } public DateTime MsgDataTime { get; set; }
public string? MsgPriority { get; set; } public string? MsgPriority { get; set; }
public CocialDefenceStatusMessage MsgData { get; set; }
}
public class CocialDefenceStatusMessage {
public Person Person { get; set; } public Person Person { get; set; }
public string PersonStatus { get; set; } public PersonCocialDefenceStatus PersonStatus { get; set; }
public Person[]? Relatives { get; set; }
}
public class PersonCocialDefenceStatus {
public int Status { get; set; }
public DateTime PersonStatusStartDate { get; set; } public DateTime PersonStatusStartDate { get; set; }
public DateTime PersonStatusEndDate { get; set; } public DateTime PersonStatusEndDate { get; set; }
public Person[] Relatives { get; set; } public int? FamilyPersonsCount { get; set; }
public int FamilyPersonsCount { get; set; } public double? AvgIncome { get; set; }
public double AvgIncome { get; set; } public double? MinIncome { get; set; }
public double MinIncome { get; set; }
public string Territory { get; set; }
} }
public class Person { public class Person {
public string rowguid_eais { get; set; } public string rowguid_eais { get; set; }
public string? rowguid_contingent { get; set; } public string? rowguid_contingent { get; set; }
public string PersonFamilyName { get; set; } public string PersonFamilyName { get; set; }
public string PersonName { get; set; } public string PersonName { get; set; }
public string PersonSurname { get; set; } public string? PersonSurname { get; set; }
public DateTime PersonBirthday { get; set; } public DateTime PersonBirthday { get; set; }
public string PersonDocumentType { get; set; } public int PersonDocumentType { get; set; }
public string PersonDocumentSeria { get; set; } public string PersonDocumentSeria { get; set; }
public string PersonDocumentNumber { get; set; } public string PersonDocumentNumber { get; set; }
public DateTime PersonDocumentDate { get; set; } public DateTime PersonDocumentDate { get; set; }
...@@ -37,5 +42,7 @@ namespace SocialMinistryDataExchange.Model { ...@@ -37,5 +42,7 @@ namespace SocialMinistryDataExchange.Model {
public string? PersonAddress { get; set; } public string? PersonAddress { get; set; }
public string? DependentPerson { get; set; } public string? DependentPerson { get; set; }
public string? DependenceType { get; set; } public string? DependenceType { get; set; }
public string? Territory { get; set; }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment