mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-26 15:05:08 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -566,6 +566,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
uri:
|
uri:
|
||||||
type: string
|
type: string
|
||||||
|
revision:
|
||||||
|
type: string
|
||||||
imageCreationDate:
|
imageCreationDate:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ namespace OpenWifi::GWObjects {
|
|||||||
field_to_json(Obj, "description", Description);
|
field_to_json(Obj, "description", Description);
|
||||||
field_to_json(Obj, "modelIds", Models);
|
field_to_json(Obj, "modelIds", Models);
|
||||||
field_to_json(Obj, "uri", uri);
|
field_to_json(Obj, "uri", uri);
|
||||||
|
field_to_json(Obj, "revision", revision);
|
||||||
field_to_json(Obj, "imageCreationDate", imageCreationDate);
|
field_to_json(Obj, "imageCreationDate", imageCreationDate);
|
||||||
field_to_json(Obj, "created", Created);
|
field_to_json(Obj, "created", Created);
|
||||||
field_to_json(Obj, "lastModified", LastModified);
|
field_to_json(Obj, "lastModified", LastModified);
|
||||||
@@ -187,6 +188,7 @@ namespace OpenWifi::GWObjects {
|
|||||||
field_from_json(Obj, "description", Description);
|
field_from_json(Obj, "description", Description);
|
||||||
field_from_json(Obj, "modelIds", Models);
|
field_from_json(Obj, "modelIds", Models);
|
||||||
field_from_json(Obj, "uri", uri);
|
field_from_json(Obj, "uri", uri);
|
||||||
|
field_from_json(Obj, "revision", revision);
|
||||||
field_from_json(Obj, "imageCreationDate", imageCreationDate);
|
field_from_json(Obj, "imageCreationDate", imageCreationDate);
|
||||||
field_from_json(Obj, "created", Created);
|
field_from_json(Obj, "created", Created);
|
||||||
field_from_json(Obj, "lastModified", LastModified);
|
field_from_json(Obj, "lastModified", LastModified);
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ namespace OpenWifi::GWObjects {
|
|||||||
Types::StringVec Models;
|
Types::StringVec Models;
|
||||||
std::string Description;
|
std::string Description;
|
||||||
std::string uri;
|
std::string uri;
|
||||||
|
std::string revision;
|
||||||
uint64_t imageCreationDate;
|
uint64_t imageCreationDate;
|
||||||
uint64_t Created;
|
uint64_t Created;
|
||||||
uint64_t LastModified;
|
uint64_t LastModified;
|
||||||
|
|||||||
@@ -14,28 +14,33 @@
|
|||||||
|
|
||||||
namespace OpenWifi {
|
namespace OpenWifi {
|
||||||
|
|
||||||
const static std::string DB_DefFirmware_SelectFields_ForCreation{"Name VARCHAR(30) PRIMARY KEY, "
|
const static std::string DB_DefFirmware_SelectFields_ForCreation{
|
||||||
"uri TEXT, "
|
"Name VARCHAR(64) PRIMARY KEY, "
|
||||||
"Models TEXT, "
|
"uri TEXT, "
|
||||||
"Description TEXT, "
|
"revision TEXT, "
|
||||||
"Created BIGINT , "
|
"Models TEXT, "
|
||||||
"imageCreationDate BIGINT , "
|
"Description TEXT, "
|
||||||
"LastModified BIGINT)"};
|
"Created BIGINT , "
|
||||||
|
"imageCreationDate BIGINT , "
|
||||||
|
"LastModified BIGINT)" };
|
||||||
|
|
||||||
const static std::string DB_DefFirmware_SelectFields{"Name, "
|
const static std::string DB_DefFirmware_SelectFields{
|
||||||
"uri, "
|
"Name, "
|
||||||
"Models, "
|
"uri, "
|
||||||
"Description, "
|
"revision, "
|
||||||
"Created, "
|
"Models, "
|
||||||
"imageCreationDate, "
|
"Description, "
|
||||||
"LastModified "};
|
"Created, "
|
||||||
|
"imageCreationDate, "
|
||||||
|
"LastModified "};
|
||||||
|
|
||||||
const static std::string DB_DefFirmware_InsertValues{"?,?,?,?,?,?,?"};
|
const static std::string DB_DefFirmware_InsertValues{"?,?,?,?,?,?,?,?"};
|
||||||
|
|
||||||
typedef Poco::Tuple<std::string,
|
typedef Poco::Tuple<std::string,
|
||||||
std::string,
|
std::string,
|
||||||
std::string,
|
std::string,
|
||||||
std::string,
|
std::string,
|
||||||
|
std::string,
|
||||||
uint64_t,
|
uint64_t,
|
||||||
uint64_t,
|
uint64_t,
|
||||||
uint64_t>
|
uint64_t>
|
||||||
@@ -45,21 +50,23 @@ namespace OpenWifi {
|
|||||||
void Convert(const DefFirmwareRecordTuple &R, GWObjects::DefaultFirmware &T) {
|
void Convert(const DefFirmwareRecordTuple &R, GWObjects::DefaultFirmware &T) {
|
||||||
T.Name = R.get<0>();
|
T.Name = R.get<0>();
|
||||||
T.uri = R.get<1>();
|
T.uri = R.get<1>();
|
||||||
T.Models = RESTAPI_utils::to_object_array(R.get<2>());
|
T.revision = R.get<2>();
|
||||||
T.Description = R.get<3>();
|
T.Models = RESTAPI_utils::to_object_array(R.get<3>());
|
||||||
T.Created = R.get<4>();
|
T.Description = R.get<4>();
|
||||||
T.imageCreationDate = R.get<5>();
|
T.Created = R.get<5>();
|
||||||
T.LastModified = R.get<6>();
|
T.imageCreationDate = R.get<6>();
|
||||||
|
T.LastModified = R.get<7>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Convert(const GWObjects::DefaultFirmware &R, DefFirmwareRecordTuple &T) {
|
void Convert(const GWObjects::DefaultFirmware &R, DefFirmwareRecordTuple &T) {
|
||||||
T.set<0>(R.Name);
|
T.set<0>(R.Name);
|
||||||
T.set<1>(R.uri);
|
T.set<1>(R.uri);
|
||||||
T.set<2>(RESTAPI_utils::to_string(R.Models));
|
T.set<2>(R.revision);
|
||||||
T.set<3>(R.Description);
|
T.set<3>(RESTAPI_utils::to_string(R.Models));
|
||||||
T.set<4>(R.Created);
|
T.set<4>(R.Description);
|
||||||
T.set<5>(R.imageCreationDate);
|
T.set<5>(R.Created);
|
||||||
T.set<6>(R.LastModified);
|
T.set<6>(R.imageCreationDate);
|
||||||
|
T.set<7>(R.LastModified);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Storage::CreateDefaultFirmware(std::string &Name,
|
bool Storage::CreateDefaultFirmware(std::string &Name,
|
||||||
|
|||||||
@@ -282,8 +282,9 @@ namespace OpenWifi {
|
|||||||
|
|
||||||
if (dbType_ == pgsql || dbType_ == sqlite || dbType_ == mysql) {
|
if (dbType_ == pgsql || dbType_ == sqlite || dbType_ == mysql) {
|
||||||
Sess << "CREATE TABLE IF NOT EXISTS DefaultFirmwares ("
|
Sess << "CREATE TABLE IF NOT EXISTS DefaultFirmwares ("
|
||||||
"Name VARCHAR(30) PRIMARY KEY, "
|
"Name VARCHAR(64) PRIMARY KEY, "
|
||||||
"uri TEXT, "
|
"uri TEXT, "
|
||||||
|
"revision TEXT, "
|
||||||
"Models TEXT, "
|
"Models TEXT, "
|
||||||
"Description TEXT, "
|
"Description TEXT, "
|
||||||
"Created BIGINT , "
|
"Created BIGINT , "
|
||||||
|
|||||||
Reference in New Issue
Block a user