개정판 4487f701
issue #000 DocInfoRepository and unit test project 완료.
Change-Id: Ib0047cb9839453e6073263e74b9dffbd9dc6eda7
ConvertService/ServiceBase/Markus.Service.DataBase.Dapper/Repositories/DOCINFORepository.cs | ||
---|---|---|
33 | 33 |
var tran = BeginTransaction(); |
34 | 34 |
|
35 | 35 |
var parameters = new MixParameters(DBMS); |
36 |
parameters.Add("CONVERT_ID", convertDocID, dbType: DbType.String);
|
|
37 |
parameters.Add("PAGE_COUNT", PageCount, dbType: DbType.Int32);
|
|
38 |
parameters.Add("NewID", dbType: DbType.String, direction: ParameterDirection.Output, size: 50);
|
|
39 |
parameters.Add("ErrorCode", dbType: DbType.Int32, direction: ParameterDirection.Output);
|
|
40 |
parameters.Add("Error", dbType: DbType.String, direction: ParameterDirection.Output, size: 500);
|
|
36 |
parameters.Add("@convert_id", convertDocID, dbType: DbType.String);
|
|
37 |
parameters.Add("@page_count", PageCount, dbType: DbType.Int32);
|
|
38 |
parameters.Add("@newid", dbType: DbType.String, direction: ParameterDirection.Output, size: 50);
|
|
39 |
parameters.Add("@errorcode", dbType: DbType.Int32, direction: ParameterDirection.Output);
|
|
40 |
parameters.Add("@error", dbType: DbType.String, direction: ParameterDirection.Output, size: 500);
|
|
41 | 41 |
|
42 |
await base.ExecuteAsync("CONVERT_INSERT_DOCINFO", parameters, tran, commandType: CommandType.StoredProcedure);
|
|
42 |
await base.ExecuteAsync("convert_insert_docinfo", parameters, tran, commandType: CommandType.StoredProcedure);
|
|
43 | 43 |
|
44 |
var errorCode = parameters.Get<int>("ErrorCode");
|
|
45 |
var error = parameters.Get<string>("Error");
|
|
44 |
var errorCode = parameters.Get<int>("errorcode");
|
|
45 |
var error = parameters.Get<string>("error");
|
|
46 | 46 |
|
47 | 47 |
if (errorCode > 0) |
48 | 48 |
{ |
... | ... | |
53 | 53 |
{ |
54 | 54 |
tran.Commit(); |
55 | 55 |
|
56 |
result = parameters.Get<string>("NewID");
|
|
56 |
result = parameters.Get<string>("newid");
|
|
57 | 57 |
} |
58 | 58 |
|
59 | 59 |
return result; |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocInfo.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBaseDocInfo : TestBaseMSSQL |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("DocInfoInsert")]
|
|
10 |
public void DocInfoInsert()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype)) |
|
13 |
{ |
|
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
|
12 |
string newConvertDocID = string.Empty; |
|
15 | 13 |
|
16 |
for (int i = 0; i < 150000; i++)
|
|
17 |
{
|
|
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 });
|
|
19 |
}
|
|
14 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) {
|
|
15 |
newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult();
|
|
16 |
Console.WriteLine($"new id : {newConvertDocID}");
|
|
17 |
} |
|
20 | 18 |
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult(); |
|
19 |
if (!string.IsNullOrEmpty(newConvertDocID)) { |
|
20 |
using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype)) |
|
21 |
{ |
|
22 |
var result = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult(); |
|
22 | 23 |
|
23 |
Console.WriteLine($"new id : {result}"); |
|
24 |
Console.WriteLine($"new id : {result}"); |
|
25 |
} |
|
24 | 26 |
} |
25 | 27 |
} |
26 | 28 |
} |
ConvertService/ServiceBase/Markus.Service.DataBase.Test/DataBaseDocInfoPG.cs | ||
---|---|---|
6 | 6 |
{ |
7 | 7 |
public class DataBaseDocInfoPG : TestBasePG |
8 | 8 |
{ |
9 |
//[Test, Description("")]
|
|
10 |
public void DocPageInsert()
|
|
9 |
[Test, Description("DocInfoInsert")]
|
|
10 |
public void DocInfoInsert()
|
|
11 | 11 |
{ |
12 |
using (Markus.Service.DataBase.Repositories.DOCPAGERepository repository = new Repositories.DOCPAGERepository(ConnectionStr, dbtype)) |
|
12 |
string newConvertDocID = string.Empty; |
|
13 |
|
|
14 |
using (Markus.Service.DataBase.Repositories.ConvertDocRepository repository = new Repositories.ConvertDocRepository(ConnectionStr, dbtype)) |
|
13 | 15 |
{ |
14 |
List<Entities.DOCPAGE> pages = new List<Entities.DOCPAGE>(); |
|
16 |
newConvertDocID = repository.CreateAsync(ProjectNo, docUri, "111111").GetAwaiter().GetResult(); |
|
17 |
Console.WriteLine($"new id : {newConvertDocID}"); |
|
18 |
} |
|
15 | 19 |
|
16 |
for (int i = 0; i < 150000; i++) |
|
20 |
if (!string.IsNullOrEmpty(newConvertDocID)) |
|
21 |
{ |
|
22 |
using (Markus.Service.DataBase.Repositories.DOCINFORepository repository = new Repositories.DOCINFORepository(ConnectionStr, dbtype)) |
|
17 | 23 |
{ |
18 |
pages.Add(new Entities.DOCPAGE { DOCINFO_ID = "a764548c-9f44-4c4d-4597-f7ac43d2b7c1", PAGE_NUMBER = i+1, PAGE_WIDTH = "1210", PAGE_HEIGHT = "1210", PAGE_ANGLE = 0 }); |
|
19 |
} |
|
20 |
|
|
21 |
var result = repository.CreateAsync(pages).GetAwaiter().GetResult(); |
|
24 |
var result = repository.CreateAsync(newConvertDocID, 10).GetAwaiter().GetResult(); |
|
22 | 25 |
|
23 |
Console.WriteLine($"new id : {result}"); |
|
26 |
Console.WriteLine($"new id : {result}"); |
|
27 |
} |
|
24 | 28 |
} |
25 | 29 |
} |
26 | 30 |
} |
내보내기 Unified diff