mirror of
https://github.com/OpenCoin/oc-mint-cpp.git
synced 2025-07-04 06:09:42 +02:00
corrected name RequestCDD to RequestCDDC
This commit is contained in:
@ -29,11 +29,11 @@ int main() {
|
||||
|
||||
CROW_ROUTE(app, "/cddc/serial")
|
||||
.methods(crow::HTTPMethod::POST)([&model](const crow::request &request) {
|
||||
auto req = RequestCDDSerial::from_string(request.body);
|
||||
auto req = RequestCDDCSerial::from_string(request.body);
|
||||
if (!req) {
|
||||
return crow::response(crow::status::BAD_REQUEST);
|
||||
} else {
|
||||
ResponseCDDSerial res;
|
||||
ResponseCDDCSerial res;
|
||||
res.message_reference = req->message_reference;
|
||||
|
||||
auto cddc = model->getCurrentCDDC();
|
||||
|
@ -104,7 +104,7 @@ crow::json::wvalue Response::to_json() const {
|
||||
return r;
|
||||
}
|
||||
|
||||
crow::json::wvalue ResponseCDDSerial::to_json() const {
|
||||
crow::json::wvalue ResponseCDDCSerial::to_json() const {
|
||||
crow::json::wvalue r = Response::to_json();
|
||||
TO_JSON(cdd_serial);
|
||||
|
||||
@ -112,8 +112,8 @@ crow::json::wvalue ResponseCDDSerial::to_json() const {
|
||||
return r;
|
||||
}
|
||||
|
||||
tl::expected<RequestCDDSerial, eError>
|
||||
RequestCDDSerial::from_string(const std::string &str) {
|
||||
tl::expected<RequestCDDCSerial, eError>
|
||||
RequestCDDCSerial::from_string(const std::string &str) {
|
||||
auto json = crow::json::load(str);
|
||||
if (!json) {
|
||||
return tl::make_unexpected(eError::JSON_PARSE_ERROR);
|
||||
@ -122,7 +122,7 @@ RequestCDDSerial::from_string(const std::string &str) {
|
||||
} else if (json["type"] != "request cdd serial") {
|
||||
return tl::make_unexpected(eError::JSON_ERROR);
|
||||
} else {
|
||||
RequestCDDSerial r;
|
||||
RequestCDDCSerial r;
|
||||
r.message_reference = json["message_reference"].u();
|
||||
return r;
|
||||
}
|
||||
|
@ -100,14 +100,14 @@ struct Response {
|
||||
virtual crow::json::wvalue to_json() const;
|
||||
};
|
||||
|
||||
struct RequestCDDSerial {
|
||||
struct RequestCDDCSerial {
|
||||
unsigned int message_reference; /// Client internal message reference.
|
||||
/// (Integer)
|
||||
static tl::expected<RequestCDDSerial, eError>
|
||||
static tl::expected<RequestCDDCSerial, eError>
|
||||
from_string(const std::string &str);
|
||||
};
|
||||
|
||||
struct ResponseCDDSerial : Response {
|
||||
struct ResponseCDDCSerial : Response {
|
||||
unsigned int cdd_serial;
|
||||
|
||||
crow::json::wvalue to_json() const override;
|
||||
|
Reference in New Issue
Block a user