mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
Modify the orm command of drogon_ctl (#224)
This commit is contained in:
parent
043c484a64
commit
4e274b1a2e
@ -145,7 +145,7 @@ const std::string &[[className]]::getColumnName(size_t index) noexcept(false)
|
||||
$$<<" return defaultValue;\n";
|
||||
$$<<"}\n";
|
||||
}
|
||||
$$<<"std::shared_ptr<const "<<col._colType<<"> "<<className<<"::get"<<col._colTypeName<<"() const noexcept\n";
|
||||
$$<<"const std::shared_ptr<"<<col._colType<<"> &"<<className<<"::get"<<col._colTypeName<<"() const noexcept\n";
|
||||
$$<<"{\n";
|
||||
$$<<" return _"<<col._colValName<<";\n";
|
||||
$$<<"}\n";
|
||||
|
@ -95,7 +95,7 @@ auto cols=@@.get<std::vector<ColumnInfo>>("columns");
|
||||
$$<<" std::string getValueOf"<<col._colTypeName<<"AsString() const noexcept;\n";
|
||||
}
|
||||
$$<<" ///Return a shared_ptr object pointing to the column const value, or an empty shared_ptr object if the column is null\n";
|
||||
$$<<" std::shared_ptr<const "<<col._colType<<"> get"<<col._colTypeName<<"() const noexcept;\n";
|
||||
$$<<" const std::shared_ptr<"<<col._colType<<"> &get"<<col._colTypeName<<"() const noexcept;\n";
|
||||
if(!col._isAutoVal)
|
||||
{
|
||||
$$<<" ///Set the value of the column "<<col._colName<<"\n";
|
||||
|
@ -97,7 +97,7 @@ const uint64_t &Groups::getValueOfGroupId() const noexcept
|
||||
return *_groupId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const uint64_t> Groups::getGroupId() const noexcept
|
||||
const std::shared_ptr<uint64_t> &Groups::getGroupId() const noexcept
|
||||
{
|
||||
return _groupId;
|
||||
}
|
||||
@ -114,7 +114,7 @@ const std::string &Groups::getValueOfGroupName() const noexcept
|
||||
return *_groupName;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Groups::getGroupName() const noexcept
|
||||
const std::shared_ptr<std::string> &Groups::getGroupName() const noexcept
|
||||
{
|
||||
return _groupName;
|
||||
}
|
||||
@ -136,7 +136,7 @@ const uint64_t &Groups::getValueOfCreaterId() const noexcept
|
||||
return *_createrId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const uint64_t> Groups::getCreaterId() const noexcept
|
||||
const std::shared_ptr<uint64_t> &Groups::getCreaterId() const noexcept
|
||||
{
|
||||
return _createrId;
|
||||
}
|
||||
@ -153,7 +153,7 @@ const std::string &Groups::getValueOfCreateTime() const noexcept
|
||||
return *_createTime;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Groups::getCreateTime() const noexcept
|
||||
const std::shared_ptr<std::string> &Groups::getCreateTime() const noexcept
|
||||
{
|
||||
return _createTime;
|
||||
}
|
||||
@ -175,7 +175,7 @@ const uint64_t &Groups::getValueOfInviting() const noexcept
|
||||
return *_inviting;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const uint64_t> Groups::getInviting() const noexcept
|
||||
const std::shared_ptr<uint64_t> &Groups::getInviting() const noexcept
|
||||
{
|
||||
return _inviting;
|
||||
}
|
||||
@ -192,7 +192,7 @@ const uint64_t &Groups::getValueOfInvitingUserId() const noexcept
|
||||
return *_invitingUserId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const uint64_t> Groups::getInvitingUserId() const noexcept
|
||||
const std::shared_ptr<uint64_t> &Groups::getInvitingUserId() const noexcept
|
||||
{
|
||||
return _invitingUserId;
|
||||
}
|
||||
@ -209,7 +209,7 @@ const std::string &Groups::getValueOfAvatarId() const noexcept
|
||||
return *_avatarId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Groups::getAvatarId() const noexcept
|
||||
const std::shared_ptr<std::string> &Groups::getAvatarId() const noexcept
|
||||
{
|
||||
return _avatarId;
|
||||
}
|
||||
@ -231,7 +231,7 @@ const double &Groups::getValueOfUuu() const noexcept
|
||||
return *_uuu;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const double> Groups::getUuu() const noexcept
|
||||
const std::shared_ptr<double> &Groups::getUuu() const noexcept
|
||||
{
|
||||
return _uuu;
|
||||
}
|
||||
@ -248,7 +248,7 @@ const std::string &Groups::getValueOfText() const noexcept
|
||||
return *_text;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Groups::getText() const noexcept
|
||||
const std::shared_ptr<std::string> &Groups::getText() const noexcept
|
||||
{
|
||||
return _text;
|
||||
}
|
||||
@ -277,7 +277,7 @@ std::string Groups::getValueOfAvatarAsString() const noexcept
|
||||
return std::string(_avatar->data(), _avatar->size());
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::vector<char>> Groups::getAvatar() const noexcept
|
||||
const std::shared_ptr<std::vector<char>> &Groups::getAvatar() const noexcept
|
||||
{
|
||||
return _avatar;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ class Groups
|
||||
const uint64_t &getValueOfGroupId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const uint64_t> getGroupId() const noexcept;
|
||||
const std::shared_ptr<uint64_t> &getGroupId() const noexcept;
|
||||
|
||||
/** For column group_name */
|
||||
/// Get the value of the column group_name, returns the default value if the
|
||||
@ -66,7 +66,7 @@ class Groups
|
||||
const std::string &getValueOfGroupName() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getGroupName() const noexcept;
|
||||
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;
|
||||
@ -77,7 +77,7 @@ class Groups
|
||||
const uint64_t &getValueOfCreaterId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const uint64_t> getCreaterId() const noexcept;
|
||||
const std::shared_ptr<uint64_t> &getCreaterId() const noexcept;
|
||||
/// Set the value of the column creater_id
|
||||
void setCreaterId(const uint64_t &createrId) noexcept;
|
||||
|
||||
@ -87,7 +87,7 @@ class Groups
|
||||
const std::string &getValueOfCreateTime() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getCreateTime() const noexcept;
|
||||
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;
|
||||
@ -98,7 +98,7 @@ class Groups
|
||||
const uint64_t &getValueOfInviting() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const uint64_t> getInviting() const noexcept;
|
||||
const std::shared_ptr<uint64_t> &getInviting() const noexcept;
|
||||
/// Set the value of the column inviting
|
||||
void setInviting(const uint64_t &inviting) noexcept;
|
||||
|
||||
@ -108,7 +108,7 @@ class Groups
|
||||
const uint64_t &getValueOfInvitingUserId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const uint64_t> getInvitingUserId() const noexcept;
|
||||
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;
|
||||
|
||||
@ -118,7 +118,7 @@ class Groups
|
||||
const std::string &getValueOfAvatarId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getAvatarId() const noexcept;
|
||||
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;
|
||||
@ -129,7 +129,7 @@ class Groups
|
||||
const double &getValueOfUuu() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const double> getUuu() const noexcept;
|
||||
const std::shared_ptr<double> &getUuu() const noexcept;
|
||||
/// Set the value of the column uuu
|
||||
void setUuu(const double &uuu) noexcept;
|
||||
|
||||
@ -139,7 +139,7 @@ class Groups
|
||||
const std::string &getValueOfText() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getText() const noexcept;
|
||||
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;
|
||||
@ -152,7 +152,7 @@ class Groups
|
||||
std::string getValueOfAvatarAsString() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::vector<char>> getAvatar() const noexcept;
|
||||
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;
|
||||
|
@ -91,7 +91,7 @@ const std::string &Users::getValueOfUserId() const noexcept
|
||||
return *_userId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getUserId() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getUserId() const noexcept
|
||||
{
|
||||
return _userId;
|
||||
}
|
||||
@ -113,7 +113,7 @@ const std::string &Users::getValueOfUserName() const noexcept
|
||||
return *_userName;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getUserName() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getUserName() const noexcept
|
||||
{
|
||||
return _userName;
|
||||
}
|
||||
@ -135,7 +135,7 @@ const std::string &Users::getValueOfPassword() const noexcept
|
||||
return *_password;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getPassword() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getPassword() const noexcept
|
||||
{
|
||||
return _password;
|
||||
}
|
||||
@ -157,7 +157,7 @@ const std::string &Users::getValueOfOrgName() const noexcept
|
||||
return *_orgName;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getOrgName() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getOrgName() const noexcept
|
||||
{
|
||||
return _orgName;
|
||||
}
|
||||
@ -179,7 +179,7 @@ const std::string &Users::getValueOfSignature() const noexcept
|
||||
return *_signature;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getSignature() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getSignature() const noexcept
|
||||
{
|
||||
return _signature;
|
||||
}
|
||||
@ -201,7 +201,7 @@ const std::string &Users::getValueOfAvatarId() const noexcept
|
||||
return *_avatarId;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getAvatarId() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getAvatarId() const noexcept
|
||||
{
|
||||
return _avatarId;
|
||||
}
|
||||
@ -223,7 +223,7 @@ const int32_t &Users::getValueOfId() const noexcept
|
||||
return *_id;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const int32_t> Users::getId() const noexcept
|
||||
const std::shared_ptr<int32_t> &Users::getId() const noexcept
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
@ -240,7 +240,7 @@ const std::string &Users::getValueOfSalt() const noexcept
|
||||
return *_salt;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const std::string> Users::getSalt() const noexcept
|
||||
const std::shared_ptr<std::string> &Users::getSalt() const noexcept
|
||||
{
|
||||
return _salt;
|
||||
}
|
||||
@ -262,7 +262,7 @@ const bool &Users::getValueOfAdmin() const noexcept
|
||||
return *_admin;
|
||||
return defaultValue;
|
||||
}
|
||||
std::shared_ptr<const bool> Users::getAdmin() const noexcept
|
||||
const std::shared_ptr<bool> &Users::getAdmin() const noexcept
|
||||
{
|
||||
return _admin;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class Users
|
||||
const std::string &getValueOfUserId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getUserId() const noexcept;
|
||||
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;
|
||||
@ -68,7 +68,7 @@ class Users
|
||||
const std::string &getValueOfUserName() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getUserName() const noexcept;
|
||||
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;
|
||||
@ -79,7 +79,7 @@ class Users
|
||||
const std::string &getValueOfPassword() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getPassword() const noexcept;
|
||||
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;
|
||||
@ -90,7 +90,7 @@ class Users
|
||||
const std::string &getValueOfOrgName() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getOrgName() const noexcept;
|
||||
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;
|
||||
@ -101,7 +101,7 @@ class Users
|
||||
const std::string &getValueOfSignature() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getSignature() const noexcept;
|
||||
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;
|
||||
@ -112,7 +112,7 @@ class Users
|
||||
const std::string &getValueOfAvatarId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getAvatarId() const noexcept;
|
||||
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;
|
||||
@ -123,7 +123,7 @@ class Users
|
||||
const int32_t &getValueOfId() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const int32_t> getId() const noexcept;
|
||||
const std::shared_ptr<int32_t> &getId() const noexcept;
|
||||
|
||||
/** For column salt */
|
||||
/// Get the value of the column salt, returns the default value if the
|
||||
@ -131,7 +131,7 @@ class Users
|
||||
const std::string &getValueOfSalt() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const std::string> getSalt() const noexcept;
|
||||
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;
|
||||
@ -142,7 +142,7 @@ class Users
|
||||
const bool &getValueOfAdmin() const noexcept;
|
||||
/// Return a shared_ptr object pointing to the column const value, or an
|
||||
/// empty shared_ptr object if the column is null
|
||||
std::shared_ptr<const bool> getAdmin() const noexcept;
|
||||
const std::shared_ptr<bool> &getAdmin() const noexcept;
|
||||
/// Set the value of the column admin
|
||||
void setAdmin(const bool &admin) noexcept;
|
||||
|
||||
|
2
trantor
2
trantor
@ -1 +1 @@
|
||||
Subproject commit 823ddf71fc7b993708ca71ebb0bde9ec382988db
|
||||
Subproject commit 59614659c7b2a85d64c2a24a54da4d1ebbb2c942
|
Loading…
Reference in New Issue
Block a user