Documentation ¶
Index ¶
- type AppsDAO
- func (dao *AppsDAO) Delete(id int32) (rows int64, err error)
- func (dao *AppsDAO) Insert(do *do.AppsDO) (id int64, err error)
- func (dao *AppsDAO) SelectAppsByIdList(idList []int32) ([]do.AppsDO, error)
- func (dao *AppsDAO) SelectById(id int32) (*do.AppsDO, error)
- func (dao *AppsDAO) SelectListById() ([]do.AppsDO, error)
- func (dao *AppsDAO) Update(title string, id int32) (rows int64, err error)
- type AuthSaltsDAO
- type MessagesDAO
- func (dao *MessagesDAO) Insert(do *dataobject.MessagesDO) int64
- func (dao *MessagesDAO) SelectByIdList(idList []int32) []dataobject.MessagesDO
- func (dao *MessagesDAO) SelectByPts(user_id int32, pts int32) []map[string]interface{}
- func (dao *MessagesDAO) SelectByUserIdAndPeer(peer_type int32, user_id int32, peer_id int32) []dataobject.MessagesDO
- type UsersDAO
- func (dao *UsersDAO) Insert(do *do.UsersDO) (id int64, err error)
- func (dao *UsersDAO) SelectById(id int32) (*do.UsersDO, error)
- func (dao *UsersDAO) SelectByPhoneNumber(phone string) (*do.UsersDO, error)
- func (dao *UsersDAO) SelectByQueryString(username string, first_name string, last_name string, phone string) ([]do.UsersDO, error)
- func (dao *UsersDAO) SelectUsersByIdList(id_list []int32) ([]do.UsersDO, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppsDAO ¶
type AppsDAO struct {
// contains filtered or unexported fields
}
func NewAppsDAO ¶
func (*AppsDAO) Insert ¶
insert into apps(api_id, api_hash, title, short_name) values (:api_id, :api_hash, :title, :short_name) TODO(@benqi): sqlmap
func (*AppsDAO) SelectAppsByIdList ¶
select id, api_id, api_hash, title, short_name from apps where id in (:idList) TODO(@benqi): sqlmap
func (*AppsDAO) SelectById ¶
select id, api_id, api_hash, title, short_name from apps where id = :id TODO(@benqi): sqlmap
func (*AppsDAO) SelectListById ¶
select id, api_id, api_hash, title, short_name from apps limit 10 TODO(@benqi): sqlmap
type AuthSaltsDAO ¶
type AuthSaltsDAO struct {
// contains filtered or unexported fields
}
func NewAuthSaltsDAO ¶
func NewAuthSaltsDAO(db *sqlx.DB) *AuthSaltsDAO
func (*AuthSaltsDAO) Insert ¶
func (dao *AuthSaltsDAO) Insert(do *do.AuthSaltsDO) (id int64, err error)
insert into auth_salts(auth_id, salt) values (:auth_id, :salt) TODO(@benqi): sqlmap
func (*AuthSaltsDAO) SelectByAuthId ¶
func (dao *AuthSaltsDAO) SelectByAuthId(auth_id int64) (*do.AuthSaltsDO, error)
select auth_id, salt from auth_salts where auth_id = :auth_id TODO(@benqi): sqlmap
type MessagesDAO ¶
type MessagesDAO struct {
// contains filtered or unexported fields
}
func NewMessagesDAO ¶
func NewMessagesDAO(db *sqlx.DB) *MessagesDAO
func (*MessagesDAO) Insert ¶
func (dao *MessagesDAO) Insert(do *dataobject.MessagesDO) int64
insert into messages(user_id, peer_type, peer_id, random_id, message, date2, created_at) values (:user_id, :peer_type, :peer_id, :random_id, :message, :date2, :created_at) TODO(@benqi): sqlmap
func (*MessagesDAO) SelectByIdList ¶
func (dao *MessagesDAO) SelectByIdList(idList []int32) []dataobject.MessagesDO
select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where id in (:idList) TODO(@benqi): sqlmap
func (*MessagesDAO) SelectByPts ¶
func (dao *MessagesDAO) SelectByPts(user_id int32, pts int32) []map[string]interface{}
select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where id in (select message_id from message_boxs where user_id = :user_id and pts > :pts) TODO(@benqi): sqlmap
func (*MessagesDAO) SelectByUserIdAndPeer ¶
func (dao *MessagesDAO) SelectByUserIdAndPeer(peer_type int32, user_id int32, peer_id int32) []dataobject.MessagesDO
select id, user_id, peer_type, peer_id, random_id, message, date2 from messages where peer_type = :peer_type and (user_id = :user_id and peer_id = :peer_id) or (user_id = :peer_id and peer_id = :user_id) TODO(@benqi): sqlmap
type UsersDAO ¶
type UsersDAO struct {
// contains filtered or unexported fields
}
func NewUsersDAO ¶
func (*UsersDAO) SelectById ¶
select id, access_hash, first_name, last_name, username from users where id = :id limit 1 TODO(@benqi): sqlmap
func (*UsersDAO) SelectByPhoneNumber ¶
select id, access_hash, first_name, last_name, username from users where phone = :phone limit 1 TODO(@benqi): sqlmap
func (*UsersDAO) SelectByQueryString ¶
func (dao *UsersDAO) SelectByQueryString(username string, first_name string, last_name string, phone string) ([]do.UsersDO, error)
select id, access_hash, first_name, last_name, username, phone from users where username = :username or first_name = :first_name or last_name = :last_name or phone = :phone limit 20 TODO(@benqi): sqlmap