Release RecognizeQuotaInvoice RecognizeTicketInvoice RecognizePdf.
This commit is contained in:
@@ -45,12 +45,16 @@ set(ocr_public_header_model
|
||||
include/alibabacloud/ocr/model/RecognizeIdentityCardResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeLicensePlateRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeLicensePlateResult.h
|
||||
include/alibabacloud/ocr/model/RecognizePDFRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizePDFResult.h
|
||||
include/alibabacloud/ocr/model/RecognizePassportMRZRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizePassportMRZResult.h
|
||||
include/alibabacloud/ocr/model/RecognizePoiNameRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizePoiNameResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeQrCodeRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeQrCodeResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeQuotaInvoiceRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeQuotaInvoiceResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeStampRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeStampResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTableRequest.h
|
||||
@@ -59,6 +63,8 @@ set(ocr_public_header_model
|
||||
include/alibabacloud/ocr/model/RecognizeTakeoutOrderResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTaxiInvoiceRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTaxiInvoiceResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTicketInvoiceRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTicketInvoiceResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeTrainTicketRequest.h
|
||||
include/alibabacloud/ocr/model/RecognizeTrainTicketResult.h
|
||||
include/alibabacloud/ocr/model/RecognizeVATInvoiceRequest.h
|
||||
@@ -96,12 +102,16 @@ set(ocr_src
|
||||
src/model/RecognizeIdentityCardResult.cc
|
||||
src/model/RecognizeLicensePlateRequest.cc
|
||||
src/model/RecognizeLicensePlateResult.cc
|
||||
src/model/RecognizePDFRequest.cc
|
||||
src/model/RecognizePDFResult.cc
|
||||
src/model/RecognizePassportMRZRequest.cc
|
||||
src/model/RecognizePassportMRZResult.cc
|
||||
src/model/RecognizePoiNameRequest.cc
|
||||
src/model/RecognizePoiNameResult.cc
|
||||
src/model/RecognizeQrCodeRequest.cc
|
||||
src/model/RecognizeQrCodeResult.cc
|
||||
src/model/RecognizeQuotaInvoiceRequest.cc
|
||||
src/model/RecognizeQuotaInvoiceResult.cc
|
||||
src/model/RecognizeStampRequest.cc
|
||||
src/model/RecognizeStampResult.cc
|
||||
src/model/RecognizeTableRequest.cc
|
||||
@@ -110,6 +120,8 @@ set(ocr_src
|
||||
src/model/RecognizeTakeoutOrderResult.cc
|
||||
src/model/RecognizeTaxiInvoiceRequest.cc
|
||||
src/model/RecognizeTaxiInvoiceResult.cc
|
||||
src/model/RecognizeTicketInvoiceRequest.cc
|
||||
src/model/RecognizeTicketInvoiceResult.cc
|
||||
src/model/RecognizeTrainTicketRequest.cc
|
||||
src/model/RecognizeTrainTicketResult.cc
|
||||
src/model/RecognizeVATInvoiceRequest.cc
|
||||
|
||||
@@ -46,12 +46,16 @@
|
||||
#include "model/RecognizeIdentityCardResult.h"
|
||||
#include "model/RecognizeLicensePlateRequest.h"
|
||||
#include "model/RecognizeLicensePlateResult.h"
|
||||
#include "model/RecognizePDFRequest.h"
|
||||
#include "model/RecognizePDFResult.h"
|
||||
#include "model/RecognizePassportMRZRequest.h"
|
||||
#include "model/RecognizePassportMRZResult.h"
|
||||
#include "model/RecognizePoiNameRequest.h"
|
||||
#include "model/RecognizePoiNameResult.h"
|
||||
#include "model/RecognizeQrCodeRequest.h"
|
||||
#include "model/RecognizeQrCodeResult.h"
|
||||
#include "model/RecognizeQuotaInvoiceRequest.h"
|
||||
#include "model/RecognizeQuotaInvoiceResult.h"
|
||||
#include "model/RecognizeStampRequest.h"
|
||||
#include "model/RecognizeStampResult.h"
|
||||
#include "model/RecognizeTableRequest.h"
|
||||
@@ -60,6 +64,8 @@
|
||||
#include "model/RecognizeTakeoutOrderResult.h"
|
||||
#include "model/RecognizeTaxiInvoiceRequest.h"
|
||||
#include "model/RecognizeTaxiInvoiceResult.h"
|
||||
#include "model/RecognizeTicketInvoiceRequest.h"
|
||||
#include "model/RecognizeTicketInvoiceResult.h"
|
||||
#include "model/RecognizeTrainTicketRequest.h"
|
||||
#include "model/RecognizeTrainTicketResult.h"
|
||||
#include "model/RecognizeVATInvoiceRequest.h"
|
||||
@@ -115,6 +121,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::RecognizeLicensePlateResult> RecognizeLicensePlateOutcome;
|
||||
typedef std::future<RecognizeLicensePlateOutcome> RecognizeLicensePlateOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeLicensePlateRequest&, const RecognizeLicensePlateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeLicensePlateAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizePDFResult> RecognizePDFOutcome;
|
||||
typedef std::future<RecognizePDFOutcome> RecognizePDFOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizePDFRequest&, const RecognizePDFOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizePDFAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizePassportMRZResult> RecognizePassportMRZOutcome;
|
||||
typedef std::future<RecognizePassportMRZOutcome> RecognizePassportMRZOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizePassportMRZRequest&, const RecognizePassportMRZOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizePassportMRZAsyncHandler;
|
||||
@@ -124,6 +133,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::RecognizeQrCodeResult> RecognizeQrCodeOutcome;
|
||||
typedef std::future<RecognizeQrCodeOutcome> RecognizeQrCodeOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeQrCodeRequest&, const RecognizeQrCodeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeQrCodeAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeQuotaInvoiceResult> RecognizeQuotaInvoiceOutcome;
|
||||
typedef std::future<RecognizeQuotaInvoiceOutcome> RecognizeQuotaInvoiceOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeQuotaInvoiceRequest&, const RecognizeQuotaInvoiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeQuotaInvoiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeStampResult> RecognizeStampOutcome;
|
||||
typedef std::future<RecognizeStampOutcome> RecognizeStampOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeStampRequest&, const RecognizeStampOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeStampAsyncHandler;
|
||||
@@ -136,6 +148,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::RecognizeTaxiInvoiceResult> RecognizeTaxiInvoiceOutcome;
|
||||
typedef std::future<RecognizeTaxiInvoiceOutcome> RecognizeTaxiInvoiceOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTaxiInvoiceRequest&, const RecognizeTaxiInvoiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTaxiInvoiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTicketInvoiceResult> RecognizeTicketInvoiceOutcome;
|
||||
typedef std::future<RecognizeTicketInvoiceOutcome> RecognizeTicketInvoiceOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTicketInvoiceRequest&, const RecognizeTicketInvoiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTicketInvoiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeTrainTicketResult> RecognizeTrainTicketOutcome;
|
||||
typedef std::future<RecognizeTrainTicketOutcome> RecognizeTrainTicketOutcomeCallable;
|
||||
typedef std::function<void(const OcrClient*, const Model::RecognizeTrainTicketRequest&, const RecognizeTrainTicketOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeTrainTicketAsyncHandler;
|
||||
@@ -192,6 +207,9 @@ namespace AlibabaCloud
|
||||
RecognizeLicensePlateOutcome recognizeLicensePlate(const Model::RecognizeLicensePlateRequest &request)const;
|
||||
void recognizeLicensePlateAsync(const Model::RecognizeLicensePlateRequest& request, const RecognizeLicensePlateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeLicensePlateOutcomeCallable recognizeLicensePlateCallable(const Model::RecognizeLicensePlateRequest& request) const;
|
||||
RecognizePDFOutcome recognizePDF(const Model::RecognizePDFRequest &request)const;
|
||||
void recognizePDFAsync(const Model::RecognizePDFRequest& request, const RecognizePDFAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizePDFOutcomeCallable recognizePDFCallable(const Model::RecognizePDFRequest& request) const;
|
||||
RecognizePassportMRZOutcome recognizePassportMRZ(const Model::RecognizePassportMRZRequest &request)const;
|
||||
void recognizePassportMRZAsync(const Model::RecognizePassportMRZRequest& request, const RecognizePassportMRZAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizePassportMRZOutcomeCallable recognizePassportMRZCallable(const Model::RecognizePassportMRZRequest& request) const;
|
||||
@@ -201,6 +219,9 @@ namespace AlibabaCloud
|
||||
RecognizeQrCodeOutcome recognizeQrCode(const Model::RecognizeQrCodeRequest &request)const;
|
||||
void recognizeQrCodeAsync(const Model::RecognizeQrCodeRequest& request, const RecognizeQrCodeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeQrCodeOutcomeCallable recognizeQrCodeCallable(const Model::RecognizeQrCodeRequest& request) const;
|
||||
RecognizeQuotaInvoiceOutcome recognizeQuotaInvoice(const Model::RecognizeQuotaInvoiceRequest &request)const;
|
||||
void recognizeQuotaInvoiceAsync(const Model::RecognizeQuotaInvoiceRequest& request, const RecognizeQuotaInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeQuotaInvoiceOutcomeCallable recognizeQuotaInvoiceCallable(const Model::RecognizeQuotaInvoiceRequest& request) const;
|
||||
RecognizeStampOutcome recognizeStamp(const Model::RecognizeStampRequest &request)const;
|
||||
void recognizeStampAsync(const Model::RecognizeStampRequest& request, const RecognizeStampAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeStampOutcomeCallable recognizeStampCallable(const Model::RecognizeStampRequest& request) const;
|
||||
@@ -213,6 +234,9 @@ namespace AlibabaCloud
|
||||
RecognizeTaxiInvoiceOutcome recognizeTaxiInvoice(const Model::RecognizeTaxiInvoiceRequest &request)const;
|
||||
void recognizeTaxiInvoiceAsync(const Model::RecognizeTaxiInvoiceRequest& request, const RecognizeTaxiInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTaxiInvoiceOutcomeCallable recognizeTaxiInvoiceCallable(const Model::RecognizeTaxiInvoiceRequest& request) const;
|
||||
RecognizeTicketInvoiceOutcome recognizeTicketInvoice(const Model::RecognizeTicketInvoiceRequest &request)const;
|
||||
void recognizeTicketInvoiceAsync(const Model::RecognizeTicketInvoiceRequest& request, const RecognizeTicketInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTicketInvoiceOutcomeCallable recognizeTicketInvoiceCallable(const Model::RecognizeTicketInvoiceRequest& request) const;
|
||||
RecognizeTrainTicketOutcome recognizeTrainTicket(const Model::RecognizeTrainTicketRequest &request)const;
|
||||
void recognizeTrainTicketAsync(const Model::RecognizeTrainTicketRequest& request, const RecognizeTrainTicketAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeTrainTicketOutcomeCallable recognizeTrainTicketCallable(const Model::RecognizeTrainTicketRequest& request) const;
|
||||
|
||||
48
ocr/include/alibabacloud/ocr/model/RecognizePDFRequest.h
Normal file
48
ocr/include/alibabacloud/ocr/model/RecognizePDFRequest.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizePDFRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizePDFRequest();
|
||||
~RecognizePDFRequest();
|
||||
|
||||
std::string getFileURL()const;
|
||||
void setFileURL(const std::string& fileURL);
|
||||
|
||||
private:
|
||||
std::string fileURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFREQUEST_H_
|
||||
80
ocr/include/alibabacloud/ocr/model/RecognizePDFResult.h
Normal file
80
ocr/include/alibabacloud/ocr/model/RecognizePDFResult.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFRESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizePDFResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct WordsInfoItem
|
||||
{
|
||||
struct PositionsItem
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
std::string word;
|
||||
long angle;
|
||||
std::vector<WordsInfoItem::PositionsItem> positions;
|
||||
long x;
|
||||
long y;
|
||||
long height;
|
||||
long width;
|
||||
};
|
||||
std::vector<WordsInfoItem> wordsInfo;
|
||||
long orgWidth;
|
||||
long angle;
|
||||
long orgHeight;
|
||||
long height;
|
||||
long pageIndex;
|
||||
long width;
|
||||
};
|
||||
|
||||
|
||||
RecognizePDFResult();
|
||||
explicit RecognizePDFResult(const std::string &payload);
|
||||
~RecognizePDFResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEPDFRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeQuotaInvoiceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeQuotaInvoiceRequest();
|
||||
~RecognizeQuotaInvoiceRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICEREQUEST_H_
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeQuotaInvoiceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Content
|
||||
{
|
||||
std::string invoiceDetails;
|
||||
std::string invoiceCode;
|
||||
std::string invoiceNo;
|
||||
std::string invoiceAmount;
|
||||
std::string sumAmount;
|
||||
};
|
||||
struct KeyValueInfosItem
|
||||
{
|
||||
struct ValuePositionsItem
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
std::vector<KeyValueInfosItem::ValuePositionsItem> valuePositions;
|
||||
std::string value;
|
||||
float valueScore;
|
||||
std::string key;
|
||||
};
|
||||
long orgWidth;
|
||||
long angle;
|
||||
Content content;
|
||||
std::vector<KeyValueInfosItem> keyValueInfos;
|
||||
long orgHeight;
|
||||
long height;
|
||||
long width;
|
||||
};
|
||||
|
||||
|
||||
RecognizeQuotaInvoiceResult();
|
||||
explicit RecognizeQuotaInvoiceResult(const std::string &payload);
|
||||
~RecognizeQuotaInvoiceResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZEQUOTAINVOICERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICEREQUEST_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTicketInvoiceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeTicketInvoiceRequest();
|
||||
~RecognizeTicketInvoiceRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICEREQUEST_H_
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICERESULT_H_
|
||||
#define ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/ocr/OcrExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Ocr
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_OCR_EXPORT RecognizeTicketInvoiceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ResultsItem
|
||||
{
|
||||
struct Content
|
||||
{
|
||||
std::string payeeName;
|
||||
std::string antiFakeCode;
|
||||
std::string invoiceCode;
|
||||
std::string payeeRegisterNo;
|
||||
std::string payerRegisterNo;
|
||||
std::string invoiceNumber;
|
||||
std::string invoiceDate;
|
||||
std::string payerName;
|
||||
std::string sumAmount;
|
||||
};
|
||||
struct KeyValueInfosItem
|
||||
{
|
||||
struct ValuePositionsItem
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
std::vector<KeyValueInfosItem::ValuePositionsItem> valuePositions;
|
||||
std::string value;
|
||||
float valueScore;
|
||||
std::string key;
|
||||
};
|
||||
struct SliceRectangleItem
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
std::string type;
|
||||
std::vector<ResultsItem::SliceRectangleItem> sliceRectangle;
|
||||
Content content;
|
||||
std::vector<ResultsItem::KeyValueInfosItem> keyValueInfos;
|
||||
long index;
|
||||
};
|
||||
long orgWidth;
|
||||
std::vector<ResultsItem> results;
|
||||
long orgHeight;
|
||||
long height;
|
||||
long count;
|
||||
long width;
|
||||
};
|
||||
|
||||
|
||||
RecognizeTicketInvoiceResult();
|
||||
explicit RecognizeTicketInvoiceResult(const std::string &payload);
|
||||
~RecognizeTicketInvoiceResult();
|
||||
std::string getMessage()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_OCR_MODEL_RECOGNIZETICKETINVOICERESULT_H_
|
||||
@@ -483,6 +483,42 @@ OcrClient::RecognizeLicensePlateOutcomeCallable OcrClient::recognizeLicensePlate
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizePDFOutcome OcrClient::recognizePDF(const RecognizePDFRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizePDFOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizePDFOutcome(RecognizePDFResult(outcome.result()));
|
||||
else
|
||||
return RecognizePDFOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizePDFAsync(const RecognizePDFRequest& request, const RecognizePDFAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizePDF(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizePDFOutcomeCallable OcrClient::recognizePDFCallable(const RecognizePDFRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizePDFOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizePDF(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizePassportMRZOutcome OcrClient::recognizePassportMRZ(const RecognizePassportMRZRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -591,6 +627,42 @@ OcrClient::RecognizeQrCodeOutcomeCallable OcrClient::recognizeQrCodeCallable(con
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeQuotaInvoiceOutcome OcrClient::recognizeQuotaInvoice(const RecognizeQuotaInvoiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeQuotaInvoiceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeQuotaInvoiceOutcome(RecognizeQuotaInvoiceResult(outcome.result()));
|
||||
else
|
||||
return RecognizeQuotaInvoiceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeQuotaInvoiceAsync(const RecognizeQuotaInvoiceRequest& request, const RecognizeQuotaInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeQuotaInvoice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeQuotaInvoiceOutcomeCallable OcrClient::recognizeQuotaInvoiceCallable(const RecognizeQuotaInvoiceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeQuotaInvoiceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeQuotaInvoice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeStampOutcome OcrClient::recognizeStamp(const RecognizeStampRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
@@ -735,6 +807,42 @@ OcrClient::RecognizeTaxiInvoiceOutcomeCallable OcrClient::recognizeTaxiInvoiceCa
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTicketInvoiceOutcome OcrClient::recognizeTicketInvoice(const RecognizeTicketInvoiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeTicketInvoiceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeTicketInvoiceOutcome(RecognizeTicketInvoiceResult(outcome.result()));
|
||||
else
|
||||
return RecognizeTicketInvoiceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void OcrClient::recognizeTicketInvoiceAsync(const RecognizeTicketInvoiceRequest& request, const RecognizeTicketInvoiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeTicketInvoice(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTicketInvoiceOutcomeCallable OcrClient::recognizeTicketInvoiceCallable(const RecognizeTicketInvoiceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeTicketInvoiceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeTicketInvoice(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
OcrClient::RecognizeTrainTicketOutcome OcrClient::recognizeTrainTicket(const RecognizeTrainTicketRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
40
ocr/src/model/RecognizePDFRequest.cc
Normal file
40
ocr/src/model/RecognizePDFRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizePDFRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizePDFRequest;
|
||||
|
||||
RecognizePDFRequest::RecognizePDFRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizePDF")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizePDFRequest::~RecognizePDFRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizePDFRequest::getFileURL()const
|
||||
{
|
||||
return fileURL_;
|
||||
}
|
||||
|
||||
void RecognizePDFRequest::setFileURL(const std::string& fileURL)
|
||||
{
|
||||
fileURL_ = fileURL;
|
||||
setBodyParameter("FileURL", fileURL);
|
||||
}
|
||||
|
||||
104
ocr/src/model/RecognizePDFResult.cc
Normal file
104
ocr/src/model/RecognizePDFResult.cc
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizePDFResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizePDFResult::RecognizePDFResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizePDFResult::RecognizePDFResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizePDFResult::~RecognizePDFResult()
|
||||
{}
|
||||
|
||||
void RecognizePDFResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stol(dataNode["Height"].asString());
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stol(dataNode["Width"].asString());
|
||||
if(!dataNode["OrgHeight"].isNull())
|
||||
data_.orgHeight = std::stol(dataNode["OrgHeight"].asString());
|
||||
if(!dataNode["OrgWidth"].isNull())
|
||||
data_.orgWidth = std::stol(dataNode["OrgWidth"].asString());
|
||||
if(!dataNode["PageIndex"].isNull())
|
||||
data_.pageIndex = std::stol(dataNode["PageIndex"].asString());
|
||||
if(!dataNode["Angle"].isNull())
|
||||
data_.angle = std::stol(dataNode["Angle"].asString());
|
||||
auto allWordsInfoNode = dataNode["WordsInfo"]["wordsInfoItem"];
|
||||
for (auto dataNodeWordsInfowordsInfoItem : allWordsInfoNode)
|
||||
{
|
||||
Data::WordsInfoItem wordsInfoItemObject;
|
||||
if(!dataNodeWordsInfowordsInfoItem["Angle"].isNull())
|
||||
wordsInfoItemObject.angle = std::stol(dataNodeWordsInfowordsInfoItem["Angle"].asString());
|
||||
if(!dataNodeWordsInfowordsInfoItem["Word"].isNull())
|
||||
wordsInfoItemObject.word = dataNodeWordsInfowordsInfoItem["Word"].asString();
|
||||
if(!dataNodeWordsInfowordsInfoItem["Height"].isNull())
|
||||
wordsInfoItemObject.height = std::stol(dataNodeWordsInfowordsInfoItem["Height"].asString());
|
||||
if(!dataNodeWordsInfowordsInfoItem["Width"].isNull())
|
||||
wordsInfoItemObject.width = std::stol(dataNodeWordsInfowordsInfoItem["Width"].asString());
|
||||
if(!dataNodeWordsInfowordsInfoItem["X"].isNull())
|
||||
wordsInfoItemObject.x = std::stol(dataNodeWordsInfowordsInfoItem["X"].asString());
|
||||
if(!dataNodeWordsInfowordsInfoItem["Y"].isNull())
|
||||
wordsInfoItemObject.y = std::stol(dataNodeWordsInfowordsInfoItem["Y"].asString());
|
||||
auto allPositionsNode = dataNodeWordsInfowordsInfoItem["Positions"]["positionsItem"];
|
||||
for (auto dataNodeWordsInfowordsInfoItemPositionspositionsItem : allPositionsNode)
|
||||
{
|
||||
Data::WordsInfoItem::PositionsItem positionsObject;
|
||||
if(!dataNodeWordsInfowordsInfoItemPositionspositionsItem["X"].isNull())
|
||||
positionsObject.x = std::stol(dataNodeWordsInfowordsInfoItemPositionspositionsItem["X"].asString());
|
||||
if(!dataNodeWordsInfowordsInfoItemPositionspositionsItem["Y"].isNull())
|
||||
positionsObject.y = std::stol(dataNodeWordsInfowordsInfoItemPositionspositionsItem["Y"].asString());
|
||||
wordsInfoItemObject.positions.push_back(positionsObject);
|
||||
}
|
||||
data_.wordsInfo.push_back(wordsInfoItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RecognizePDFResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
RecognizePDFResult::Data RecognizePDFResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string RecognizePDFResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizeQuotaInvoiceRequest.cc
Normal file
40
ocr/src/model/RecognizeQuotaInvoiceRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeQuotaInvoiceRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeQuotaInvoiceRequest;
|
||||
|
||||
RecognizeQuotaInvoiceRequest::RecognizeQuotaInvoiceRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeQuotaInvoice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeQuotaInvoiceRequest::~RecognizeQuotaInvoiceRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeQuotaInvoiceRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeQuotaInvoiceRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
107
ocr/src/model/RecognizeQuotaInvoiceResult.cc
Normal file
107
ocr/src/model/RecognizeQuotaInvoiceResult.cc
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeQuotaInvoiceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeQuotaInvoiceResult::RecognizeQuotaInvoiceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeQuotaInvoiceResult::RecognizeQuotaInvoiceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeQuotaInvoiceResult::~RecognizeQuotaInvoiceResult()
|
||||
{}
|
||||
|
||||
void RecognizeQuotaInvoiceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Angle"].isNull())
|
||||
data_.angle = std::stol(dataNode["Angle"].asString());
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stol(dataNode["Height"].asString());
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stol(dataNode["Width"].asString());
|
||||
if(!dataNode["OrgHeight"].isNull())
|
||||
data_.orgHeight = std::stol(dataNode["OrgHeight"].asString());
|
||||
if(!dataNode["OrgWidth"].isNull())
|
||||
data_.orgWidth = std::stol(dataNode["OrgWidth"].asString());
|
||||
auto allKeyValueInfosNode = dataNode["KeyValueInfos"]["keyValueInfosItem"];
|
||||
for (auto dataNodeKeyValueInfoskeyValueInfosItem : allKeyValueInfosNode)
|
||||
{
|
||||
Data::KeyValueInfosItem keyValueInfosItemObject;
|
||||
if(!dataNodeKeyValueInfoskeyValueInfosItem["Key"].isNull())
|
||||
keyValueInfosItemObject.key = dataNodeKeyValueInfoskeyValueInfosItem["Key"].asString();
|
||||
if(!dataNodeKeyValueInfoskeyValueInfosItem["Value"].isNull())
|
||||
keyValueInfosItemObject.value = dataNodeKeyValueInfoskeyValueInfosItem["Value"].asString();
|
||||
if(!dataNodeKeyValueInfoskeyValueInfosItem["ValueScore"].isNull())
|
||||
keyValueInfosItemObject.valueScore = std::stof(dataNodeKeyValueInfoskeyValueInfosItem["ValueScore"].asString());
|
||||
auto allValuePositionsNode = dataNodeKeyValueInfoskeyValueInfosItem["ValuePositions"]["valuePositionsItem"];
|
||||
for (auto dataNodeKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem : allValuePositionsNode)
|
||||
{
|
||||
Data::KeyValueInfosItem::ValuePositionsItem valuePositionsObject;
|
||||
if(!dataNodeKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["X"].isNull())
|
||||
valuePositionsObject.x = std::stol(dataNodeKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["X"].asString());
|
||||
if(!dataNodeKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["Y"].isNull())
|
||||
valuePositionsObject.y = std::stol(dataNodeKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["Y"].asString());
|
||||
keyValueInfosItemObject.valuePositions.push_back(valuePositionsObject);
|
||||
}
|
||||
data_.keyValueInfos.push_back(keyValueInfosItemObject);
|
||||
}
|
||||
auto contentNode = dataNode["Content"];
|
||||
if(!contentNode["SumAmount"].isNull())
|
||||
data_.content.sumAmount = contentNode["SumAmount"].asString();
|
||||
if(!contentNode["InvoiceCode"].isNull())
|
||||
data_.content.invoiceCode = contentNode["InvoiceCode"].asString();
|
||||
if(!contentNode["InvoiceNo"].isNull())
|
||||
data_.content.invoiceNo = contentNode["InvoiceNo"].asString();
|
||||
if(!contentNode["InvoiceAmount"].isNull())
|
||||
data_.content.invoiceAmount = contentNode["InvoiceAmount"].asString();
|
||||
if(!contentNode["InvoiceDetails"].isNull())
|
||||
data_.content.invoiceDetails = contentNode["InvoiceDetails"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RecognizeQuotaInvoiceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
RecognizeQuotaInvoiceResult::Data RecognizeQuotaInvoiceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string RecognizeQuotaInvoiceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
40
ocr/src/model/RecognizeTicketInvoiceRequest.cc
Normal file
40
ocr/src/model/RecognizeTicketInvoiceRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTicketInvoiceRequest.h>
|
||||
|
||||
using AlibabaCloud::Ocr::Model::RecognizeTicketInvoiceRequest;
|
||||
|
||||
RecognizeTicketInvoiceRequest::RecognizeTicketInvoiceRequest() :
|
||||
RpcServiceRequest("ocr", "2019-12-30", "RecognizeTicketInvoice")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeTicketInvoiceRequest::~RecognizeTicketInvoiceRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeTicketInvoiceRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeTicketInvoiceRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
135
ocr/src/model/RecognizeTicketInvoiceResult.cc
Normal file
135
ocr/src/model/RecognizeTicketInvoiceResult.cc
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/ocr/model/RecognizeTicketInvoiceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Ocr;
|
||||
using namespace AlibabaCloud::Ocr::Model;
|
||||
|
||||
RecognizeTicketInvoiceResult::RecognizeTicketInvoiceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeTicketInvoiceResult::RecognizeTicketInvoiceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeTicketInvoiceResult::~RecognizeTicketInvoiceResult()
|
||||
{}
|
||||
|
||||
void RecognizeTicketInvoiceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Count"].isNull())
|
||||
data_.count = std::stol(dataNode["Count"].asString());
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stol(dataNode["Height"].asString());
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stol(dataNode["Width"].asString());
|
||||
if(!dataNode["OrgHeight"].isNull())
|
||||
data_.orgHeight = std::stol(dataNode["OrgHeight"].asString());
|
||||
if(!dataNode["OrgWidth"].isNull())
|
||||
data_.orgWidth = std::stol(dataNode["OrgWidth"].asString());
|
||||
auto allResultsNode = dataNode["Results"]["resultsItem"];
|
||||
for (auto dataNodeResultsresultsItem : allResultsNode)
|
||||
{
|
||||
Data::ResultsItem resultsItemObject;
|
||||
if(!dataNodeResultsresultsItem["Index"].isNull())
|
||||
resultsItemObject.index = std::stol(dataNodeResultsresultsItem["Index"].asString());
|
||||
if(!dataNodeResultsresultsItem["Type"].isNull())
|
||||
resultsItemObject.type = dataNodeResultsresultsItem["Type"].asString();
|
||||
auto allKeyValueInfosNode = dataNodeResultsresultsItem["KeyValueInfos"]["keyValueInfosItem"];
|
||||
for (auto dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem : allKeyValueInfosNode)
|
||||
{
|
||||
Data::ResultsItem::KeyValueInfosItem keyValueInfosObject;
|
||||
if(!dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["Key"].isNull())
|
||||
keyValueInfosObject.key = dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["Key"].asString();
|
||||
if(!dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["Value"].isNull())
|
||||
keyValueInfosObject.value = dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["Value"].asString();
|
||||
if(!dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["ValueScore"].isNull())
|
||||
keyValueInfosObject.valueScore = std::stof(dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["ValueScore"].asString());
|
||||
auto allValuePositionsNode = dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItem["ValuePositions"]["valuePositionsItem"];
|
||||
for (auto dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem : allValuePositionsNode)
|
||||
{
|
||||
Data::ResultsItem::KeyValueInfosItem::ValuePositionsItem valuePositionsObject;
|
||||
if(!dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["X"].isNull())
|
||||
valuePositionsObject.x = std::stol(dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["X"].asString());
|
||||
if(!dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["Y"].isNull())
|
||||
valuePositionsObject.y = std::stol(dataNodeResultsresultsItemKeyValueInfoskeyValueInfosItemValuePositionsvaluePositionsItem["Y"].asString());
|
||||
keyValueInfosObject.valuePositions.push_back(valuePositionsObject);
|
||||
}
|
||||
resultsItemObject.keyValueInfos.push_back(keyValueInfosObject);
|
||||
}
|
||||
auto allSliceRectangleNode = dataNodeResultsresultsItem["SliceRectangle"]["sliceRectangleItem"];
|
||||
for (auto dataNodeResultsresultsItemSliceRectanglesliceRectangleItem : allSliceRectangleNode)
|
||||
{
|
||||
Data::ResultsItem::SliceRectangleItem sliceRectangleObject;
|
||||
if(!dataNodeResultsresultsItemSliceRectanglesliceRectangleItem["X"].isNull())
|
||||
sliceRectangleObject.x = std::stol(dataNodeResultsresultsItemSliceRectanglesliceRectangleItem["X"].asString());
|
||||
if(!dataNodeResultsresultsItemSliceRectanglesliceRectangleItem["Y"].isNull())
|
||||
sliceRectangleObject.y = std::stol(dataNodeResultsresultsItemSliceRectanglesliceRectangleItem["Y"].asString());
|
||||
resultsItemObject.sliceRectangle.push_back(sliceRectangleObject);
|
||||
}
|
||||
auto contentNode = value["Content"];
|
||||
if(!contentNode["InvoiceCode"].isNull())
|
||||
resultsItemObject.content.invoiceCode = contentNode["InvoiceCode"].asString();
|
||||
if(!contentNode["InvoiceNumber"].isNull())
|
||||
resultsItemObject.content.invoiceNumber = contentNode["InvoiceNumber"].asString();
|
||||
if(!contentNode["InvoiceDate"].isNull())
|
||||
resultsItemObject.content.invoiceDate = contentNode["InvoiceDate"].asString();
|
||||
if(!contentNode["AntiFakeCode"].isNull())
|
||||
resultsItemObject.content.antiFakeCode = contentNode["AntiFakeCode"].asString();
|
||||
if(!contentNode["PayeeName"].isNull())
|
||||
resultsItemObject.content.payeeName = contentNode["PayeeName"].asString();
|
||||
if(!contentNode["PayeeRegisterNo"].isNull())
|
||||
resultsItemObject.content.payeeRegisterNo = contentNode["PayeeRegisterNo"].asString();
|
||||
if(!contentNode["PayerName"].isNull())
|
||||
resultsItemObject.content.payerName = contentNode["PayerName"].asString();
|
||||
if(!contentNode["PayerRegisterNo"].isNull())
|
||||
resultsItemObject.content.payerRegisterNo = contentNode["PayerRegisterNo"].asString();
|
||||
if(!contentNode["SumAmount"].isNull())
|
||||
resultsItemObject.content.sumAmount = contentNode["SumAmount"].asString();
|
||||
data_.results.push_back(resultsItemObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string RecognizeTicketInvoiceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
RecognizeTicketInvoiceResult::Data RecognizeTicketInvoiceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string RecognizeTicketInvoiceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user