Commit 7fc149d8 by AlexNasyr

requestt class "from SM" added

parent 0ebf45b7
......@@ -31,7 +31,7 @@ namespace SocialMinistryDataExchange.Controllers {
[HttpGet]
[Route("[controller]/getpersonFixDoc")]
public async Task<List<SMResponce>> GetPersonFixDoc() {
var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMRequest() { rowguid_eais = "223322", document_seria = "V-II", document_number = "123456" }));
var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMPersonRequest() { rowguid_eais = "223322", document_seria = "V-II", document_number = "123456" }));
return result;
}
// запрос по серии/номеру документа личности
......@@ -39,7 +39,7 @@ namespace SocialMinistryDataExchange.Controllers {
[HttpGet]
[Route("[controller]/getpersonByDoc/{Rowguid}/{Seria}/{Number}")]
public async Task<List<SMResponce>> GetPersonFixDoc(string Rowguid, string Seria, string Number) {
var result = await _repository.GetPersonByDoc(JsonSerializer.Serialize(new SMRequest() { 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;
}
......@@ -51,5 +51,11 @@ namespace SocialMinistryDataExchange.Controllers {
var result = await _repository.GetPersonDefenceDemandByID(PersonID);
return result;
}
[HttpGet]
[Route("[controller]/getSMPersonNewDataRequest")]
public async Task<SMPersonNewDataRequest> GetSMPersonNewDataRequest() {
return new SMPersonNewDataRequest();
}
}
}
using Microsoft.EntityFrameworkCore;
......@@ -8,11 +8,11 @@ using System.Threading.Tasks;
#nullable disable
namespace SocialMinistryDataExchange.Model.DB.Center {
public partial class Контингент_center_Context : DbContext, IContingentContext {
public partial class Contingent_center_Context : DbContext, IContingentContext {
public Контингент_center_Context() {
public Contingent_center_Context() {
}
public Контингент_center_Context(DbContextOptions<Контингент_center_Context> options)
public Contingent_center_Context(DbContextOptions<Contingent_center_Context> options)
: base(options) {
}
......
......@@ -22,7 +22,7 @@ namespace SocialMinistryDataExchange.Model {
}
public Task<List<SMResponce>> GetPersonByDoc(string document) {
var doc = JsonSerializer.Deserialize<SMRequest>(document);
var doc = JsonSerializer.Deserialize<SMPersonRequest>(document);
try {
var records = (from pd in _contingentContext.ДокументЛичностиs
where pd.СерияДокумента == doc.document_seria && pd.НомерДокумента == doc.document_number
......
namespace SocialMinistryDataExchange.Model {
public class SMRequest {
using System;
namespace SocialMinistryDataExchange.Model {
public class SMPersonRequest {
public string rowguid_eais { get; set; }
public string document_seria { get; set; }
public string document_number { get; set; }
}
public class SMPersonNewDataRequest {
public string MsgID { get; set; }
public DateTime MsgDataTime { get; set; }
public Person Person { get; set; }
public string PersonStatus { get; set; }
public DateTime PersonStatusStartDate { get; set; }
public DateTime PersonStatusEndDate { get; set; }
public Person[] Relatives { get; set; }
public int FamilyPersonsCount { get; set; }
public double AvgIncome { get; set; }
public double MinIncome { get; set; }
public string Territory { get; set; }
}
public class Person {
public string rowguid_eais { get; set; }
public string? rowguid_contingent { get; set; }
public string PersonFamilyName { get; set; }
public string PersonName { get; set; }
public string PersonSurname { get; set; }
public DateTime PersonBirthday { get; set; }
public string PersonDocumentType { get; set; }
public string PersonDocumentSeria { get; set; }
public string PersonDocumentNumber { get; set; }
public DateTime PersonDocumentDate { get; set; }
public string? PersonSnils { get; set; }
public string? PersonAddress { get; set; }
public string? DependentPerson { get; set; }
public string? DependenceType { get; set; }
public int? DependenceCode { get; set; }
}
}
......@@ -25,8 +25,8 @@ namespace SocialMinistryDataExchange {
services.AddSwaggerGen(c => {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "SocialMinistryDataExchange", Version = "v1" });
});
services.AddDbContext<Êîíòèíãåíò_center_Context>(options => options.UseSqlServer(ConnectionString));
services.AddTransient<IContingentContext, Êîíòèíãåíò_center_Context>();
services.AddDbContext<Contingent_center_Context>(options => options.UseSqlServer(ConnectionString));
services.AddTransient<IContingentContext, Contingent_center_Context>();
services.AddTransient<ISMRepository, SMRepository>();
}
......
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