mysql_dao

package
v0.0.0-...-d9af017 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 NewAppsDAO(db *sqlx.DB) *AppsDAO

func (*AppsDAO) Insert

func (dao *AppsDAO) Insert(do *dataobject.AppsDO) int64

insert into apps(api_id, api_hash, title, short_name) values (:api_id, :api_hash, :title, :short_name) TODO(@benqi): sqlmap

func (*AppsDAO) SelectById

func (dao *AppsDAO) SelectById(id int32) *dataobject.AppsDO

select id, api_id, api_hash, title, short_name from apps where id = :id TODO(@benqi): sqlmap

type AuthKeysDAO

type AuthKeysDAO struct {
	// contains filtered or unexported fields
}

func NewAuthKeysDAO

func NewAuthKeysDAO(db *sqlx.DB) *AuthKeysDAO

func (*AuthKeysDAO) Insert

func (dao *AuthKeysDAO) Insert(do *dataobject.AuthKeysDO) int64

insert into auth_keys(auth_id, body) values (:auth_id, :body) TODO(@benqi): sqlmap

func (*AuthKeysDAO) SelectByAuthId

func (dao *AuthKeysDAO) SelectByAuthId(auth_id int64) *dataobject.AuthKeysDO

select body from auth_keys where auth_id = :auth_id TODO(@benqi): sqlmap

type AuthPhoneTransactionsDAO

type AuthPhoneTransactionsDAO struct {
	// contains filtered or unexported fields
}

func NewAuthPhoneTransactionsDAO

func NewAuthPhoneTransactionsDAO(db *sqlx.DB) *AuthPhoneTransactionsDAO

func (*AuthPhoneTransactionsDAO) Insert

insert into auth_phone_transactions(transaction_hash, api_id, api_hash, phone_number, code, created_at) values (:transaction_hash, :api_id, :api_hash, :phone_number, :code, :created_at) TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) SelectByPhoneAndApiIdAndHash

func (dao *AuthPhoneTransactionsDAO) SelectByPhoneAndApiIdAndHash(phone_number string, api_id int32, api_hash string) *dataobject.AuthPhoneTransactionsDO

select transaction_hash from auth_phone_transactions where phone_number = :phone_number and api_id = :api_id and api_hash = :api_hash TODO(@benqi): sqlmap

func (*AuthPhoneTransactionsDAO) SelectByPhoneCode

func (dao *AuthPhoneTransactionsDAO) SelectByPhoneCode(transaction_hash string, code string, phone_number string) *dataobject.AuthPhoneTransactionsDO

select id from auth_phone_transactions where transaction_hash = :transaction_hash and code = :code and phone_number = :phone_number 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 *dataobject.AuthSaltsDO) int64

insert into auth_salts(auth_id, salt) values (:auth_id, :salt) TODO(@benqi): sqlmap

func (*AuthSaltsDAO) SelectByAuthId

func (dao *AuthSaltsDAO) SelectByAuthId(auth_id int64) *dataobject.AuthSaltsDO

select auth_id, salt from auth_salts where auth_id = :auth_id TODO(@benqi): sqlmap

type AuthUsersDAO

type AuthUsersDAO struct {
	// contains filtered or unexported fields
}

func NewAuthUsersDAO

func NewAuthUsersDAO(db *sqlx.DB) *AuthUsersDAO

func (*AuthUsersDAO) Insert

func (dao *AuthUsersDAO) Insert(do *dataobject.AuthUsersDO) int64

insert into auth_users(auth_id, user_id) values (:auth_id, :user_id) TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectByAuthId

func (dao *AuthUsersDAO) SelectByAuthId(auth_id int64) *dataobject.AuthUsersDO

select id, user_id from auth_users where auth_id = :auth_id TODO(@benqi): sqlmap

type AuthsDAO

type AuthsDAO struct {
	// contains filtered or unexported fields
}

func NewAuthsDAO

func NewAuthsDAO(db *sqlx.DB) *AuthsDAO

func (*AuthsDAO) Insert

func (dao *AuthsDAO) Insert(do *dataobject.AuthsDO) int64

insert into auths(auth_id, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, connection_hash) values (:auth_id, :api_id, :device_model, :system_version, :app_version, :system_lang_code, :lang_pack, :lang_code, :connection_hash) TODO(@benqi): sqlmap

func (*AuthsDAO) SelectConnectionHashByAuthId

func (dao *AuthsDAO) SelectConnectionHashByAuthId(auth_id int64) *dataobject.AuthsDO

select connection_hash from auths where auth_id = :auth_id TODO(@benqi): sqlmap

type ChatUsersDAO

type ChatUsersDAO struct {
	// contains filtered or unexported fields
}

func NewChatUsersDAO

func NewChatUsersDAO(db *sqlx.DB) *ChatUsersDAO

func (*ChatUsersDAO) DeleteChatUser

func (dao *ChatUsersDAO) DeleteChatUser(chat_id int32, user_id int32) int64

delete from chat_users where chat_id = :chat_id and user_id = :user_id TODO(@benqi): sqlmap

func (*ChatUsersDAO) Insert

func (dao *ChatUsersDAO) Insert(do *dataobject.ChatUsersDO) int64

insert into chat_users(chat_id, user_id, participant_type, inviter_user_id, invited_at, joined_at, state, created_at) values (:chat_id, :user_id, :participant_type, :inviter_user_id, :invited_at, :joined_at, :state, :created_at) TODO(@benqi): sqlmap

func (*ChatUsersDAO) SelectByChatId

func (dao *ChatUsersDAO) SelectByChatId(chat_id int32) []dataobject.ChatUsersDO

select id, chat_id, user_id, participant_type, inviter_user_id, invited_at, joined_at from chat_users where chat_id = :chat_id TODO(@benqi): sqlmap

type ChatsDAO

type ChatsDAO struct {
	// contains filtered or unexported fields
}

func NewChatsDAO

func NewChatsDAO(db *sqlx.DB) *ChatsDAO

func (*ChatsDAO) Insert

func (dao *ChatsDAO) Insert(do *dataobject.ChatsDO) int64

insert into chats(creator_user_id, access_hash, participant_count, create_random_id, title, title_changer_user_id, title_change_random_id, title_changed_at, avatar_changer_user_id, avatar_change_random_id, avatar_changed_at, created_at) values (:creator_user_id, :access_hash, :participant_count, :create_random_id, :title, :title_changer_user_id, :title_change_random_id, :title_changed_at, :avatar_changer_user_id, :avatar_change_random_id, :avatar_changed_at, :created_at) TODO(@benqi): sqlmap

func (*ChatsDAO) Select

func (dao *ChatsDAO) Select(id int32) *dataobject.ChatsDO

select id, participant_count, title, version from chats where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) SelectByIdList

func (dao *ChatsDAO) SelectByIdList(idList []int32) []dataobject.ChatsDO

select id, participant_count, title, version from chats where id in (:idList) TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateParticipantCount

func (dao *ChatsDAO) UpdateParticipantCount(participant_count int32, version int32, id int32) int64

update chats set participant_count = :participant_count, version = :version where id = :id TODO(@benqi): sqlmap

func (*ChatsDAO) UpdateTitle

func (dao *ChatsDAO) UpdateTitle(title string, title_changer_user_id int32, title_change_random_id int64, title_changed_at string, id int32) int64

update chats set title = :title, title_changer_user_id = :title_changer_user_id, title_change_random_id = :title_change_random_id, title_changed_at = :title_changed_at where id = :id TODO(@benqi): sqlmap

type ClientUpdatesStateDAO

type ClientUpdatesStateDAO struct {
	// contains filtered or unexported fields
}

func NewClientUpdatesStateDAO

func NewClientUpdatesStateDAO(db *sqlx.DB) *ClientUpdatesStateDAO

func (*ClientUpdatesStateDAO) Insert

insert into client_updates_state(auth_key_id, user_id, pts, qts, seq, date2) values (:auth_key_id, :user_id, :pts, :qts, :seq, :date2) TODO(@benqi): sqlmap

func (*ClientUpdatesStateDAO) SelectByAuthKeyAndUserId

func (dao *ClientUpdatesStateDAO) SelectByAuthKeyAndUserId(auth_key_id int64, user_id int32) *dataobject.ClientUpdatesStateDO

select auth_key_id, user_id, pts, qts, seq, date2 from client_updates_state where auth_key_id = :auth_key_id and user_id = :user_id TODO(@benqi): sqlmap

type CommonDAO

type CommonDAO struct {
	// contains filtered or unexported fields
}

func NewCommonDAO

func NewCommonDAO(db *sqlx.DB) *CommonDAO

func (*CommonDAO) CheckExists

func (dao *CommonDAO) CheckExists(table string, params map[string]interface{}) bool

检查是否存在 TODO(@benqi): SELECT count(id) 是否会快一点?

type DevicesDAO

type DevicesDAO struct {
	// contains filtered or unexported fields
}

func NewDevicesDAO

func NewDevicesDAO(db *sqlx.DB) *DevicesDAO

func (*DevicesDAO) Insert

func (dao *DevicesDAO) Insert(do *dataobject.DevicesDO) int64

insert into devices(auth_id, user_id, token_type, token, state) values (:auth_id, :user_id, :token_type, :token, :state) TODO(@benqi): sqlmap

func (*DevicesDAO) SelectId

func (dao *DevicesDAO) SelectId(auth_id int64, token_type int8, token string) *dataobject.DevicesDO

select id from devices where auth_id = :auth_id and token_type = :token_type and token = :token limit 1 TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateState

func (dao *DevicesDAO) UpdateState(state int8, auth_id int64, token_type int8, token string) int64

update devices set state = :state where auth_id = :auth_id and token_type = :token_type and token = :token TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateStateById

func (dao *DevicesDAO) UpdateStateById(state int8, id int32) int64

update devices set state = :state where id = :id TODO(@benqi): sqlmap

type MessageBoxesDAO

type MessageBoxesDAO struct {
	// contains filtered or unexported fields
}

func NewMessageBoxesDAO

func NewMessageBoxesDAO(db *sqlx.DB) *MessageBoxesDAO

func (*MessageBoxesDAO) Insert

insert into message_boxes(user_id, sender_user_id, message_box_type, peer_type, peer_id, pts, message_id, media_unread, date2, created_at) values (:user_id, :sender_user_id, :message_box_type, :peer_type, :peer_id, :pts, :message_id, :media_unread, :date2, :created_at) TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByGtPts

func (dao *MessageBoxesDAO) SelectByGtPts(user_id int32, pts int32) []dataobject.MessageBoxesDO

select user_id, sender_user_id, message_box_type, peer_type, peer_id, pts, message_id, media_unread, state, date2 from message_boxes where user_id = :user_id and pts > :pts TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByMessageIdList

func (dao *MessageBoxesDAO) SelectByMessageIdList(user_id int32, idList []int32) []dataobject.MessageBoxesDO

select user_id, sender_user_id, message_box_type, peer_type, peer_id, pts, message_id, media_unread, state, date2 from message_boxes where user_id = :user_id and message_id in (:idList) TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectByPeerOffsetLimit

func (dao *MessageBoxesDAO) SelectByPeerOffsetLimit(user_id int32, peer_type int8, peer_id int32, message_id int32, limit int32) []dataobject.MessageBoxesDO

select user_id, sender_user_id, message_box_type, peer_type, peer_id, pts, message_id, media_unread, state, date2 from message_boxes where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id and message_id < :message_id order by message_id desc limit :limit TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectLastPts

func (dao *MessageBoxesDAO) SelectLastPts(user_id int32) *dataobject.MessageBoxesDO

select pts from message_boxes where user_id = :user_id order by pts desc limit 1 TODO(@benqi): sqlmap

func (*MessageBoxesDAO) SelectPtsByGtMessageID

func (dao *MessageBoxesDAO) SelectPtsByGtMessageID(user_id int32, message_id int32) []dataobject.MessageBoxesDO

select pts from message_boxes where user_id = :user_id and message_id > :message_id order by pts asc 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(sender_user_id, peer_type, peer_id, random_id, message_type, message_data, date2) values (:sender_user_id, :peer_type, :peer_id, :random_id, :message_type, :message_data, :date2) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectByIdList

func (dao *MessagesDAO) SelectByIdList(idList []int32) []dataobject.MessagesDO

select id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, date2 from messages where id in (:idList) TODO(@benqi): sqlmap

func (*MessagesDAO) SelectOrderByIdList

func (dao *MessagesDAO) SelectOrderByIdList(idList []int32) []dataobject.MessagesDO

select id, sender_user_id, peer_type, peer_id, random_id, message_type, message_data, date2 from messages where id in (:idList) order by id desc TODO(@benqi): sqlmap

type ReportsDAO

type ReportsDAO struct {
	// contains filtered or unexported fields
}

func NewReportsDAO

func NewReportsDAO(db *sqlx.DB) *ReportsDAO

func (*ReportsDAO) Insert

func (dao *ReportsDAO) Insert(do *dataobject.ReportsDO) int64

insert into reports(auth_id, user_id, peer_type, peer_id, reason, content) values (:auth_id, :user_id, :peer_type, :peer_id, :reason, :content) TODO(@benqi): sqlmap

type SeqUpdatesNgenDAO

type SeqUpdatesNgenDAO struct {
	// contains filtered or unexported fields
}

func NewSeqUpdatesNgenDAO

func NewSeqUpdatesNgenDAO(db *sqlx.DB) *SeqUpdatesNgenDAO

func (*SeqUpdatesNgenDAO) Insert

insert into seq_updates_ngen(seq_name, seq, created_at) values (:seq_name, :seq, :created_at) TODO(@benqi): sqlmap

func (*SeqUpdatesNgenDAO) SelectBySeqName

func (dao *SeqUpdatesNgenDAO) SelectBySeqName(seq_name string) *dataobject.SeqUpdatesNgenDO

select seq_name, seq from seq_updates_ngen where seq_name = :seq_name TODO(@benqi): sqlmap

func (*SeqUpdatesNgenDAO) UpdateSeqBySeqName

func (dao *SeqUpdatesNgenDAO) UpdateSeqBySeqName(seq int64, seq_name string) int64

update seq_updates_ngen set seq = :seq where seq_name = :seq_name TODO(@benqi): sqlmap

type TmpPasswordsDAO

type TmpPasswordsDAO struct {
	// contains filtered or unexported fields
}

func NewTmpPasswordsDAO

func NewTmpPasswordsDAO(db *sqlx.DB) *TmpPasswordsDAO

func (*TmpPasswordsDAO) Insert

insert into devices(auth_id, user_id, password_hash, period, tmp_password, valid_until) values (:auth_id, :user_id, :password_hash, :period, :tmp_password, :valid_until) TODO(@benqi): sqlmap

type UserContactsDAO

type UserContactsDAO struct {
	// contains filtered or unexported fields
}

func NewUserContactsDAO

func NewUserContactsDAO(db *sqlx.DB) *UserContactsDAO

func (*UserContactsDAO) DeleteContacts

func (dao *UserContactsDAO) DeleteContacts(owner_user_id int32, id_list []int32) int64

update user_contacts set is_deleted = 1 where owner_user_id = :owner_user_id and contact_user_id in (:id_list) TODO(@benqi): sqlmap

func (*UserContactsDAO) Insert

insert into user_contacts(owner_user_id, contact_user_id, date2, created_at) values (:owner_user_id, :contact_user_id, :date2, :created_at) TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectBlockedList

func (dao *UserContactsDAO) SelectBlockedList(owner_user_id int32, date2 int32, limit int32) []dataobject.UserContactsDO

select contact_user_id from user_contacts where owner_user_id = :owner_user_id and date2 > :date2 order by date2 asc limit :limit TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectUserContacts

func (dao *UserContactsDAO) SelectUserContacts(owner_user_id int32) []dataobject.UserContactsDO

select contact_user_id, date2 from user_contacts where owner_user_id = :owner_user_id and is_deleted = 0 TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateBlock

func (dao *UserContactsDAO) UpdateBlock(is_blocked int8, owner_user_id int32, contact_user_id int32) int64

update user_contacts set is_blocked = :is_blocked where owner_user_id = :owner_user_id and contact_user_id = :contact_user_id TODO(@benqi): sqlmap

type UserDialogsDAO

type UserDialogsDAO struct {
	// contains filtered or unexported fields
}

func NewUserDialogsDAO

func NewUserDialogsDAO(db *sqlx.DB) *UserDialogsDAO

func (*UserDialogsDAO) CheckExists

func (dao *UserDialogsDAO) CheckExists(user_id int32, peer_type int8, peer_id int32) *dataobject.UserDialogsDO

select id from user_dialogs where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) Insert

func (dao *UserDialogsDAO) Insert(do *dataobject.UserDialogsDO) int64

insert into user_dialogs(user_id, peer_type, peer_id, top_message, unread_count, date2, created_at) values (:user_id, :peer_type, :peer_id, :top_message, :unread_count, :date2, :created_at) TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectByPeer

func (dao *UserDialogsDAO) SelectByPeer(user_id int32, peer_type int8, peer_id int32) *dataobject.UserDialogsDO

select id, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, date2 from user_dialogs where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByPeerType

func (dao *UserDialogsDAO) SelectDialogsByPeerType(user_id int32, peer_type int8) []dataobject.UserDialogsDO

select peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, date2 from user_dialogs where user_id = :user_id and peer_type = :peer_type TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByPinnedAndOffsetDate

func (dao *UserDialogsDAO) SelectDialogsByPinnedAndOffsetDate(user_id int32, is_pinned int8, date2 int32, limit int32) []dataobject.UserDialogsDO

select peer_type, peer_id, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, date2 from user_dialogs where user_id = :user_id and is_pinned = :is_pinned and date2 > :date2 order by date2 desc limit :limit TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectDialogsByUserID

func (dao *UserDialogsDAO) SelectDialogsByUserID(user_id int32) []dataobject.UserDialogsDO

select peer_type, peer_id, is_pinned, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, date2 from user_dialogs where user_id = :user_id TODO(@benqi): sqlmap

func (*UserDialogsDAO) SelectPinnedDialogs

func (dao *UserDialogsDAO) SelectPinnedDialogs(user_id int32) []dataobject.UserDialogsDO

select peer_type, peer_id, top_message, read_inbox_max_id, read_outbox_max_id, unread_count, unread_mentions_count, date2 from user_dialogs where user_id = :user_id and is_pinned = 1 TODO(@benqi): sqlmap

func (*UserDialogsDAO) UpdateTopMessage

func (dao *UserDialogsDAO) UpdateTopMessage(top_message int32, unread_count int32, unread_mentions_count int32, date2 int32, id int32) int64

update user_dialogs set top_message = :top_message, unread_count = :unread_count, unread_mentions_count = :unread_mentions_count, date2 = :date2 where id = :id TODO(@benqi): sqlmap

type UserNotifySettingsDAO

type UserNotifySettingsDAO struct {
	// contains filtered or unexported fields
}

func NewUserNotifySettingsDAO

func NewUserNotifySettingsDAO(db *sqlx.DB) *UserNotifySettingsDAO

func (*UserNotifySettingsDAO) DeleteNotAll

func (dao *UserNotifySettingsDAO) DeleteNotAll(user_id int32) int64

update user_notify_settings set is_deleted = 1 where user_id = :user_id and peer_type != 7 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) Insert

insert into user_notify_settings(user_id, peer_type, peer_id, show_previews, silent, mute_until, sound, created_at) values (:user_id, :peer_type, :peer_id, :show_previews, :silent, :mute_until, :sound, :created_at) TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByAll

func (dao *UserNotifySettingsDAO) SelectByAll(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 7 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByChannels

func (dao *UserNotifySettingsDAO) SelectByChannels(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 6 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByPeer

func (dao *UserNotifySettingsDAO) SelectByPeer(user_id int32, peer_type int8, peer_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByUserId

func (dao *UserNotifySettingsDAO) SelectByUserId(user_id int32) []dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) SelectByUsers

func (dao *UserNotifySettingsDAO) SelectByUsers(user_id int32) *dataobject.UserNotifySettingsDO

select id, show_previews, silent, mute_until, sound from user_notify_settings where user_id = :user_id and peer_type = 5 TODO(@benqi): sqlmap

func (*UserNotifySettingsDAO) UpdateByPeer

func (dao *UserNotifySettingsDAO) UpdateByPeer(show_previews int8, silent int8, mute_until int32, sound string, is_deleted int8, user_id int32, peer_type int8, peer_id int32) int64

update user_notify_settings set show_previews = :show_previews, silent = :silent, mute_until = :mute_until, sound = :sound, is_deleted = :is_deleted where user_id = :user_id and peer_type = :peer_type and peer_id = :peer_id TODO(@benqi): sqlmap

type UserPrivacysDAO

type UserPrivacysDAO struct {
	// contains filtered or unexported fields
}

func NewUserPrivacysDAO

func NewUserPrivacysDAO(db *sqlx.DB) *UserPrivacysDAO

func (*UserPrivacysDAO) Insert

insert into user_privacys(user_id, password, recovery_mail, status_timestamp, chat_invite, phone_call, ttl, ttl_created_at, created_at) values (:user_id, :password, :recovery_mail, :status_timestamp, :chat_invite, :phone_call, :ttl, :ttl_created_at, :created_at) TODO(@benqi): sqlmap

func (*UserPrivacysDAO) SelectTTL

func (dao *UserPrivacysDAO) SelectTTL(user_id int32) *dataobject.UserPrivacysDO

select ttl, ttl_created_at from user_privacys where user_id = :user_id TODO(@benqi): sqlmap

func (*UserPrivacysDAO) UpdateTTL

func (dao *UserPrivacysDAO) UpdateTTL(ttl int32, ttl_created_at int32, user_id int32) int64

update user_privacys set ttl = :ttl, ttl_created_at = :ttl_created_at where user_id = :user_id TODO(@benqi): sqlmap

type UsersDAO

type UsersDAO struct {
	// contains filtered or unexported fields
}

func NewUsersDAO

func NewUsersDAO(db *sqlx.DB) *UsersDAO

func (*UsersDAO) Delete

func (dao *UsersDAO) Delete(deleted_reason string, deleted_at string, id int32) int64

update users set deleted = 1, deleted_reason = :deleted_reason, deleted_at = :deleted_at where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) Insert

func (dao *UsersDAO) Insert(do *dataobject.UsersDO) int64

insert into users(first_name, last_name, access_hash, username, phone, country_code, bio, about, is_bot) values (:first_name, :last_name, :access_hash, :username, :phone, :country_code, :bio, :about, :is_bot) TODO(@benqi): sqlmap

func (*UsersDAO) SelectById

func (dao *UsersDAO) SelectById(id int32) *dataobject.UsersDO

select id, access_hash, first_name, last_name, username, phone from users where id = :id limit 1 TODO(@benqi): sqlmap

func (*UsersDAO) SelectByPhoneNumber

func (dao *UsersDAO) SelectByPhoneNumber(phone string) *dataobject.UsersDO

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) []dataobject.UsersDO

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

func (*UsersDAO) SelectUsersByIdList

func (dao *UsersDAO) SelectUsersByIdList(id_list []int32) []dataobject.UsersDO

select id, access_hash, first_name, last_name, username, phone from users where id in (:id_list) TODO(@benqi): sqlmap

func (*UsersDAO) UpdateProfile

func (dao *UsersDAO) UpdateProfile(first_name string, last_name string, about string, id int32) int64

update users set first_name = :first_name, last_name = :last_name, about = :about where id = :id TODO(@benqi): sqlmap

func (*UsersDAO) UpdateUsername

func (dao *UsersDAO) UpdateUsername(username string, id int32) int64

update users set username = :username where id = :id TODO(@benqi): sqlmap

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL