Documentation ¶
Index ¶
- type Dao
- func (d *Dao) AddCacheUserBase(c context.Context, userBases map[int64]*api.UserBase) (err error)
- func (d *Dao) AddUserBase(c context.Context, userBase *api.UserBase) (num int64, err error)
- func (d *Dao) BeginTran(c context.Context) (*xsql.Tx, error)
- func (d *Dao) CacheUserBase(c context.Context, mids []int64) (res map[int64]*api.UserBase, err error)
- func (d *Dao) CheckUname(c context.Context, mid int64, uname string) (err error)
- func (d *Dao) CheckUserLike(c context.Context, mid int64, svids []int64) (res []int64, err error)
- func (d *Dao) Close()
- func (d *Dao) CreateNotice(ctx context.Context, notice *notice.NoticeBase) (err error)
- func (d *Dao) DelCacheUserBase(c context.Context, mid int64)
- func (d *Dao) FetchBlackList(c context.Context, mid int64) (upMid []int64, err error)
- func (d *Dao) FetchFollowList(c context.Context, mid int64) (upMid []int64, err error)
- func (d *Dao) FetchPartBlackList(c context.Context, mid int64, cursor model.CursorValue, size int) (MID2IDMap map[int64]time.Time, blackMIDs []int64, err error)
- func (d *Dao) FetchPartFanList(c context.Context, mid int64, cursor model.CursorValue, size int) (MID2IDMap map[int64]time.Time, followedMIDs []int64, err error)
- func (d *Dao) FetchPartFollowList(c context.Context, mid int64, cursor model.CursorValue, size int) (MID2IDMap map[int64]time.Time, followedMIDs []int64, err error)
- func (d *Dao) Filter(ctx context.Context, content string, area string) (level int32, err error)
- func (d *Dao) ForbidUser(c context.Context, mid uint64, exTime uint64) (err error)
- func (d *Dao) GetLocation(c context.Context, locId int32) (*api.LocationItem, error)
- func (d *Dao) GetUserBProfile(c context.Context, in *api.PhoneCheckReq) (res *accountv1.ProfileReply, err error)
- func (d *Dao) GetUserLikeList(c context.Context, mid int64, cursorNext bool, cursor model.CursorValue, ...) (likeSvs []*api.LikeSv, err error)
- func (d *Dao) IsBlack(c context.Context, mid int64, candidateMIDs []int64) (MIDMap map[int64]bool)
- func (d *Dao) IsFan(c context.Context, mid int64, candidateMIDs []int64) (MIDMap map[int64]bool)
- func (d *Dao) IsFollow(c context.Context, mid int64, candidateMIDs []int64) (MIDMap map[int64]bool)
- func (d *Dao) MockAddCacheUserBase(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockAddUserBase(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockBeginTran(p1 *xsql.Tx, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockCacheUserBase(res map[int64]*api.UserBase, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockCheckUname(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockCheckUserLike(res []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockCreateNotice(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFetchBlackList(upMid []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFetchFollowList(upMid []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFetchPartBlackList(MID2IDMap map[int64]time.Time, blackMIDs []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFetchPartFanList(MID2IDMap map[int64]time.Time, followedMIDs []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFetchPartFollowList(MID2IDMap map[int64]time.Time, followedMIDs []int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockFilter(level int32, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockForbidUser(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockGetLocation(p1 *api.LocationItem, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockGetUserBProfile(res *acc.ProfileReply, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockGetUserLikeList(likeSvs []*api.LikeSv, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockIsBlack(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
- func (d *Dao) MockIsFan(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
- func (d *Dao) MockIsFollow(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
- func (d *Dao) MockPing(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockRawBatchUserStatistics(res map[int64]*api.UserStat, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockRawUserAccCards(res *acc.CardsReply, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockRawUserBase(res map[int64]*api.UserBase, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockRawUserCard(userCard *model.UserCard, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockRawUserCards(userCards map[int64]*model.UserCard, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockReleaseUser(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxAddUserBlack(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxAddUserFan(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxAddUserFollow(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxAddUserLike(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxCancelUserBlack(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxCancelUserFan(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxCancelUserFollow(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxCancelUserLike(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxDecrUserStatisticsFan(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxDecrUserStatisticsFollow(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxDescUserStatisticsField(rowsAffected int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxIncrUserStatisticsFan(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxIncrUserStatisticsField(rowsAffected int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockTxIncrUserStatisticsFollow(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockUpdateUserBase(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockUpdateUserBaseUname(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockUpdateUserField(num int64, err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockUpdateUserVideoView(err error) (guard *monkey.PatchGuard)
- func (d *Dao) MockUserBase(res map[int64]*api.UserBase, err error) (guard *monkey.PatchGuard)
- func (d *Dao) Ping(ctx context.Context) error
- func (d *Dao) RawBatchUserStatistics(c context.Context, mids []int64) (res map[int64]*api.UserStat, err error)
- func (d *Dao) RawUserAccCards(c context.Context, mids []int64) (res *acc.CardsReply, err error)
- func (d *Dao) RawUserBase(c context.Context, mids []int64) (res map[int64]*api.UserBase, err error)
- func (d *Dao) RawUserCard(c context.Context, mid int64) (userCard *model.UserCard, err error)
- func (d *Dao) RawUserCards(c context.Context, mids []int64) (userCards map[int64]*model.UserCard, err error)
- func (d *Dao) ReleaseUser(c context.Context, mid uint64) (err error)
- func (d *Dao) TxAddUserBlack(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
- func (d *Dao) TxAddUserFan(tx *sql.Tx, mid, fanMid int64) (num int64, err error)
- func (d *Dao) TxAddUserFollow(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
- func (d *Dao) TxAddUserLike(tx *sql.Tx, mid, svid int64) (num int64, err error)
- func (d *Dao) TxCancelUserBlack(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
- func (d *Dao) TxCancelUserFan(tx *sql.Tx, mid, fanMid int64) (num int64, err error)
- func (d *Dao) TxCancelUserFollow(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
- func (d *Dao) TxCancelUserLike(tx *sql.Tx, mid, svid int64) (num int64, err error)
- func (d *Dao) TxDecrUserStatisticsFan(tx *sql.Tx, mid int64) (num int64, err error)
- func (d *Dao) TxDecrUserStatisticsFollow(tx *sql.Tx, mid int64) (num int64, err error)
- func (d *Dao) TxDescUserStatisticsField(c context.Context, tx *sql.Tx, mid int64, field string) (rowsAffected int64, err error)
- func (d *Dao) TxIncrUserStatisticsFan(tx *sql.Tx, mid int64) (num int64, err error)
- func (d *Dao) TxIncrUserStatisticsField(c context.Context, tx *sql.Tx, mid int64, field string) (rowsAffected int64, err error)
- func (d *Dao) TxIncrUserStatisticsFollow(tx *sql.Tx, mid int64) (num int64, err error)
- func (d *Dao) UpdateUserBase(c context.Context, mid int64, userBase *api.UserBase) (num int64, err error)
- func (d *Dao) UpdateUserBaseUname(c context.Context, mid int64, uname string) (num int64, err error)
- func (d *Dao) UpdateUserField(c context.Context, tx *sql.Tx, mid int64, field string, f interface{}) (num int64, err error)
- func (d *Dao) UpdateUserVideoView(c context.Context, mid int64, views int64) error
- func (d *Dao) UserBase(c context.Context, keys []int64) (res map[int64]*api.UserBase, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao dao
func (*Dao) AddCacheUserBase ¶
AddCacheUserBase 添加用户缓存
func (*Dao) AddUserBase ¶
AddUserBase .
func (*Dao) CacheUserBase ¶
func (d *Dao) CacheUserBase(c context.Context, mids []int64) (res map[int64]*api.UserBase, err error)
CacheUserBase multi get user base from cache.
func (*Dao) CheckUname ¶
CheckUname 检测昵称
func (*Dao) CheckUserLike ¶
CheckUserLike 检测用户是否点赞
func (*Dao) CreateNotice ¶
CreateNotice 创建通知
func (*Dao) DelCacheUserBase ¶
DelCacheUserBase 删除用户缓存
func (*Dao) FetchBlackList ¶
FetchBlackList 获取mid的所有拉黑up主
func (*Dao) FetchFollowList ¶
FetchFollowList 获取mid的所有关注up主
func (*Dao) FetchPartBlackList ¶
func (d *Dao) FetchPartBlackList(c context.Context, mid int64, cursor model.CursorValue, size int) ( MID2IDMap map[int64]time.Time, blackMIDs []int64, err error)
FetchPartBlackList 获取mid的拉黑up主
func (*Dao) FetchPartFanList ¶
func (d *Dao) FetchPartFanList(c context.Context, mid int64, cursor model.CursorValue, size int) ( MID2IDMap map[int64]time.Time, followedMIDs []int64, err error)
FetchPartFanList 获取mid的粉丝列表
func (*Dao) FetchPartFollowList ¶
func (d *Dao) FetchPartFollowList(c context.Context, mid int64, cursor model.CursorValue, size int) ( MID2IDMap map[int64]time.Time, followedMIDs []int64, err error)
FetchPartFollowList 获取mid的关注up主
cursor_id代表相应的up_mid,cursor_time表示mtime
func (*Dao) ForbidUser ¶
ForbidUser .
func (*Dao) GetLocation ¶
GetLocation return the location info
func (*Dao) GetUserBProfile ¶
func (d *Dao) GetUserBProfile(c context.Context, in *api.PhoneCheckReq) (res *accountv1.ProfileReply, err error)
GetUserBProfile 获取用户全量b站信息
func (*Dao) GetUserLikeList ¶
func (d *Dao) GetUserLikeList(c context.Context, mid int64, cursorNext bool, cursor model.CursorValue, size int) ( likeSvs []*api.LikeSv, err error)
GetUserLikeList 返回用户点赞列表
当前cursorID表示opid
func (*Dao) MockAddCacheUserBase ¶
func (d *Dao) MockAddCacheUserBase(err error) (guard *monkey.PatchGuard)
MockAddCacheUserBase .
func (*Dao) MockAddUserBase ¶
func (d *Dao) MockAddUserBase(num int64, err error) (guard *monkey.PatchGuard)
MockAddUserBase .
func (*Dao) MockBeginTran ¶
MockBeginTran .
func (*Dao) MockCacheUserBase ¶
MockCacheUserBase .
func (*Dao) MockCheckUname ¶
func (d *Dao) MockCheckUname(err error) (guard *monkey.PatchGuard)
MockCheckUname .
func (*Dao) MockCheckUserLike ¶
func (d *Dao) MockCheckUserLike(res []int64, err error) (guard *monkey.PatchGuard)
MockCheckUserLike .
func (*Dao) MockCreateNotice ¶
func (d *Dao) MockCreateNotice(err error) (guard *monkey.PatchGuard)
MockCreateNotice .
func (*Dao) MockFetchBlackList ¶
func (d *Dao) MockFetchBlackList(upMid []int64, err error) (guard *monkey.PatchGuard)
MockFetchBlackList .
func (*Dao) MockFetchFollowList ¶
func (d *Dao) MockFetchFollowList(upMid []int64, err error) (guard *monkey.PatchGuard)
MockFetchFollowList .
func (*Dao) MockFetchPartBlackList ¶
func (d *Dao) MockFetchPartBlackList(MID2IDMap map[int64]time.Time, blackMIDs []int64, err error) (guard *monkey.PatchGuard)
MockFetchPartBlackList .
func (*Dao) MockFetchPartFanList ¶
func (d *Dao) MockFetchPartFanList(MID2IDMap map[int64]time.Time, followedMIDs []int64, err error) (guard *monkey.PatchGuard)
MockFetchPartFanList .
func (*Dao) MockFetchPartFollowList ¶
func (d *Dao) MockFetchPartFollowList(MID2IDMap map[int64]time.Time, followedMIDs []int64, err error) (guard *monkey.PatchGuard)
MockFetchPartFollowList .
func (*Dao) MockFilter ¶
func (d *Dao) MockFilter(level int32, err error) (guard *monkey.PatchGuard)
MockFilter .
func (*Dao) MockForbidUser ¶
func (d *Dao) MockForbidUser(err error) (guard *monkey.PatchGuard)
MockForbidUser .
func (*Dao) MockGetLocation ¶
func (d *Dao) MockGetLocation(p1 *api.LocationItem, err error) (guard *monkey.PatchGuard)
MockGetLocation .
func (*Dao) MockGetUserBProfile ¶
func (d *Dao) MockGetUserBProfile(res *acc.ProfileReply, err error) (guard *monkey.PatchGuard)
MockGetUserBProfile .
func (*Dao) MockGetUserLikeList ¶
MockGetUserLikeList .
func (*Dao) MockIsBlack ¶
func (d *Dao) MockIsBlack(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
MockIsBlack .
func (*Dao) MockIsFan ¶
func (d *Dao) MockIsFan(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
MockIsFan .
func (*Dao) MockIsFollow ¶
func (d *Dao) MockIsFollow(MIDMap map[int64]bool) (guard *monkey.PatchGuard)
MockIsFollow .
func (*Dao) MockRawBatchUserStatistics ¶
func (d *Dao) MockRawBatchUserStatistics(res map[int64]*api.UserStat, err error) (guard *monkey.PatchGuard)
MockRawBatchUserStatistics .
func (*Dao) MockRawUserAccCards ¶
func (d *Dao) MockRawUserAccCards(res *acc.CardsReply, err error) (guard *monkey.PatchGuard)
MockRawUserAccCards .
func (*Dao) MockRawUserBase ¶
MockRawUserBase .
func (*Dao) MockRawUserCard ¶
MockRawUserCard .
func (*Dao) MockRawUserCards ¶
func (d *Dao) MockRawUserCards(userCards map[int64]*model.UserCard, err error) (guard *monkey.PatchGuard)
MockRawUserCards .
func (*Dao) MockReleaseUser ¶
func (d *Dao) MockReleaseUser(err error) (guard *monkey.PatchGuard)
MockReleaseUser .
func (*Dao) MockTxAddUserBlack ¶
func (d *Dao) MockTxAddUserBlack(num int64, err error) (guard *monkey.PatchGuard)
MockTxAddUserBlack .
func (*Dao) MockTxAddUserFan ¶
func (d *Dao) MockTxAddUserFan(num int64, err error) (guard *monkey.PatchGuard)
MockTxAddUserFan .
func (*Dao) MockTxAddUserFollow ¶
func (d *Dao) MockTxAddUserFollow(num int64, err error) (guard *monkey.PatchGuard)
MockTxAddUserFollow .
func (*Dao) MockTxAddUserLike ¶
func (d *Dao) MockTxAddUserLike(num int64, err error) (guard *monkey.PatchGuard)
MockTxAddUserLike .
func (*Dao) MockTxCancelUserBlack ¶
func (d *Dao) MockTxCancelUserBlack(num int64, err error) (guard *monkey.PatchGuard)
MockTxCancelUserBlack .
func (*Dao) MockTxCancelUserFan ¶
func (d *Dao) MockTxCancelUserFan(num int64, err error) (guard *monkey.PatchGuard)
MockTxCancelUserFan .
func (*Dao) MockTxCancelUserFollow ¶
func (d *Dao) MockTxCancelUserFollow(num int64, err error) (guard *monkey.PatchGuard)
MockTxCancelUserFollow .
func (*Dao) MockTxCancelUserLike ¶
func (d *Dao) MockTxCancelUserLike(num int64, err error) (guard *monkey.PatchGuard)
MockTxCancelUserLike .
func (*Dao) MockTxDecrUserStatisticsFan ¶
func (d *Dao) MockTxDecrUserStatisticsFan(num int64, err error) (guard *monkey.PatchGuard)
MockTxDecrUserStatisticsFan .
func (*Dao) MockTxDecrUserStatisticsFollow ¶
func (d *Dao) MockTxDecrUserStatisticsFollow(num int64, err error) (guard *monkey.PatchGuard)
MockTxDecrUserStatisticsFollow .
func (*Dao) MockTxDescUserStatisticsField ¶
func (d *Dao) MockTxDescUserStatisticsField(rowsAffected int64, err error) (guard *monkey.PatchGuard)
MockTxDescUserStatisticsField .
func (*Dao) MockTxIncrUserStatisticsFan ¶
func (d *Dao) MockTxIncrUserStatisticsFan(num int64, err error) (guard *monkey.PatchGuard)
MockTxIncrUserStatisticsFan .
func (*Dao) MockTxIncrUserStatisticsField ¶
func (d *Dao) MockTxIncrUserStatisticsField(rowsAffected int64, err error) (guard *monkey.PatchGuard)
MockTxIncrUserStatisticsField .
func (*Dao) MockTxIncrUserStatisticsFollow ¶
func (d *Dao) MockTxIncrUserStatisticsFollow(num int64, err error) (guard *monkey.PatchGuard)
MockTxIncrUserStatisticsFollow .
func (*Dao) MockUpdateUserBase ¶
func (d *Dao) MockUpdateUserBase(num int64, err error) (guard *monkey.PatchGuard)
MockUpdateUserBase .
func (*Dao) MockUpdateUserBaseUname ¶
func (d *Dao) MockUpdateUserBaseUname(num int64, err error) (guard *monkey.PatchGuard)
MockUpdateUserBaseUname .
func (*Dao) MockUpdateUserField ¶
func (d *Dao) MockUpdateUserField(num int64, err error) (guard *monkey.PatchGuard)
MockUpdateUserField .
func (*Dao) MockUpdateUserVideoView ¶
func (d *Dao) MockUpdateUserVideoView(err error) (guard *monkey.PatchGuard)
MockUpdateUserVideoView .
func (*Dao) MockUserBase ¶
MockUserBase .
func (*Dao) RawBatchUserStatistics ¶
func (d *Dao) RawBatchUserStatistics(c context.Context, mids []int64) (res map[int64]*api.UserStat, err error)
RawBatchUserStatistics 从数据库获取用户基础信息
func (*Dao) RawUserAccCards ¶
RawUserAccCards 批量获取账号信息
func (*Dao) RawUserBase ¶
RawUserBase 从数据库获取用户基础信息
func (*Dao) RawUserCard ¶
RawUserCard 从主站获取用户基础信息
func (*Dao) RawUserCards ¶
func (d *Dao) RawUserCards(c context.Context, mids []int64) (userCards map[int64]*model.UserCard, err error)
RawUserCards 从主站获取用户基础信息
func (*Dao) ReleaseUser ¶
ReleaseUser ..
func (*Dao) TxAddUserBlack ¶
func (d *Dao) TxAddUserBlack(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
TxAddUserBlack .
func (*Dao) TxAddUserFan ¶
TxAddUserFan .
func (*Dao) TxAddUserFollow ¶
func (d *Dao) TxAddUserFollow(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
TxAddUserFollow .
func (*Dao) TxAddUserLike ¶
TxAddUserLike .
func (*Dao) TxCancelUserBlack ¶
func (d *Dao) TxCancelUserBlack(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
TxCancelUserBlack .
func (*Dao) TxCancelUserFan ¶
TxCancelUserFan .
func (*Dao) TxCancelUserFollow ¶
func (d *Dao) TxCancelUserFollow(c context.Context, tx *sql.Tx, mid, upMid int64) (num int64, err error)
TxCancelUserFollow .
func (*Dao) TxCancelUserLike ¶
TxCancelUserLike .
func (*Dao) TxDecrUserStatisticsFan ¶
TxDecrUserStatisticsFan .
func (*Dao) TxDecrUserStatisticsFollow ¶
TxDecrUserStatisticsFollow .
func (*Dao) TxDescUserStatisticsField ¶
func (d *Dao) TxDescUserStatisticsField(c context.Context, tx *sql.Tx, mid int64, field string) (rowsAffected int64, err error)
TxDescUserStatisticsField .
func (*Dao) TxIncrUserStatisticsFan ¶
TxIncrUserStatisticsFan .
func (*Dao) TxIncrUserStatisticsField ¶
func (d *Dao) TxIncrUserStatisticsField(c context.Context, tx *sql.Tx, mid int64, field string) (rowsAffected int64, err error)
TxIncrUserStatisticsField .
func (*Dao) TxIncrUserStatisticsFollow ¶
TxIncrUserStatisticsFollow .
func (*Dao) UpdateUserBase ¶
func (d *Dao) UpdateUserBase(c context.Context, mid int64, userBase *api.UserBase) (num int64, err error)
UpdateUserBase 更新用户基础信息
func (*Dao) UpdateUserBaseUname ¶
func (d *Dao) UpdateUserBaseUname(c context.Context, mid int64, uname string) (num int64, err error)
UpdateUserBaseUname .
func (*Dao) UpdateUserField ¶
func (d *Dao) UpdateUserField(c context.Context, tx *sql.Tx, mid int64, field string, f interface{}) (num int64, err error)
UpdateUserField .
func (*Dao) UpdateUserVideoView ¶
UpdateUserVideoView .