mysql_dao

package
v0.0.0-...-e41513e Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 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 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 PopularContactsDAO

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

func NewPopularContactsDAO

func NewPopularContactsDAO(db *sqlx.DB) *PopularContactsDAO

func (*PopularContactsDAO) IncreaseImporters

func (dao *PopularContactsDAO) IncreaseImporters(phone string) int64

update popular_contacts set importers = importers + 1 where phone = :phone TODO(@benqi): sqlmap

func (*PopularContactsDAO) IncreaseImportersList

func (dao *PopularContactsDAO) IncreaseImportersList(phoneList []string) int64

update popular_contacts set importers = importers + 1 where phone in (:phoneList) TODO(@benqi): sqlmap

func (*PopularContactsDAO) Insert

insert into popular_contacts(phone, importers) values (:phone, :importers) TODO(@benqi): sqlmap

func (*PopularContactsDAO) SelectImporters

func (dao *PopularContactsDAO) SelectImporters(phone string) *dataobject.PopularContactsDO

select phone, importers from popular_contacts where phone = :phone TODO(@benqi): sqlmap

func (*PopularContactsDAO) SelectImportersList

func (dao *PopularContactsDAO) SelectImportersList(phoneList []string) []dataobject.PopularContactsDO

select phone, importers from popular_contacts where phone in (:phoneList) TODO(@benqi): sqlmap

type UnregisteredContactsDAO

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

func NewUnregisteredContactsDAO

func NewUnregisteredContactsDAO(db *sqlx.DB) *UnregisteredContactsDAO

func (*UnregisteredContactsDAO) DeleteContacts

func (dao *UnregisteredContactsDAO) DeleteContacts(id_list []int64) int64

update unregistered_contacts set is_deleted = 1 where id in (:id_list) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) Insert

insert into unregistered_contacts(importer_user_id, contact_phone, contact_first_name, contact_last_name) values (:importer_user_id, :contact_phone, :contact_first_name, :contact_last_name) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) SelectContacts

func (dao *UnregisteredContactsDAO) SelectContacts(importer_user_id int32, phone_list []string) []dataobject.UnregisteredContactsDO

select id, importer_user_id, contact_phone, contact_first_name, contact_last_name from unregistered_contacts where importer_user_id = :importer_user_id and is_deleted = 0 and contact_phone in (:phone_list) TODO(@benqi): sqlmap

func (*UnregisteredContactsDAO) UpdateContactName

func (dao *UnregisteredContactsDAO) UpdateContactName(contact_first_name string, contact_last_name string, id int32) int64

update unregistered_contacts set contact_first_name = :contact_first_name, contact_last_name = :contact_last_name where id = :id 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, mutual = 0 where contact_user_id != 0 and (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, contact_phone, contact_first_name, contact_last_name, mutual, date2) values (:owner_user_id, :contact_user_id, :contact_phone, :contact_first_name, :contact_last_name, :mutual, :date2) TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectAllUserContacts

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

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectBlockedList

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

select contact_user_id from user_contacts where owner_user_id = :owner_user_id and is_blocked = 1 and is_deleted = 0 order by id asc limit :limit TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectUserContact

func (dao *UserContactsDAO) SelectUserContact(owner_user_id int32, contact_user_id int32) *dataobject.UserContactsDO

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id and contact_user_id = :contact_user_id TODO(@benqi): sqlmap

func (*UserContactsDAO) SelectUserContacts

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

select id, owner_user_id, contact_user_id, contact_phone, contact_first_name, contact_last_name, mutual, is_deleted from user_contacts where owner_user_id = :owner_user_id and is_deleted = 0 order by contact_user_id asc 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 contact_user_id != 0 and (owner_user_id = :owner_user_id and contact_user_id = :contact_user_id) TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateContactNameByID

func (dao *UserContactsDAO) UpdateContactNameByID(contact_first_name string, contact_last_name string, id int64) int64

update user_contacts set contact_first_name = :contact_first_name, contact_last_name = :contact_last_name, is_deleted = 0 where id = :id TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateContactUserId

func (dao *UserContactsDAO) UpdateContactUserId(contact_user_id int32, mutual int8, owner_user_id int32, contact_phone string) int64

update user_contacts set contact_user_id = :contact_user_id, mutual = :mutual where contact_user_id = 0 and owner_user_id = :owner_user_id and contact_phone = :contact_phone TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateMutual

func (dao *UserContactsDAO) UpdateMutual(mutual int8, owner_user_id int32, contact_user_id int32) int64

update user_contacts set mutual = :mutual where contact_user_id != 0 and (owner_user_id = :owner_user_id and contact_user_id = :contact_user_id) TODO(@benqi): sqlmap

func (*UserContactsDAO) UpdateMutualByID

func (dao *UserContactsDAO) UpdateMutualByID(mutual int8, id int64) int64

update user_contacts set mutual = :mutual where id = :id TODO(@benqi): sqlmap

Jump to

Keyboard shortcuts

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