Skip to content

Commit d638e3c

Browse files
committed
#86 : ApiGetRecCount, ApiGetRecord, ApiTableInfo, makefile
1 parent 0386451 commit d638e3c

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

src/restapi/ApiGetRecCount.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ StkObject* ApiGetRecCount::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t Ur
4040
StkObject* TableNameObj = new StkObject(L"TableName");
4141
StkObject* TargetTableNameObj = new StkObject(L"Name", TableNameAc);
4242
DaTableName->GetTables(TableNameObj, StateMsg, Msg, 1024);
43-
bool TblFound = FALSE;
43+
bool TblFound = false;
4444
if (TableNameObj->Contains(TargetTableNameObj) != NULL) {
45-
TblFound = TRUE;
45+
TblFound = true;
4646
}
4747
delete TargetTableNameObj;
4848
delete TableNameObj;
@@ -56,7 +56,7 @@ StkObject* ApiGetRecCount::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t Ur
5656
// Get records
5757
DbAccessor* Da = OdbcManager::GetInstance()->CreateAccessorObject(DbmsType);
5858
StkObject* ColumnObj = new StkObject(L"Column");
59-
int NumOfRecs = Da->GetNumOfRecords(TableNameAc, StateMsg, Msg, 1024);
59+
int NumOfRecs = Da->GetNumOfRecords((SQLTCHAR*)TableNameAc, StateMsg, Msg, 1024);
6060
OdbcManager::GetInstance()->DeleteAccessorObject(Da);
6161

6262
StkObject* DataObj = new StkObject(L"Data");

src/restapi/ApiGetRecord.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ StkObject* ApiGetRecord::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t UrlP
7777
StkObject* TableNameObj = new StkObject(L"TableName");
7878
StkObject* TargetTableNameObj = new StkObject(L"Name", TableNameAc);
7979
DaTableName->GetTables(TableNameObj, StateMsg, Msg, 1024);
80-
bool TblFound = FALSE;
80+
bool TblFound = false;
8181
if (TableNameObj->Contains(TargetTableNameObj) != NULL) {
82-
TblFound = TRUE;
82+
TblFound = true;
8383
}
8484
delete TargetTableNameObj;
8585
delete TableNameObj;
@@ -96,7 +96,7 @@ StkObject* ApiGetRecord::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t UrlP
9696
int NumOfCols = Da->GetColumnInfoByTableName((SQLTCHAR*)TableNameAc, ColumnObj, StateMsg, Msg, 1024);
9797
delete ColumnObj;
9898
StkObject* DatObj = new StkObject(L"Data");
99-
int NumOfRecs = Da->GetRecordsByTableName(TableNameAc, NumOfCols, DatObj, SortColumnNameAc, SortOrder, LimitInt, OffsetInt, StateMsg, Msg, 1024);
99+
int NumOfRecs = Da->GetRecordsByTableName((SQLTCHAR*)TableNameAc, NumOfCols, DatObj, SortColumnNameAc, SortOrder, LimitInt, OffsetInt, StateMsg, Msg, 1024);
100100
OdbcManager::GetInstance()->DeleteAccessorObject(Da);
101101

102102
if (SortColumnNameAc != NULL && *SortColumnNameAc != L'\0') {

src/restapi/ApiGetTableInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ StkObject* ApiGetTableInfo::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t U
3333
DbAccessor* Da = OdbcManager::GetInstance()->CreateAccessorObject(DbmsType);
3434
Da->GetTables(DatObj, StateMsg, Msg, 1024);
3535

36-
if (lstrcmp(TableName, L"") != 0) {
36+
if (StkPlWcsCmp(TableName, L"") != 0) {
3737
wchar_t TableNameAc[768];
3838
DecodeURL(TableName, 768, TableNameAc, 768);
3939

@@ -46,7 +46,7 @@ StkObject* ApiGetTableInfo::ExecuteImpl(StkObject* ReqObj, int Method, wchar_t U
4646
StkObject* DatObj2 = new StkObject(L"Data");
4747
DatObj2->AppendChildElement(TblInfObj);
4848

49-
Da->GetColumnInfoByTableName(TableNameAc, TblInfObj, StateMsg, Msg, 1024);
49+
Da->GetColumnInfoByTableName((SQLTCHAR*)TableNameAc, TblInfObj, StateMsg, Msg, 1024);
5050

5151
*ResultCode = 200;
5252
AddCodeAndMsg(ResObj, 0, L"", L"");

src/restapi/makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
LDFLAGS = -L/usr/local/lib64 -L/usr/local/lib
22
LIBS = -lssl -lcrypto -lstdc++
33

4-
sample : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o
4+
sample : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o
55
cd ../../../YaizuComLib/src/stkpl; make
66
cp ../../../YaizuComLib/src/stkpl/stkpl.a .
77
cd ../../../YaizuComLib/src/stkwebapp; make
@@ -17,7 +17,7 @@ sample : CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o
1717
cd ../../../YaizuComLib/src/stkdata; make
1818
cp ../../../YaizuComLib/src/stkdata/stkdata.a .
1919

20-
g++ -o sample CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o stkpl.a stkwebapp.a stkwebapp_um.a commonfunc.a stksocket.a stkthread.a stkdata.a -std=c++1z -lstdc++fs -pthread -static-libgcc $(LDFLAGS) $(LIBS)
20+
g++ -o sample CmdFreakRestApi.o MyMsgProc.o dataaccess.o ApiGetSystem.o ApiGetRecCount.o ApiGetRecord.o ApiGetTableInfo.o stkpl.a stkwebapp.a stkwebapp_um.a commonfunc.a stksocket.a stkthread.a stkdata.a -std=c++1z -lstdc++fs -pthread -static-libgcc $(LDFLAGS) $(LIBS)
2121

2222
CmdFreakRestApi.o : CmdFreakRestApi.cpp
2323
g++ -c CmdFreakRestApi.cpp -std=c++1z
@@ -31,6 +31,15 @@ dataaccess.o : dataaccess.cpp
3131
ApiGetSystem.o : ApiGetSystem.cpp
3232
g++ -c ApiGetSystem.cpp -std=c++1z
3333

34+
ApiGetRecCount.o : ApiGetRecCount.cpp
35+
g++ -c ApiGetRecCount.cpp -std=c++1z
36+
37+
ApiGetRecord.o : ApiGetRecord.cpp
38+
g++ -c ApiGetRecord.cpp -std=c++1z
39+
40+
ApiGetTableInfo.o : ApiGetTableInfo.cpp
41+
g++ -c ApiGetTableInfo.cpp -std=c++1z
42+
3443
clean :
3544
rm -f *.o *.a sample
3645
cd ../../../YaizuComLib/src/stkpl; make clean

0 commit comments

Comments
 (0)