mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[C++ server] Adjust the names (script, sample folder, generator) to lang option (#250)
* Renamce C++ server scripts * Change output folder * Rename sample folder: pistache-server -> cpp-pistache * Rename sample folder: restbed -> cpp-restbed
This commit is contained in:
committed by
William Cheng
parent
f5f00069bd
commit
2392a09eeb
93
samples/server/petstore/cpp-restbed/model/ApiResponse.cpp
Normal file
93
samples/server/petstore/cpp-restbed/model/ApiResponse.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "ApiResponse.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
ApiResponse::ApiResponse()
|
||||
{
|
||||
m_Code = 0;
|
||||
m_Type = "";
|
||||
m_Message = "";
|
||||
|
||||
}
|
||||
|
||||
ApiResponse::~ApiResponse()
|
||||
{
|
||||
}
|
||||
|
||||
std::string ApiResponse::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Code", m_Code);
|
||||
pt.put("Type", m_Type);
|
||||
pt.put("Message", m_Message);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void ApiResponse::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Code = pt.get("Code", 0);
|
||||
m_Type = pt.get("Type", "");
|
||||
m_Message = pt.get("Message", "");
|
||||
}
|
||||
|
||||
int32_t ApiResponse::getCode() const
|
||||
{
|
||||
return m_Code;
|
||||
}
|
||||
void ApiResponse::setCode(int32_t value)
|
||||
{
|
||||
m_Code = value;
|
||||
}
|
||||
std::string ApiResponse::getType() const
|
||||
{
|
||||
return m_Type;
|
||||
}
|
||||
void ApiResponse::setType(std::string value)
|
||||
{
|
||||
m_Type = value;
|
||||
}
|
||||
std::string ApiResponse::getMessage() const
|
||||
{
|
||||
return m_Message;
|
||||
}
|
||||
void ApiResponse::setMessage(std::string value)
|
||||
{
|
||||
m_Message = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
74
samples/server/petstore/cpp-restbed/model/ApiResponse.h
Normal file
74
samples/server/petstore/cpp-restbed/model/ApiResponse.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ApiResponse.h
|
||||
*
|
||||
* Describes the result of uploading an image resource
|
||||
*/
|
||||
|
||||
#ifndef ApiResponse_H_
|
||||
#define ApiResponse_H_
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// Describes the result of uploading an image resource
|
||||
/// </summary>
|
||||
class ApiResponse
|
||||
{
|
||||
public:
|
||||
ApiResponse();
|
||||
virtual ~ApiResponse();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// ApiResponse members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getCode() const;
|
||||
void setCode(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getType() const;
|
||||
void setType(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getMessage() const;
|
||||
void setMessage(std::string value);
|
||||
|
||||
protected:
|
||||
int32_t m_Code;
|
||||
std::string m_Type;
|
||||
std::string m_Message;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ApiResponse_H_ */
|
||||
82
samples/server/petstore/cpp-restbed/model/Category.cpp
Normal file
82
samples/server/petstore/cpp-restbed/model/Category.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Category.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
Category::Category()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_Name = "";
|
||||
|
||||
}
|
||||
|
||||
Category::~Category()
|
||||
{
|
||||
}
|
||||
|
||||
std::string Category::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Id", m_Id);
|
||||
pt.put("Name", m_Name);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Category::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Id = pt.get("Id", 0L);
|
||||
m_Name = pt.get("Name", "");
|
||||
}
|
||||
|
||||
int64_t Category::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
void Category::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
std::string Category::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void Category::setName(std::string value)
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
samples/server/petstore/cpp-restbed/model/Category.h
Normal file
68
samples/server/petstore/cpp-restbed/model/Category.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Category.h
|
||||
*
|
||||
* A category for a pet
|
||||
*/
|
||||
|
||||
#ifndef Category_H_
|
||||
#define Category_H_
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A category for a pet
|
||||
/// </summary>
|
||||
class Category
|
||||
{
|
||||
public:
|
||||
Category();
|
||||
virtual ~Category();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Category members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getName() const;
|
||||
void setName(std::string value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
std::string m_Name;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* Category_H_ */
|
||||
126
samples/server/petstore/cpp-restbed/model/Order.cpp
Normal file
126
samples/server/petstore/cpp-restbed/model/Order.cpp
Normal file
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Order.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
Order::Order()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_PetId = 0L;
|
||||
m_Quantity = 0;
|
||||
m_ShipDate = "";
|
||||
m_Status = "";
|
||||
m_Complete = false;
|
||||
|
||||
}
|
||||
|
||||
Order::~Order()
|
||||
{
|
||||
}
|
||||
|
||||
std::string Order::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Id", m_Id);
|
||||
pt.put("PetId", m_PetId);
|
||||
pt.put("Quantity", m_Quantity);
|
||||
pt.put("ShipDate", m_ShipDate);
|
||||
pt.put("Status", m_Status);
|
||||
pt.put("Complete", m_Complete);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Order::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Id = pt.get("Id", 0L);
|
||||
m_PetId = pt.get("PetId", 0L);
|
||||
m_Quantity = pt.get("Quantity", 0);
|
||||
m_ShipDate = pt.get("ShipDate", "");
|
||||
m_Status = pt.get("Status", "");
|
||||
m_Complete = pt.get("Complete", false);
|
||||
}
|
||||
|
||||
int64_t Order::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
void Order::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
int64_t Order::getPetId() const
|
||||
{
|
||||
return m_PetId;
|
||||
}
|
||||
void Order::setPetId(int64_t value)
|
||||
{
|
||||
m_PetId = value;
|
||||
}
|
||||
int32_t Order::getQuantity() const
|
||||
{
|
||||
return m_Quantity;
|
||||
}
|
||||
void Order::setQuantity(int32_t value)
|
||||
{
|
||||
m_Quantity = value;
|
||||
}
|
||||
std::string Order::getShipDate() const
|
||||
{
|
||||
return m_ShipDate;
|
||||
}
|
||||
void Order::setShipDate(std::string value)
|
||||
{
|
||||
m_ShipDate = value;
|
||||
}
|
||||
std::string Order::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
void Order::setStatus(std::string value)
|
||||
{
|
||||
m_Status = value;
|
||||
}
|
||||
bool Order::isComplete() const
|
||||
{
|
||||
return m_Complete;
|
||||
}
|
||||
void Order::setComplete(bool value)
|
||||
{
|
||||
m_Complete = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
92
samples/server/petstore/cpp-restbed/model/Order.h
Normal file
92
samples/server/petstore/cpp-restbed/model/Order.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Order.h
|
||||
*
|
||||
* An order for a pets from the pet store
|
||||
*/
|
||||
|
||||
#ifndef Order_H_
|
||||
#define Order_H_
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// An order for a pets from the pet store
|
||||
/// </summary>
|
||||
class Order
|
||||
{
|
||||
public:
|
||||
Order();
|
||||
virtual ~Order();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Order members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getPetId() const;
|
||||
void setPetId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int32_t getQuantity() const;
|
||||
void setQuantity(int32_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getShipDate() const;
|
||||
void setShipDate(std::string value);
|
||||
/// <summary>
|
||||
/// Order Status
|
||||
/// </summary>
|
||||
std::string getStatus() const;
|
||||
void setStatus(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
bool isComplete() const;
|
||||
void setComplete(bool value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
int64_t m_PetId;
|
||||
int32_t m_Quantity;
|
||||
std::string m_ShipDate;
|
||||
std::string m_Status;
|
||||
bool m_Complete;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* Order_H_ */
|
||||
117
samples/server/petstore/cpp-restbed/model/Pet.cpp
Normal file
117
samples/server/petstore/cpp-restbed/model/Pet.cpp
Normal file
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Pet.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
Pet::Pet()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_Name = "";
|
||||
m_Status = "";
|
||||
|
||||
}
|
||||
|
||||
Pet::~Pet()
|
||||
{
|
||||
}
|
||||
|
||||
std::string Pet::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Id", m_Id);
|
||||
pt.put("Name", m_Name);
|
||||
pt.put("Status", m_Status);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Pet::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Id = pt.get("Id", 0L);
|
||||
m_Name = pt.get("Name", "");
|
||||
m_Status = pt.get("Status", "");
|
||||
}
|
||||
|
||||
int64_t Pet::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
void Pet::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
std::shared_ptr<Category> Pet::getCategory() const
|
||||
{
|
||||
return m_Category;
|
||||
}
|
||||
void Pet::setCategory(std::shared_ptr<Category> value)
|
||||
{
|
||||
m_Category = value;
|
||||
}
|
||||
std::string Pet::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void Pet::setName(std::string value)
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
std::vector<std::string> Pet::getPhotoUrls() const
|
||||
{
|
||||
return m_PhotoUrls;
|
||||
}
|
||||
void Pet::setPhotoUrls(std::vector<std::string> value)
|
||||
{
|
||||
m_PhotoUrls = value;
|
||||
}
|
||||
std::vector<std::shared_ptr<Tag>> Pet::getTags() const
|
||||
{
|
||||
return m_Tags;
|
||||
}
|
||||
void Pet::setTags(std::vector<std::shared_ptr<Tag>> value)
|
||||
{
|
||||
m_Tags = value;
|
||||
}
|
||||
std::string Pet::getStatus() const
|
||||
{
|
||||
return m_Status;
|
||||
}
|
||||
void Pet::setStatus(std::string value)
|
||||
{
|
||||
m_Status = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
95
samples/server/petstore/cpp-restbed/model/Pet.h
Normal file
95
samples/server/petstore/cpp-restbed/model/Pet.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Pet.h
|
||||
*
|
||||
* A pet for sale in the pet store
|
||||
*/
|
||||
|
||||
#ifndef Pet_H_
|
||||
#define Pet_H_
|
||||
|
||||
|
||||
|
||||
#include "Tag.h"
|
||||
#include <string>
|
||||
#include "Category.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A pet for sale in the pet store
|
||||
/// </summary>
|
||||
class Pet
|
||||
{
|
||||
public:
|
||||
Pet();
|
||||
virtual ~Pet();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Pet members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::shared_ptr<Category> getCategory() const;
|
||||
void setCategory(std::shared_ptr<Category> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getName() const;
|
||||
void setName(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::string> getPhotoUrls() const;
|
||||
void setPhotoUrls(std::vector<std::string> value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::vector<std::shared_ptr<Tag>> getTags() const;
|
||||
void setTags(std::vector<std::shared_ptr<Tag>> value);
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
std::string getStatus() const;
|
||||
void setStatus(std::string value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
std::shared_ptr<Category> m_Category;
|
||||
std::string m_Name;
|
||||
std::vector<std::string> m_PhotoUrls;
|
||||
std::vector<std::shared_ptr<Tag>> m_Tags;
|
||||
std::string m_Status;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* Pet_H_ */
|
||||
82
samples/server/petstore/cpp-restbed/model/Tag.cpp
Normal file
82
samples/server/petstore/cpp-restbed/model/Tag.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "Tag.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
Tag::Tag()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_Name = "";
|
||||
|
||||
}
|
||||
|
||||
Tag::~Tag()
|
||||
{
|
||||
}
|
||||
|
||||
std::string Tag::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Id", m_Id);
|
||||
pt.put("Name", m_Name);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void Tag::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Id = pt.get("Id", 0L);
|
||||
m_Name = pt.get("Name", "");
|
||||
}
|
||||
|
||||
int64_t Tag::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
void Tag::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
std::string Tag::getName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
void Tag::setName(std::string value)
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
68
samples/server/petstore/cpp-restbed/model/Tag.h
Normal file
68
samples/server/petstore/cpp-restbed/model/Tag.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tag.h
|
||||
*
|
||||
* A tag for a pet
|
||||
*/
|
||||
|
||||
#ifndef Tag_H_
|
||||
#define Tag_H_
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A tag for a pet
|
||||
/// </summary>
|
||||
class Tag
|
||||
{
|
||||
public:
|
||||
Tag();
|
||||
virtual ~Tag();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Tag members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getName() const;
|
||||
void setName(std::string value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
std::string m_Name;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* Tag_H_ */
|
||||
148
samples/server/petstore/cpp-restbed/model/User.cpp
Normal file
148
samples/server/petstore/cpp-restbed/model/User.cpp
Normal file
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "User.h"
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
|
||||
using boost::property_tree::ptree;
|
||||
using boost::property_tree::read_json;
|
||||
using boost::property_tree::write_json;
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
User::User()
|
||||
{
|
||||
m_Id = 0L;
|
||||
m_Username = "";
|
||||
m_FirstName = "";
|
||||
m_LastName = "";
|
||||
m_Email = "";
|
||||
m_Password = "";
|
||||
m_Phone = "";
|
||||
m_UserStatus = 0;
|
||||
|
||||
}
|
||||
|
||||
User::~User()
|
||||
{
|
||||
}
|
||||
|
||||
std::string User::toJsonString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ptree pt;
|
||||
pt.put("Id", m_Id);
|
||||
pt.put("Username", m_Username);
|
||||
pt.put("FirstName", m_FirstName);
|
||||
pt.put("LastName", m_LastName);
|
||||
pt.put("Email", m_Email);
|
||||
pt.put("Password", m_Password);
|
||||
pt.put("Phone", m_Phone);
|
||||
pt.put("UserStatus", m_UserStatus);
|
||||
write_json(ss, pt, false);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
void User::fromJsonString(std::string const& jsonString)
|
||||
{
|
||||
std::stringstream ss(jsonString);
|
||||
ptree pt;
|
||||
read_json(ss,pt);
|
||||
m_Id = pt.get("Id", 0L);
|
||||
m_Username = pt.get("Username", "");
|
||||
m_FirstName = pt.get("FirstName", "");
|
||||
m_LastName = pt.get("LastName", "");
|
||||
m_Email = pt.get("Email", "");
|
||||
m_Password = pt.get("Password", "");
|
||||
m_Phone = pt.get("Phone", "");
|
||||
m_UserStatus = pt.get("UserStatus", 0);
|
||||
}
|
||||
|
||||
int64_t User::getId() const
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
void User::setId(int64_t value)
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
std::string User::getUsername() const
|
||||
{
|
||||
return m_Username;
|
||||
}
|
||||
void User::setUsername(std::string value)
|
||||
{
|
||||
m_Username = value;
|
||||
}
|
||||
std::string User::getFirstName() const
|
||||
{
|
||||
return m_FirstName;
|
||||
}
|
||||
void User::setFirstName(std::string value)
|
||||
{
|
||||
m_FirstName = value;
|
||||
}
|
||||
std::string User::getLastName() const
|
||||
{
|
||||
return m_LastName;
|
||||
}
|
||||
void User::setLastName(std::string value)
|
||||
{
|
||||
m_LastName = value;
|
||||
}
|
||||
std::string User::getEmail() const
|
||||
{
|
||||
return m_Email;
|
||||
}
|
||||
void User::setEmail(std::string value)
|
||||
{
|
||||
m_Email = value;
|
||||
}
|
||||
std::string User::getPassword() const
|
||||
{
|
||||
return m_Password;
|
||||
}
|
||||
void User::setPassword(std::string value)
|
||||
{
|
||||
m_Password = value;
|
||||
}
|
||||
std::string User::getPhone() const
|
||||
{
|
||||
return m_Phone;
|
||||
}
|
||||
void User::setPhone(std::string value)
|
||||
{
|
||||
m_Phone = value;
|
||||
}
|
||||
int32_t User::getUserStatus() const
|
||||
{
|
||||
return m_UserStatus;
|
||||
}
|
||||
void User::setUserStatus(int32_t value)
|
||||
{
|
||||
m_UserStatus = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
104
samples/server/petstore/cpp-restbed/model/User.h
Normal file
104
samples/server/petstore/cpp-restbed/model/User.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI-Generator 3.0.0-SNAPSHOT.
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
/*
|
||||
* User.h
|
||||
*
|
||||
* A User who is purchasing from the pet store
|
||||
*/
|
||||
|
||||
#ifndef User_H_
|
||||
#define User_H_
|
||||
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
namespace org {
|
||||
namespace openapitools {
|
||||
namespace server {
|
||||
namespace model {
|
||||
|
||||
/// <summary>
|
||||
/// A User who is purchasing from the pet store
|
||||
/// </summary>
|
||||
class User
|
||||
{
|
||||
public:
|
||||
User();
|
||||
virtual ~User();
|
||||
|
||||
std::string toJsonString();
|
||||
void fromJsonString(std::string const& jsonString);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// User members
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getId() const;
|
||||
void setId(int64_t value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getUsername() const;
|
||||
void setUsername(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getFirstName() const;
|
||||
void setFirstName(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getLastName() const;
|
||||
void setLastName(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getEmail() const;
|
||||
void setEmail(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getPassword() const;
|
||||
void setPassword(std::string value);
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getPhone() const;
|
||||
void setPhone(std::string value);
|
||||
/// <summary>
|
||||
/// User Status
|
||||
/// </summary>
|
||||
int32_t getUserStatus() const;
|
||||
void setUserStatus(int32_t value);
|
||||
|
||||
protected:
|
||||
int64_t m_Id;
|
||||
std::string m_Username;
|
||||
std::string m_FirstName;
|
||||
std::string m_LastName;
|
||||
std::string m_Email;
|
||||
std::string m_Password;
|
||||
std::string m_Phone;
|
||||
int32_t m_UserStatus;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* User_H_ */
|
||||
Reference in New Issue
Block a user