Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Marat Pavlov
/
AlexAdapter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fc5ed2c5
authored
Mar 25, 2022
by
AlexNasyr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple persons request realized
parent
5fe0353f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
19 deletions
SocialMinistryDataExchange/Controllers/apiController.cs
SocialMinistryDataExchange/Model/ISMRepository.cs
SocialMinistryDataExchange/Model/SMRepository.cs
SocialMinistryDataExchange/Model/SMRequest.cs
SocialMinistryDataExchange/Controllers/apiController.cs
View file @
fc5ed2c5
...
...
@@ -12,23 +12,29 @@ namespace SocialMinistryDataExchange.Controllers {
_repository
=
repository
;
}
// тестовый запрос с фиксированным документом личности
[
HttpGet
]
[
Route
(
"[controller]/getpersonFixDoc"
)]
public
async
Task
<
SMResponce
>
GetPersonFixDoc
()
{
var
result
=
await
_repository
.
GetPersonByDoc
(
JsonSerializer
.
Serialize
(
new
SMPersonRequest
()
{
rowguid_eais
=
"223322"
,
document_seria
=
"V-II"
,
document_number
=
"123456"
}));
public
async
Task
<
List
<
SMResponce
>>
GetPersonFixDoc
()
{
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
;
}
// тестовый запрос для получения json формата
[
HttpGet
]
[
Route
(
"[controller]/getSMPersonNewDataRequest"
)]
public
async
Task
<
SMPersonNewDataRequest
>
GetSMPersonNewDataRequest
()
{
return
new
SMPersonNewDataRequest
();
}
// запрос по серии/номеру документа личности
//[HttpPost]
[
HttpGet
]
[
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
}));
return
result
;
}
// запрос статуса нуждаемости по guid личности
//[HttpPost]
[
HttpGet
]
...
...
@@ -38,10 +44,5 @@ namespace SocialMinistryDataExchange.Controllers {
return
result
;
}
[
HttpGet
]
[
Route
(
"[controller]/getSMPersonNewDataRequest"
)]
public
async
Task
<
SMPersonNewDataRequest
>
GetSMPersonNewDataRequest
()
{
return
new
SMPersonNewDataRequest
();
}
}
}
SocialMinistryDataExchange/Model/ISMRepository.cs
View file @
fc5ed2c5
...
...
@@ -3,7 +3,7 @@ using System.Threading.Tasks;
namespace
SocialMinistryDataExchange.Model
{
public
interface
ISMRepository
{
Task
<
SMResponce
>
GetPersonByDoc
(
string
Document
);
Task
<
List
<
SMResponce
>
>
GetPersonByDoc
(
string
Document
);
Task
<
SMDefenceDemandResponce
>
GetPersonDefenceDemandByID
(
string
PersonID
);
}
}
SocialMinistryDataExchange/Model/SMRepository.cs
View file @
fc5ed2c5
This diff is collapsed.
Click to expand it.
SocialMinistryDataExchange/Model/SMRequest.cs
View file @
fc5ed2c5
...
...
@@ -12,24 +12,29 @@ namespace SocialMinistryDataExchange.Model {
public
string
MsgID
{
get
;
set
;
}
public
DateTime
MsgDataTime
{
get
;
set
;
}
public
string
?
MsgPriority
{
get
;
set
;
}
public
CocialDefenceStatusMessage
MsgData
{
get
;
set
;
}
}
public
class
CocialDefenceStatusMessage
{
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
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
int
?
FamilyPersonsCount
{
get
;
set
;
}
public
double
?
AvgIncome
{
get
;
set
;
}
public
double
?
MinIncome
{
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
string
?
PersonSurname
{
get
;
set
;
}
public
DateTime
PersonBirthday
{
get
;
set
;
}
public
string
PersonDocumentType
{
get
;
set
;
}
public
int
PersonDocumentType
{
get
;
set
;
}
public
string
PersonDocumentSeria
{
get
;
set
;
}
public
string
PersonDocumentNumber
{
get
;
set
;
}
public
DateTime
PersonDocumentDate
{
get
;
set
;
}
...
...
@@ -37,5 +42,7 @@ namespace SocialMinistryDataExchange.Model {
public
string
?
PersonAddress
{
get
;
set
;
}
public
string
?
DependentPerson
{
get
;
set
;
}
public
string
?
DependenceType
{
get
;
set
;
}
public
string
?
Territory
{
get
;
set
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment