Add prefixes to column name variables in model classes (#242)
This commit is contained in:
parent
fff40952a3
commit
456d003482
|
@ -31,7 +31,7 @@ else
|
|||
|
||||
<%c++for(auto col:cols){
|
||||
%>
|
||||
const std::string [[className]]::Cols::{%col._colName%} = "{%col._colName%}";
|
||||
const std::string [[className]]::Cols::_{%col._colName%} = "{%col._colName%}";
|
||||
<%c++
|
||||
}%>
|
||||
<%c++if(@@.get<int>("hasPrimaryKey")<=1){%>
|
||||
|
@ -167,33 +167,33 @@ const std::string &[[className]]::getColumnName(size_t index) noexcept(false)
|
|||
|
||||
if(!col._isAutoVal)
|
||||
{
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"(const "<<col._colType<<" &"<<col._colValName<<") noexcept\n";
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"(const "<<col._colType<<" &p"<<col._colTypeName<<") noexcept\n";
|
||||
$$<<"{\n";
|
||||
if(col._colDatabaseType=="date")
|
||||
{
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">("<<col._colValName<<".roundDay());\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">(p"<<col._colTypeName<<".roundDay());\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">("<<col._colValName<<");\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">(p"<<col._colTypeName<<");\n";
|
||||
}
|
||||
$$<<" _dirtyFlag["<<i<<"] = true;\n";
|
||||
$$<<"}\n";
|
||||
|
||||
if(col._colType=="std::string")
|
||||
{
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"("<<col._colType<<" &&"<<col._colValName<<") noexcept\n";
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"("<<col._colType<<" &&p"<<col._colTypeName<<") noexcept\n";
|
||||
$$<<"{\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">(std::move("<<col._colValName<<"));\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<"<<col._colType<<">(std::move(p"<<col._colTypeName<<"));\n";
|
||||
$$<<" _dirtyFlag["<<i<<"] = true;\n";
|
||||
$$<<"}\n";
|
||||
}
|
||||
|
||||
if(col._colType=="std::vector<char>")
|
||||
{
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"(const std::string &"<<col._colValName<<") noexcept\n";
|
||||
$$<<"void "<<className<<"::set"<<col._colTypeName<<"(const std::string &p"<<col._colTypeName<<") noexcept\n";
|
||||
$$<<"{\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<std::vector<char>>("<<col._colValName<<".c_str(),"<<col._colValName<<".c_str()+"<<col._colValName<<".length());\n";
|
||||
$$<<" _"<<col._colValName<<" = std::make_shared<std::vector<char>>(p"<<col._colTypeName<<".c_str(),p"<<col._colTypeName<<".c_str()+p"<<col._colTypeName<<".length());\n";
|
||||
$$<<" _dirtyFlag["<<i<<"] = true;\n";
|
||||
$$<<"}\n";
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class [[className]]
|
|||
auto cols=@@.get<std::vector<ColumnInfo>>("columns");
|
||||
for(size_t i=0;i<cols.size();i++)
|
||||
{
|
||||
$$<<" static const std::string "<<cols[i]._colName<<";\n";
|
||||
$$<<" static const std::string _"<<cols[i]._colName<<";\n";
|
||||
}
|
||||
%>
|
||||
};
|
||||
|
@ -89,7 +89,7 @@ auto cols=@@.get<std::vector<ColumnInfo>>("columns");
|
|||
[[className]]() = default;
|
||||
|
||||
<%c++
|
||||
for(auto col:cols)
|
||||
for(const auto &col:cols)
|
||||
{
|
||||
$$<<" /** For column "<<col._colName<<" */\n";
|
||||
if(!col._colType.empty())
|
||||
|
@ -106,12 +106,12 @@ auto cols=@@.get<std::vector<ColumnInfo>>("columns");
|
|||
if(!col._isAutoVal)
|
||||
{
|
||||
$$<<" ///Set the value of the column "<<col._colName<<"\n";
|
||||
$$<<" void set"<<col._colTypeName<<"(const "<<col._colType<<" &"<<col._colValName<<") noexcept;\n";
|
||||
$$<<" void set"<<col._colTypeName<<"(const "<<col._colType<<" &p"<<col._colTypeName<<") noexcept;\n";
|
||||
if(col._colType=="std::string")
|
||||
$$<<" void set"<<col._colTypeName<<"("<<col._colType<<" &&"<<col._colValName<<") noexcept;\n";
|
||||
$$<<" void set"<<col._colTypeName<<"("<<col._colType<<" &&p"<<col._colTypeName<<") noexcept;\n";
|
||||
if(col._colType=="std::vector<char>")
|
||||
{
|
||||
$$<<" void set"<<col._colTypeName<<"(const std::string &"<<col._colValName<<") noexcept;\n";
|
||||
$$<<" void set"<<col._colTypeName<<"(const std::string &p"<<col._colTypeName<<") noexcept;\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,17 @@
|
|||
using namespace drogon;
|
||||
using namespace drogon_model::sqlite3;
|
||||
|
||||
const std::string Groups::Cols::group_id = "group_id";
|
||||
const std::string Groups::Cols::group_name = "group_name";
|
||||
const std::string Groups::Cols::creater_id = "creater_id";
|
||||
const std::string Groups::Cols::create_time = "create_time";
|
||||
const std::string Groups::Cols::inviting = "inviting";
|
||||
const std::string Groups::Cols::inviting_user_id = "inviting_user_id";
|
||||
const std::string Groups::Cols::avatar_id = "avatar_id";
|
||||
const std::string Groups::Cols::uuu = "uuu";
|
||||
const std::string Groups::Cols::text = "text";
|
||||
const std::string Groups::Cols::avatar = "avatar";
|
||||
const std::string Groups::Cols::is_default = "is_default";
|
||||
const std::string Groups::Cols::_group_id = "group_id";
|
||||
const std::string Groups::Cols::_group_name = "group_name";
|
||||
const std::string Groups::Cols::_creater_id = "creater_id";
|
||||
const std::string Groups::Cols::_create_time = "create_time";
|
||||
const std::string Groups::Cols::_inviting = "inviting";
|
||||
const std::string Groups::Cols::_inviting_user_id = "inviting_user_id";
|
||||
const std::string Groups::Cols::_avatar_id = "avatar_id";
|
||||
const std::string Groups::Cols::_uuu = "uuu";
|
||||
const std::string Groups::Cols::_text = "text";
|
||||
const std::string Groups::Cols::_avatar = "avatar";
|
||||
const std::string Groups::Cols::_is_default = "is_default";
|
||||
const std::string Groups::primaryKeyName = "group_id";
|
||||
const bool Groups::hasPrimaryKey = true;
|
||||
const std::string Groups::tableName = "GROUPS";
|
||||
|
@ -124,14 +124,14 @@ const std::shared_ptr<std::string> &Groups::getGroupName() const noexcept
|
|||
{
|
||||
return _groupName;
|
||||
}
|
||||
void Groups::setGroupName(const std::string &groupName) noexcept
|
||||
void Groups::setGroupName(const std::string &pGroupName) noexcept
|
||||
{
|
||||
_groupName = std::make_shared<std::string>(groupName);
|
||||
_groupName = std::make_shared<std::string>(pGroupName);
|
||||
_dirtyFlag[1] = true;
|
||||
}
|
||||
void Groups::setGroupName(std::string &&groupName) noexcept
|
||||
void Groups::setGroupName(std::string &&pGroupName) noexcept
|
||||
{
|
||||
_groupName = std::make_shared<std::string>(std::move(groupName));
|
||||
_groupName = std::make_shared<std::string>(std::move(pGroupName));
|
||||
_dirtyFlag[1] = true;
|
||||
}
|
||||
|
||||
|
@ -146,9 +146,9 @@ const std::shared_ptr<uint64_t> &Groups::getCreaterId() const noexcept
|
|||
{
|
||||
return _createrId;
|
||||
}
|
||||
void Groups::setCreaterId(const uint64_t &createrId) noexcept
|
||||
void Groups::setCreaterId(const uint64_t &pCreaterId) noexcept
|
||||
{
|
||||
_createrId = std::make_shared<uint64_t>(createrId);
|
||||
_createrId = std::make_shared<uint64_t>(pCreaterId);
|
||||
_dirtyFlag[2] = true;
|
||||
}
|
||||
|
||||
|
@ -163,14 +163,14 @@ const std::shared_ptr<std::string> &Groups::getCreateTime() const noexcept
|
|||
{
|
||||
return _createTime;
|
||||
}
|
||||
void Groups::setCreateTime(const std::string &createTime) noexcept
|
||||
void Groups::setCreateTime(const std::string &pCreateTime) noexcept
|
||||
{
|
||||
_createTime = std::make_shared<std::string>(createTime);
|
||||
_createTime = std::make_shared<std::string>(pCreateTime);
|
||||
_dirtyFlag[3] = true;
|
||||
}
|
||||
void Groups::setCreateTime(std::string &&createTime) noexcept
|
||||
void Groups::setCreateTime(std::string &&pCreateTime) noexcept
|
||||
{
|
||||
_createTime = std::make_shared<std::string>(std::move(createTime));
|
||||
_createTime = std::make_shared<std::string>(std::move(pCreateTime));
|
||||
_dirtyFlag[3] = true;
|
||||
}
|
||||
|
||||
|
@ -185,9 +185,9 @@ const std::shared_ptr<uint64_t> &Groups::getInviting() const noexcept
|
|||
{
|
||||
return _inviting;
|
||||
}
|
||||
void Groups::setInviting(const uint64_t &inviting) noexcept
|
||||
void Groups::setInviting(const uint64_t &pInviting) noexcept
|
||||
{
|
||||
_inviting = std::make_shared<uint64_t>(inviting);
|
||||
_inviting = std::make_shared<uint64_t>(pInviting);
|
||||
_dirtyFlag[4] = true;
|
||||
}
|
||||
|
||||
|
@ -202,9 +202,9 @@ const std::shared_ptr<uint64_t> &Groups::getInvitingUserId() const noexcept
|
|||
{
|
||||
return _invitingUserId;
|
||||
}
|
||||
void Groups::setInvitingUserId(const uint64_t &invitingUserId) noexcept
|
||||
void Groups::setInvitingUserId(const uint64_t &pInvitingUserId) noexcept
|
||||
{
|
||||
_invitingUserId = std::make_shared<uint64_t>(invitingUserId);
|
||||
_invitingUserId = std::make_shared<uint64_t>(pInvitingUserId);
|
||||
_dirtyFlag[5] = true;
|
||||
}
|
||||
|
||||
|
@ -219,14 +219,14 @@ const std::shared_ptr<std::string> &Groups::getAvatarId() const noexcept
|
|||
{
|
||||
return _avatarId;
|
||||
}
|
||||
void Groups::setAvatarId(const std::string &avatarId) noexcept
|
||||
void Groups::setAvatarId(const std::string &pAvatarId) noexcept
|
||||
{
|
||||
_avatarId = std::make_shared<std::string>(avatarId);
|
||||
_avatarId = std::make_shared<std::string>(pAvatarId);
|
||||
_dirtyFlag[6] = true;
|
||||
}
|
||||
void Groups::setAvatarId(std::string &&avatarId) noexcept
|
||||
void Groups::setAvatarId(std::string &&pAvatarId) noexcept
|
||||
{
|
||||
_avatarId = std::make_shared<std::string>(std::move(avatarId));
|
||||
_avatarId = std::make_shared<std::string>(std::move(pAvatarId));
|
||||
_dirtyFlag[6] = true;
|
||||
}
|
||||
|
||||
|
@ -241,9 +241,9 @@ const std::shared_ptr<double> &Groups::getUuu() const noexcept
|
|||
{
|
||||
return _uuu;
|
||||
}
|
||||
void Groups::setUuu(const double &uuu) noexcept
|
||||
void Groups::setUuu(const double &pUuu) noexcept
|
||||
{
|
||||
_uuu = std::make_shared<double>(uuu);
|
||||
_uuu = std::make_shared<double>(pUuu);
|
||||
_dirtyFlag[7] = true;
|
||||
}
|
||||
|
||||
|
@ -258,14 +258,14 @@ const std::shared_ptr<std::string> &Groups::getText() const noexcept
|
|||
{
|
||||
return _text;
|
||||
}
|
||||
void Groups::setText(const std::string &text) noexcept
|
||||
void Groups::setText(const std::string &pText) noexcept
|
||||
{
|
||||
_text = std::make_shared<std::string>(text);
|
||||
_text = std::make_shared<std::string>(pText);
|
||||
_dirtyFlag[8] = true;
|
||||
}
|
||||
void Groups::setText(std::string &&text) noexcept
|
||||
void Groups::setText(std::string &&pText) noexcept
|
||||
{
|
||||
_text = std::make_shared<std::string>(std::move(text));
|
||||
_text = std::make_shared<std::string>(std::move(pText));
|
||||
_dirtyFlag[8] = true;
|
||||
}
|
||||
|
||||
|
@ -287,17 +287,17 @@ const std::shared_ptr<std::vector<char>> &Groups::getAvatar() const noexcept
|
|||
{
|
||||
return _avatar;
|
||||
}
|
||||
void Groups::setAvatar(const std::vector<char> &avatar) noexcept
|
||||
void Groups::setAvatar(const std::vector<char> &pAvatar) noexcept
|
||||
{
|
||||
_avatar = std::make_shared<std::vector<char>>(avatar);
|
||||
_avatar = std::make_shared<std::vector<char>>(pAvatar);
|
||||
_dirtyFlag[9] = true;
|
||||
}
|
||||
|
||||
void Groups::setAvatar(const std::string &avatar) noexcept
|
||||
void Groups::setAvatar(const std::string &pAvatar) noexcept
|
||||
{
|
||||
_avatar =
|
||||
std::make_shared<std::vector<char>>(avatar.c_str(),
|
||||
avatar.c_str() + avatar.length());
|
||||
std::make_shared<std::vector<char>>(pAvatar.c_str(),
|
||||
pAvatar.c_str() + pAvatar.length());
|
||||
_dirtyFlag[9] = true;
|
||||
}
|
||||
|
||||
|
@ -312,9 +312,9 @@ const std::shared_ptr<bool> &Groups::getIsDefault() const noexcept
|
|||
{
|
||||
return _isDefault;
|
||||
}
|
||||
void Groups::setIsDefault(const bool &isDefault) noexcept
|
||||
void Groups::setIsDefault(const bool &pIsDefault) noexcept
|
||||
{
|
||||
_isDefault = std::make_shared<bool>(isDefault);
|
||||
_isDefault = std::make_shared<bool>(pIsDefault);
|
||||
_dirtyFlag[10] = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,17 +31,17 @@ class Groups
|
|||
public:
|
||||
struct Cols
|
||||
{
|
||||
static const std::string group_id;
|
||||
static const std::string group_name;
|
||||
static const std::string creater_id;
|
||||
static const std::string create_time;
|
||||
static const std::string inviting;
|
||||
static const std::string inviting_user_id;
|
||||
static const std::string avatar_id;
|
||||
static const std::string uuu;
|
||||
static const std::string text;
|
||||
static const std::string avatar;
|
||||
static const std::string is_default;
|
||||
static const std::string _group_id;
|
||||
static const std::string _group_name;
|
||||
static const std::string _creater_id;
|
||||
static const std::string _create_time;
|
||||
static const std::string _inviting;
|
||||
static const std::string _inviting_user_id;
|
||||
static const std::string _avatar_id;
|
||||
static const std::string _uuu;
|
||||
static const std::string _text;
|
||||
static const std::string _avatar;
|
||||
static const std::string _is_default;
|
||||
};
|
||||
|
||||
const static int primaryKeyNumber;
|
||||
|
@ -69,8 +69,8 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getGroupName() const noexcept;
|
||||
/// Set the value of the column group_name
|
||||
void setGroupName(const std::string &groupName) noexcept;
|
||||
void setGroupName(std::string &&groupName) noexcept;
|
||||
void setGroupName(const std::string &pGroupName) noexcept;
|
||||
void setGroupName(std::string &&pGroupName) noexcept;
|
||||
|
||||
/** For column creater_id */
|
||||
/// Get the value of the column creater_id, returns the default value if the
|
||||
|
@ -80,7 +80,7 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<uint64_t> &getCreaterId() const noexcept;
|
||||
/// Set the value of the column creater_id
|
||||
void setCreaterId(const uint64_t &createrId) noexcept;
|
||||
void setCreaterId(const uint64_t &pCreaterId) noexcept;
|
||||
|
||||
/** For column create_time */
|
||||
/// Get the value of the column create_time, returns the default value if
|
||||
|
@ -90,8 +90,8 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getCreateTime() const noexcept;
|
||||
/// Set the value of the column create_time
|
||||
void setCreateTime(const std::string &createTime) noexcept;
|
||||
void setCreateTime(std::string &&createTime) noexcept;
|
||||
void setCreateTime(const std::string &pCreateTime) noexcept;
|
||||
void setCreateTime(std::string &&pCreateTime) noexcept;
|
||||
|
||||
/** For column inviting */
|
||||
/// Get the value of the column inviting, returns the default value if the
|
||||
|
@ -101,7 +101,7 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<uint64_t> &getInviting() const noexcept;
|
||||
/// Set the value of the column inviting
|
||||
void setInviting(const uint64_t &inviting) noexcept;
|
||||
void setInviting(const uint64_t &pInviting) noexcept;
|
||||
|
||||
/** For column inviting_user_id */
|
||||
/// Get the value of the column inviting_user_id, returns the default value
|
||||
|
@ -111,7 +111,7 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<uint64_t> &getInvitingUserId() const noexcept;
|
||||
/// Set the value of the column inviting_user_id
|
||||
void setInvitingUserId(const uint64_t &invitingUserId) noexcept;
|
||||
void setInvitingUserId(const uint64_t &pInvitingUserId) noexcept;
|
||||
|
||||
/** For column avatar_id */
|
||||
/// Get the value of the column avatar_id, returns the default value if the
|
||||
|
@ -121,8 +121,8 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getAvatarId() const noexcept;
|
||||
/// Set the value of the column avatar_id
|
||||
void setAvatarId(const std::string &avatarId) noexcept;
|
||||
void setAvatarId(std::string &&avatarId) noexcept;
|
||||
void setAvatarId(const std::string &pAvatarId) noexcept;
|
||||
void setAvatarId(std::string &&pAvatarId) noexcept;
|
||||
|
||||
/** For column uuu */
|
||||
/// Get the value of the column uuu, returns the default value if the column
|
||||
|
@ -132,7 +132,7 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<double> &getUuu() const noexcept;
|
||||
/// Set the value of the column uuu
|
||||
void setUuu(const double &uuu) noexcept;
|
||||
void setUuu(const double &pUuu) noexcept;
|
||||
|
||||
/** For column text */
|
||||
/// Get the value of the column text, returns the default value if the
|
||||
|
@ -142,8 +142,8 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getText() const noexcept;
|
||||
/// Set the value of the column text
|
||||
void setText(const std::string &text) noexcept;
|
||||
void setText(std::string &&text) noexcept;
|
||||
void setText(const std::string &pText) noexcept;
|
||||
void setText(std::string &&pText) noexcept;
|
||||
|
||||
/** For column avatar */
|
||||
/// Get the value of the column avatar, returns the default value if the
|
||||
|
@ -155,8 +155,8 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::vector<char>> &getAvatar() const noexcept;
|
||||
/// Set the value of the column avatar
|
||||
void setAvatar(const std::vector<char> &avatar) noexcept;
|
||||
void setAvatar(const std::string &avatar) noexcept;
|
||||
void setAvatar(const std::vector<char> &pAvatar) noexcept;
|
||||
void setAvatar(const std::string &pAvatar) noexcept;
|
||||
|
||||
/** For column is_default */
|
||||
/// Get the value of the column is_default, returns the default value if the
|
||||
|
@ -166,7 +166,7 @@ class Groups
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<bool> &getIsDefault() const noexcept;
|
||||
/// Set the value of the column is_default
|
||||
void setIsDefault(const bool &isDefault) noexcept;
|
||||
void setIsDefault(const bool &pIsDefault) noexcept;
|
||||
|
||||
static size_t getColumnNumber() noexcept
|
||||
{
|
||||
|
@ -208,6 +208,5 @@ class Groups
|
|||
static const std::vector<MetaData> _metaData;
|
||||
bool _dirtyFlag[11] = {false};
|
||||
};
|
||||
|
||||
} // namespace sqlite3
|
||||
} // namespace drogon_model
|
||||
|
|
|
@ -12,15 +12,15 @@
|
|||
using namespace drogon;
|
||||
using namespace drogon_model::postgres;
|
||||
|
||||
const std::string Users::Cols::user_id = "user_id";
|
||||
const std::string Users::Cols::user_name = "user_name";
|
||||
const std::string Users::Cols::password = "password";
|
||||
const std::string Users::Cols::org_name = "org_name";
|
||||
const std::string Users::Cols::signature = "signature";
|
||||
const std::string Users::Cols::avatar_id = "avatar_id";
|
||||
const std::string Users::Cols::id = "id";
|
||||
const std::string Users::Cols::salt = "salt";
|
||||
const std::string Users::Cols::admin = "admin";
|
||||
const std::string Users::Cols::_user_id = "user_id";
|
||||
const std::string Users::Cols::_user_name = "user_name";
|
||||
const std::string Users::Cols::_password = "password";
|
||||
const std::string Users::Cols::_org_name = "org_name";
|
||||
const std::string Users::Cols::_signature = "signature";
|
||||
const std::string Users::Cols::_avatar_id = "avatar_id";
|
||||
const std::string Users::Cols::_id = "id";
|
||||
const std::string Users::Cols::_salt = "salt";
|
||||
const std::string Users::Cols::_admin = "admin";
|
||||
const std::string Users::primaryKeyName = "id";
|
||||
const bool Users::hasPrimaryKey = true;
|
||||
const std::string Users::tableName = "users";
|
||||
|
@ -95,14 +95,14 @@ const std::shared_ptr<std::string> &Users::getUserId() const noexcept
|
|||
{
|
||||
return _userId;
|
||||
}
|
||||
void Users::setUserId(const std::string &userId) noexcept
|
||||
void Users::setUserId(const std::string &pUserId) noexcept
|
||||
{
|
||||
_userId = std::make_shared<std::string>(userId);
|
||||
_userId = std::make_shared<std::string>(pUserId);
|
||||
_dirtyFlag[0] = true;
|
||||
}
|
||||
void Users::setUserId(std::string &&userId) noexcept
|
||||
void Users::setUserId(std::string &&pUserId) noexcept
|
||||
{
|
||||
_userId = std::make_shared<std::string>(std::move(userId));
|
||||
_userId = std::make_shared<std::string>(std::move(pUserId));
|
||||
_dirtyFlag[0] = true;
|
||||
}
|
||||
|
||||
|
@ -117,14 +117,14 @@ const std::shared_ptr<std::string> &Users::getUserName() const noexcept
|
|||
{
|
||||
return _userName;
|
||||
}
|
||||
void Users::setUserName(const std::string &userName) noexcept
|
||||
void Users::setUserName(const std::string &pUserName) noexcept
|
||||
{
|
||||
_userName = std::make_shared<std::string>(userName);
|
||||
_userName = std::make_shared<std::string>(pUserName);
|
||||
_dirtyFlag[1] = true;
|
||||
}
|
||||
void Users::setUserName(std::string &&userName) noexcept
|
||||
void Users::setUserName(std::string &&pUserName) noexcept
|
||||
{
|
||||
_userName = std::make_shared<std::string>(std::move(userName));
|
||||
_userName = std::make_shared<std::string>(std::move(pUserName));
|
||||
_dirtyFlag[1] = true;
|
||||
}
|
||||
|
||||
|
@ -139,14 +139,14 @@ const std::shared_ptr<std::string> &Users::getPassword() const noexcept
|
|||
{
|
||||
return _password;
|
||||
}
|
||||
void Users::setPassword(const std::string &password) noexcept
|
||||
void Users::setPassword(const std::string &pPassword) noexcept
|
||||
{
|
||||
_password = std::make_shared<std::string>(password);
|
||||
_password = std::make_shared<std::string>(pPassword);
|
||||
_dirtyFlag[2] = true;
|
||||
}
|
||||
void Users::setPassword(std::string &&password) noexcept
|
||||
void Users::setPassword(std::string &&pPassword) noexcept
|
||||
{
|
||||
_password = std::make_shared<std::string>(std::move(password));
|
||||
_password = std::make_shared<std::string>(std::move(pPassword));
|
||||
_dirtyFlag[2] = true;
|
||||
}
|
||||
|
||||
|
@ -161,14 +161,14 @@ const std::shared_ptr<std::string> &Users::getOrgName() const noexcept
|
|||
{
|
||||
return _orgName;
|
||||
}
|
||||
void Users::setOrgName(const std::string &orgName) noexcept
|
||||
void Users::setOrgName(const std::string &pOrgName) noexcept
|
||||
{
|
||||
_orgName = std::make_shared<std::string>(orgName);
|
||||
_orgName = std::make_shared<std::string>(pOrgName);
|
||||
_dirtyFlag[3] = true;
|
||||
}
|
||||
void Users::setOrgName(std::string &&orgName) noexcept
|
||||
void Users::setOrgName(std::string &&pOrgName) noexcept
|
||||
{
|
||||
_orgName = std::make_shared<std::string>(std::move(orgName));
|
||||
_orgName = std::make_shared<std::string>(std::move(pOrgName));
|
||||
_dirtyFlag[3] = true;
|
||||
}
|
||||
|
||||
|
@ -183,14 +183,14 @@ const std::shared_ptr<std::string> &Users::getSignature() const noexcept
|
|||
{
|
||||
return _signature;
|
||||
}
|
||||
void Users::setSignature(const std::string &signature) noexcept
|
||||
void Users::setSignature(const std::string &pSignature) noexcept
|
||||
{
|
||||
_signature = std::make_shared<std::string>(signature);
|
||||
_signature = std::make_shared<std::string>(pSignature);
|
||||
_dirtyFlag[4] = true;
|
||||
}
|
||||
void Users::setSignature(std::string &&signature) noexcept
|
||||
void Users::setSignature(std::string &&pSignature) noexcept
|
||||
{
|
||||
_signature = std::make_shared<std::string>(std::move(signature));
|
||||
_signature = std::make_shared<std::string>(std::move(pSignature));
|
||||
_dirtyFlag[4] = true;
|
||||
}
|
||||
|
||||
|
@ -205,14 +205,14 @@ const std::shared_ptr<std::string> &Users::getAvatarId() const noexcept
|
|||
{
|
||||
return _avatarId;
|
||||
}
|
||||
void Users::setAvatarId(const std::string &avatarId) noexcept
|
||||
void Users::setAvatarId(const std::string &pAvatarId) noexcept
|
||||
{
|
||||
_avatarId = std::make_shared<std::string>(avatarId);
|
||||
_avatarId = std::make_shared<std::string>(pAvatarId);
|
||||
_dirtyFlag[5] = true;
|
||||
}
|
||||
void Users::setAvatarId(std::string &&avatarId) noexcept
|
||||
void Users::setAvatarId(std::string &&pAvatarId) noexcept
|
||||
{
|
||||
_avatarId = std::make_shared<std::string>(std::move(avatarId));
|
||||
_avatarId = std::make_shared<std::string>(std::move(pAvatarId));
|
||||
_dirtyFlag[5] = true;
|
||||
}
|
||||
|
||||
|
@ -244,14 +244,14 @@ const std::shared_ptr<std::string> &Users::getSalt() const noexcept
|
|||
{
|
||||
return _salt;
|
||||
}
|
||||
void Users::setSalt(const std::string &salt) noexcept
|
||||
void Users::setSalt(const std::string &pSalt) noexcept
|
||||
{
|
||||
_salt = std::make_shared<std::string>(salt);
|
||||
_salt = std::make_shared<std::string>(pSalt);
|
||||
_dirtyFlag[7] = true;
|
||||
}
|
||||
void Users::setSalt(std::string &&salt) noexcept
|
||||
void Users::setSalt(std::string &&pSalt) noexcept
|
||||
{
|
||||
_salt = std::make_shared<std::string>(std::move(salt));
|
||||
_salt = std::make_shared<std::string>(std::move(pSalt));
|
||||
_dirtyFlag[7] = true;
|
||||
}
|
||||
|
||||
|
@ -266,9 +266,9 @@ const std::shared_ptr<bool> &Users::getAdmin() const noexcept
|
|||
{
|
||||
return _admin;
|
||||
}
|
||||
void Users::setAdmin(const bool &admin) noexcept
|
||||
void Users::setAdmin(const bool &pAdmin) noexcept
|
||||
{
|
||||
_admin = std::make_shared<bool>(admin);
|
||||
_admin = std::make_shared<bool>(pAdmin);
|
||||
_dirtyFlag[8] = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,15 +31,15 @@ class Users
|
|||
public:
|
||||
struct Cols
|
||||
{
|
||||
static const std::string user_id;
|
||||
static const std::string user_name;
|
||||
static const std::string password;
|
||||
static const std::string org_name;
|
||||
static const std::string signature;
|
||||
static const std::string avatar_id;
|
||||
static const std::string id;
|
||||
static const std::string salt;
|
||||
static const std::string admin;
|
||||
static const std::string _user_id;
|
||||
static const std::string _user_name;
|
||||
static const std::string _password;
|
||||
static const std::string _org_name;
|
||||
static const std::string _signature;
|
||||
static const std::string _avatar_id;
|
||||
static const std::string _id;
|
||||
static const std::string _salt;
|
||||
static const std::string _admin;
|
||||
};
|
||||
|
||||
const static int primaryKeyNumber;
|
||||
|
@ -59,8 +59,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getUserId() const noexcept;
|
||||
/// Set the value of the column user_id
|
||||
void setUserId(const std::string &userId) noexcept;
|
||||
void setUserId(std::string &&userId) noexcept;
|
||||
void setUserId(const std::string &pUserId) noexcept;
|
||||
void setUserId(std::string &&pUserId) noexcept;
|
||||
|
||||
/** For column user_name */
|
||||
/// Get the value of the column user_name, returns the default value if the
|
||||
|
@ -70,8 +70,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getUserName() const noexcept;
|
||||
/// Set the value of the column user_name
|
||||
void setUserName(const std::string &userName) noexcept;
|
||||
void setUserName(std::string &&userName) noexcept;
|
||||
void setUserName(const std::string &pUserName) noexcept;
|
||||
void setUserName(std::string &&pUserName) noexcept;
|
||||
|
||||
/** For column password */
|
||||
/// Get the value of the column password, returns the default value if the
|
||||
|
@ -81,8 +81,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getPassword() const noexcept;
|
||||
/// Set the value of the column password
|
||||
void setPassword(const std::string &password) noexcept;
|
||||
void setPassword(std::string &&password) noexcept;
|
||||
void setPassword(const std::string &pPassword) noexcept;
|
||||
void setPassword(std::string &&pPassword) noexcept;
|
||||
|
||||
/** For column org_name */
|
||||
/// Get the value of the column org_name, returns the default value if the
|
||||
|
@ -92,8 +92,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getOrgName() const noexcept;
|
||||
/// Set the value of the column org_name
|
||||
void setOrgName(const std::string &orgName) noexcept;
|
||||
void setOrgName(std::string &&orgName) noexcept;
|
||||
void setOrgName(const std::string &pOrgName) noexcept;
|
||||
void setOrgName(std::string &&pOrgName) noexcept;
|
||||
|
||||
/** For column signature */
|
||||
/// Get the value of the column signature, returns the default value if the
|
||||
|
@ -103,8 +103,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getSignature() const noexcept;
|
||||
/// Set the value of the column signature
|
||||
void setSignature(const std::string &signature) noexcept;
|
||||
void setSignature(std::string &&signature) noexcept;
|
||||
void setSignature(const std::string &pSignature) noexcept;
|
||||
void setSignature(std::string &&pSignature) noexcept;
|
||||
|
||||
/** For column avatar_id */
|
||||
/// Get the value of the column avatar_id, returns the default value if the
|
||||
|
@ -114,8 +114,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getAvatarId() const noexcept;
|
||||
/// Set the value of the column avatar_id
|
||||
void setAvatarId(const std::string &avatarId) noexcept;
|
||||
void setAvatarId(std::string &&avatarId) noexcept;
|
||||
void setAvatarId(const std::string &pAvatarId) noexcept;
|
||||
void setAvatarId(std::string &&pAvatarId) noexcept;
|
||||
|
||||
/** For column id */
|
||||
/// Get the value of the column id, returns the default value if the column
|
||||
|
@ -133,8 +133,8 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<std::string> &getSalt() const noexcept;
|
||||
/// Set the value of the column salt
|
||||
void setSalt(const std::string &salt) noexcept;
|
||||
void setSalt(std::string &&salt) noexcept;
|
||||
void setSalt(const std::string &pSalt) noexcept;
|
||||
void setSalt(std::string &&pSalt) noexcept;
|
||||
|
||||
/** For column admin */
|
||||
/// Get the value of the column admin, returns the default value if the
|
||||
|
@ -144,7 +144,7 @@ class Users
|
|||
/// empty shared_ptr object if the column is null
|
||||
const std::shared_ptr<bool> &getAdmin() const noexcept;
|
||||
/// Set the value of the column admin
|
||||
void setAdmin(const bool &admin) noexcept;
|
||||
void setAdmin(const bool &pAdmin) noexcept;
|
||||
|
||||
static size_t getColumnNumber() noexcept
|
||||
{
|
||||
|
@ -184,6 +184,5 @@ class Users
|
|||
static const std::vector<MetaData> _metaData;
|
||||
bool _dirtyFlag[9] = {false};
|
||||
};
|
||||
|
||||
} // namespace postgres
|
||||
} // namespace drogon_model
|
||||
|
|
Loading…
Reference in New Issue