mysql_dao

package
v0.96.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthKeyInfosDAO

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

func NewAuthKeyInfosDAO

func NewAuthKeyInfosDAO(db *sqlx.DB) *AuthKeyInfosDAO

func (*AuthKeyInfosDAO) Insert

func (dao *AuthKeyInfosDAO) Insert(ctx context.Context, do *dataobject.AuthKeyInfosDO) (lastInsertId, rowsAffected int64, err error)

Insert insert into auth_key_infos(auth_key_id, auth_key_type, perm_auth_key_id, temp_auth_key_id, media_temp_auth_key_id) values (:auth_key_id, :auth_key_type, :perm_auth_key_id, :temp_auth_key_id, :media_temp_auth_key_id) TODO(@benqi): sqlmap

func (*AuthKeyInfosDAO) InsertTx

func (dao *AuthKeyInfosDAO) InsertTx(tx *sqlx.Tx, do *dataobject.AuthKeyInfosDO) (lastInsertId, rowsAffected int64, err error)

InsertTx insert into auth_key_infos(auth_key_id, auth_key_type, perm_auth_key_id, temp_auth_key_id, media_temp_auth_key_id) values (:auth_key_id, :auth_key_type, :perm_auth_key_id, :temp_auth_key_id, :media_temp_auth_key_id) TODO(@benqi): sqlmap

func (*AuthKeyInfosDAO) SelectByAuthKeyId

func (dao *AuthKeyInfosDAO) SelectByAuthKeyId(ctx context.Context, auth_key_id int64) (rValue *dataobject.AuthKeyInfosDO, err error)

SelectByAuthKeyId select auth_key_id, auth_key_type, perm_auth_key_id, temp_auth_key_id, media_temp_auth_key_id from auth_key_infos where auth_key_id = :auth_key_id limit 1 TODO(@benqi): sqlmap

func (*AuthKeyInfosDAO) UpdateCustomMap added in v0.87.2

func (dao *AuthKeyInfosDAO) UpdateCustomMap(ctx context.Context, cMap map[string]interface{}, auth_key_id int64) (rowsAffected int64, err error)

UpdateCustomMap update auth_key_infos set %s where auth_key_id = :auth_key_id TODO(@benqi): sqlmap

func (*AuthKeyInfosDAO) UpdateCustomMapTx added in v0.87.2

func (dao *AuthKeyInfosDAO) UpdateCustomMapTx(tx *sqlx.Tx, cMap map[string]interface{}, auth_key_id int64) (rowsAffected int64, err error)

UpdateCustomMapTx update auth_key_infos set %s where auth_key_id = :auth_key_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(ctx context.Context, do *dataobject.AuthKeysDO) (lastInsertId, rowsAffected int64, err error)

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

func (*AuthKeysDAO) InsertTx

func (dao *AuthKeysDAO) InsertTx(tx *sqlx.Tx, do *dataobject.AuthKeysDO) (lastInsertId, rowsAffected int64, err error)

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

func (*AuthKeysDAO) SelectByAuthKeyId

func (dao *AuthKeysDAO) SelectByAuthKeyId(ctx context.Context, auth_key_id int64) (rValue *dataobject.AuthKeysDO, err error)

SelectByAuthKeyId select auth_key_id, body from auth_keys where auth_key_id = :auth_key_id TODO(@benqi): sqlmap

type AuthUsersDAO

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

func NewAuthUsersDAO

func NewAuthUsersDAO(db *sqlx.DB) *AuthUsersDAO

func (*AuthUsersDAO) Delete

func (dao *AuthUsersDAO) Delete(ctx context.Context, auth_key_id int64, user_id int64) (rowsAffected int64, err error)

Delete update auth_users set deleted = 1, date_actived = 0 where auth_key_id = :auth_key_id and user_id = :user_id TODO(@benqi): sqlmap

func (*AuthUsersDAO) DeleteByHashList

func (dao *AuthUsersDAO) DeleteByHashList(ctx context.Context, idList []int64) (rowsAffected int64, err error)

DeleteByHashList update auth_users set deleted = 1, date_created = 0, date_actived = 0 where id in (:idList) TODO(@benqi): sqlmap

func (*AuthUsersDAO) DeleteByHashListTx

func (dao *AuthUsersDAO) DeleteByHashListTx(tx *sqlx.Tx, idList []int64) (rowsAffected int64, err error)

update auth_users set deleted = 1, date_created = 0, date_actived = 0 where id in (:idList) DeleteByHashListTx TODO(@benqi): sqlmap

func (*AuthUsersDAO) DeleteTx

func (dao *AuthUsersDAO) DeleteTx(tx *sqlx.Tx, auth_key_id int64, user_id int64) (rowsAffected int64, err error)

update auth_users set deleted = 1, date_actived = 0 where auth_key_id = :auth_key_id and user_id = :user_id DeleteTx TODO(@benqi): sqlmap

func (*AuthUsersDAO) DeleteUser

func (dao *AuthUsersDAO) DeleteUser(ctx context.Context, user_id int64) (rowsAffected int64, err error)

DeleteUser update auth_users set deleted = 1, date_actived = 0 where user_id = :user_id TODO(@benqi): sqlmap

func (*AuthUsersDAO) DeleteUserTx

func (dao *AuthUsersDAO) DeleteUserTx(tx *sqlx.Tx, user_id int64) (rowsAffected int64, err error)

update auth_users set deleted = 1, date_actived = 0 where user_id = :user_id DeleteUserTx TODO(@benqi): sqlmap

func (*AuthUsersDAO) InsertOrUpdates

func (dao *AuthUsersDAO) InsertOrUpdates(ctx context.Context, do *dataobject.AuthUsersDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdates insert into auth_users(auth_key_id, user_id, hash, date_created, date_actived) values (:auth_key_id, :user_id, :hash, :date_created, :date_actived) on duplicate key update hash = values(hash), date_actived = values(date_actived), deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) InsertOrUpdatesTx

func (dao *AuthUsersDAO) InsertOrUpdatesTx(tx *sqlx.Tx, do *dataobject.AuthUsersDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdatesTx insert into auth_users(auth_key_id, user_id, hash, date_created, date_actived) values (:auth_key_id, :user_id, :hash, :date_created, :date_actived) on duplicate key update hash = values(hash), date_actived = values(date_actived), deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) Select

func (dao *AuthUsersDAO) Select(ctx context.Context, auth_key_id int64) (rValue *dataobject.AuthUsersDO, err error)

Select select id, auth_key_id, user_id, hash, date_created, date_actived from auth_users where auth_key_id = :auth_key_id and deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectAuthKeyIds

func (dao *AuthUsersDAO) SelectAuthKeyIds(ctx context.Context, user_id int64) (rList []dataobject.AuthUsersDO, err error)

SelectAuthKeyIds select id, auth_key_id, user_id, hash, date_created, date_actived from auth_users where user_id = :user_id and deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectAuthKeyIdsWithCB

func (dao *AuthUsersDAO) SelectAuthKeyIdsWithCB(ctx context.Context, user_id int64, cb func(i int, v *dataobject.AuthUsersDO)) (rList []dataobject.AuthUsersDO, err error)

SelectAuthKeyIdsWithCB select id, auth_key_id, user_id, hash, date_created, date_actived from auth_users where user_id = :user_id and deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectListByUserId

func (dao *AuthUsersDAO) SelectListByUserId(ctx context.Context, user_id int64) (rList []dataobject.AuthUsersDO, err error)

SelectListByUserId select id, auth_key_id, user_id, hash, date_created, date_actived from auth_users where user_id = :user_id and deleted = 0 TODO(@benqi): sqlmap

func (*AuthUsersDAO) SelectListByUserIdWithCB

func (dao *AuthUsersDAO) SelectListByUserIdWithCB(ctx context.Context, user_id int64, cb func(i int, v *dataobject.AuthUsersDO)) (rList []dataobject.AuthUsersDO, err error)

SelectListByUserIdWithCB select id, auth_key_id, user_id, hash, date_created, date_actived from auth_users where user_id = :user_id and deleted = 0 TODO(@benqi): sqlmap

type AuthsDAO

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

func NewAuthsDAO

func NewAuthsDAO(db *sqlx.DB) *AuthsDAO

func (*AuthsDAO) InsertOrUpdate

func (dao *AuthsDAO) InsertOrUpdate(ctx context.Context, do *dataobject.AuthsDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdate insert into auths(auth_key_id, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, proxy, params, client_ip, date_active) values (:auth_key_id, :api_id, :device_model, :system_version, :app_version, :system_lang_code, :lang_pack, :lang_code, :proxy, :params, :client_ip, :date_active) on duplicate key update api_id = values(api_id), device_model = values(device_model), system_version = values(system_version), app_version = values(app_version), system_lang_code = values(system_lang_code), lang_pack = values(lang_pack), lang_code = values(lang_code), proxy = values(proxy), params = values(params), client_ip = values(client_ip), date_active = values(date_active) TODO(@benqi): sqlmap

func (*AuthsDAO) InsertOrUpdateLayer added in v0.96.0

func (dao *AuthsDAO) InsertOrUpdateLayer(ctx context.Context, do *dataobject.AuthsDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdateLayer insert into auths(auth_key_id, layer, api_id, params, client_ip, date_active) values (:auth_key_id, :layer, 0, 'null', :client_ip, :date_active) on duplicate key update layer = values(layer), client_ip = values(client_ip), date_active = values(date_active) TODO(@benqi): sqlmap

func (*AuthsDAO) InsertOrUpdateLayerTx added in v0.96.0

func (dao *AuthsDAO) InsertOrUpdateLayerTx(tx *sqlx.Tx, do *dataobject.AuthsDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdateLayerTx insert into auths(auth_key_id, layer, api_id, params, client_ip, date_active) values (:auth_key_id, :layer, 0, 'null', :client_ip, :date_active) on duplicate key update layer = values(layer), client_ip = values(client_ip), date_active = values(date_active) TODO(@benqi): sqlmap

func (*AuthsDAO) InsertOrUpdateTx

func (dao *AuthsDAO) InsertOrUpdateTx(tx *sqlx.Tx, do *dataobject.AuthsDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdateTx insert into auths(auth_key_id, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, proxy, params, client_ip, date_active) values (:auth_key_id, :api_id, :device_model, :system_version, :app_version, :system_lang_code, :lang_pack, :lang_code, :proxy, :params, :client_ip, :date_active) on duplicate key update api_id = values(api_id), device_model = values(device_model), system_version = values(system_version), app_version = values(app_version), system_lang_code = values(system_lang_code), lang_pack = values(lang_pack), lang_code = values(lang_code), proxy = values(proxy), params = values(params), client_ip = values(client_ip), date_active = values(date_active) TODO(@benqi): sqlmap

func (*AuthsDAO) SelectByAuthKeyId

func (dao *AuthsDAO) SelectByAuthKeyId(ctx context.Context, auth_key_id int64) (rValue *dataobject.AuthsDO, err error)

SelectByAuthKeyId select auth_key_id, layer, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, client_ip, date_active from auths where auth_key_id = :auth_key_id and deleted = 0 limit 1 TODO(@benqi): sqlmap

func (*AuthsDAO) SelectLangCode

func (dao *AuthsDAO) SelectLangCode(ctx context.Context, auth_key_id int64) (rValue string, err error)

SelectLangCode select lang_code from auths where auth_key_id = :auth_key_id limit 1 TODO(@benqi): sqlmap

func (*AuthsDAO) SelectLangPack

func (dao *AuthsDAO) SelectLangPack(ctx context.Context, auth_key_id int64) (rValue string, err error)

SelectLangPack select lang_pack from auths where auth_key_id = :auth_key_id limit 1 TODO(@benqi): sqlmap

func (*AuthsDAO) SelectLayer

func (dao *AuthsDAO) SelectLayer(ctx context.Context, auth_key_id int64) (rValue int32, err error)

SelectLayer select layer from auths where auth_key_id = :auth_key_id limit 1 TODO(@benqi): sqlmap

func (*AuthsDAO) SelectSessions

func (dao *AuthsDAO) SelectSessions(ctx context.Context, idList []int64) (rList []dataobject.AuthsDO, err error)

SelectSessions select auth_key_id, layer, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, client_ip, date_active from auths where auth_key_id in (:idList) TODO(@benqi): sqlmap

func (*AuthsDAO) SelectSessionsWithCB

func (dao *AuthsDAO) SelectSessionsWithCB(ctx context.Context, idList []int64, cb func(i int, v *dataobject.AuthsDO)) (rList []dataobject.AuthsDO, err error)

SelectSessionsWithCB select auth_key_id, layer, api_id, device_model, system_version, app_version, system_lang_code, lang_pack, lang_code, client_ip, date_active from auths where auth_key_id in (:idList) TODO(@benqi): sqlmap

type DevicesDAO

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

func NewDevicesDAO

func NewDevicesDAO(db *sqlx.DB) *DevicesDAO

func (*DevicesDAO) InsertOrUpdate

func (dao *DevicesDAO) InsertOrUpdate(ctx context.Context, do *dataobject.DevicesDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdate insert into devices(auth_key_id, user_id, token_type, token, app_sandbox, secret, other_uids) values (:auth_key_id, :user_id, :token_type, :token, :app_sandbox, :secret, :other_uids) on duplicate key update token = values(token), secret = values(secret), other_uids = values(other_uids), state = 0 TODO(@benqi): sqlmap

func (*DevicesDAO) InsertOrUpdateTx

func (dao *DevicesDAO) InsertOrUpdateTx(tx *sqlx.Tx, do *dataobject.DevicesDO) (lastInsertId, rowsAffected int64, err error)

InsertOrUpdateTx insert into devices(auth_key_id, user_id, token_type, token, app_sandbox, secret, other_uids) values (:auth_key_id, :user_id, :token_type, :token, :app_sandbox, :secret, :other_uids) on duplicate key update token = values(token), secret = values(secret), other_uids = values(other_uids), state = 0 TODO(@benqi): sqlmap

func (*DevicesDAO) Select

func (dao *DevicesDAO) Select(ctx context.Context, auth_key_id int64, user_id int64, token_type int32) (rValue *dataobject.DevicesDO, err error)

Select select id, auth_key_id, user_id, token_type, token, app_sandbox, secret, other_uids from devices where auth_key_id = :auth_key_id and user_id = :user_id and token_type = :token_type and state = 0 TODO(@benqi): sqlmap

func (*DevicesDAO) SelectListById

func (dao *DevicesDAO) SelectListById(ctx context.Context, token_type int32, token string) (rList []dataobject.DevicesDO, err error)

SelectListById select id, auth_key_id, user_id, token_type, token from devices where token_type = :token_type and token = :token and state = 1 TODO(@benqi): sqlmap

func (*DevicesDAO) SelectListByIdWithCB

func (dao *DevicesDAO) SelectListByIdWithCB(ctx context.Context, token_type int32, token string, cb func(i int, v *dataobject.DevicesDO)) (rList []dataobject.DevicesDO, err error)

SelectListByIdWithCB select id, auth_key_id, user_id, token_type, token from devices where token_type = :token_type and token = :token and state = 1 TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateState

func (dao *DevicesDAO) UpdateState(ctx context.Context, state bool, auth_key_id int64, user_id int64) (rowsAffected int64, err error)

UpdateState update devices set state = :state where auth_key_id = :auth_key_id and user_id = :user_id and token_type TODO(@benqi): sqlmap

func (*DevicesDAO) UpdateStateById

func (dao *DevicesDAO) UpdateStateById(ctx context.Context, state bool, id int64) (rowsAffected int64, err error)

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

func (*DevicesDAO) UpdateStateByIdTx

func (dao *DevicesDAO) UpdateStateByIdTx(tx *sqlx.Tx, state bool, id int64) (rowsAffected int64, err error)

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

func (*DevicesDAO) UpdateStateByToken

func (dao *DevicesDAO) UpdateStateByToken(ctx context.Context, state bool, token_type int32, token string) (rowsAffected int64, err error)

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

func (*DevicesDAO) UpdateStateByTokenTx

func (dao *DevicesDAO) UpdateStateByTokenTx(tx *sqlx.Tx, state bool, token_type int32, token string) (rowsAffected int64, err error)

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

func (*DevicesDAO) UpdateStateTx

func (dao *DevicesDAO) UpdateStateTx(tx *sqlx.Tx, state bool, auth_key_id int64, user_id int64) (rowsAffected int64, err error)

update devices set state = :state where auth_key_id = :auth_key_id and user_id = :user_id and token_type UpdateStateTx TODO(@benqi): sqlmap

Jump to

Keyboard shortcuts

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