mirror of
https://gitee.com/Zhaoxin59/my-chat_-server.git
synced 2026-02-14 01:21:50 +08:00
update
This commit is contained in:
32
odb/chat_session_member.hxx
Normal file
32
odb/chat_session_member.hxx
Normal file
@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <cstddef>
|
||||
#include <odb/core.hxx>
|
||||
|
||||
namespace bite_im {
|
||||
#pragma db object table("chat_session_member")
|
||||
class ChatSessionMember {
|
||||
public:
|
||||
ChatSessionMember(){}
|
||||
ChatSessionMember(const std::string& ssid, const std::string &uid)
|
||||
:_session_id(ssid), _user_id(uid) {}
|
||||
~ChatSessionMember(){}
|
||||
|
||||
std::string session_id() const {return _session_id; }
|
||||
void session_id(std::string &ssid) { _session_id = ssid; }
|
||||
|
||||
std::string user_id() const { return _user_id; }
|
||||
void user_id(std::string &uid) {_user_id = uid; }
|
||||
|
||||
private:
|
||||
friend class odb::access;
|
||||
#pragma db id auto
|
||||
unsigned long _id;
|
||||
#pragma db type("varchar(64)") index
|
||||
std::string _session_id;
|
||||
#pragma db type("varchar(64)")
|
||||
std::string _user_id;
|
||||
};
|
||||
}
|
||||
|
||||
//odb -d mysql --generate-query --generate-schema --profile boost/date-time person.hxx
|
||||
Reference in New Issue
Block a user