Documentation
¶
Index ¶
- Constants
- type Dao
- func (d *Dao) AddBlockCache(c context.Context, mid int64, score int8, blockNo int64) (err error)
- func (d *Dao) AddEvent(c context.Context, event *model.Event) (id int64, err error)
- func (d *Dao) AddPunishmentQueue(c context.Context, mid int64, blockNo int64) (err error)
- func (d *Dao) AddService(c context.Context, service *model.Service) (id int64, err error)
- func (d *Dao) AddTelLevelInfo(c context.Context, t *model.TelRiskLevel) (id int64, err error)
- func (d *Dao) AddUserInfoCache(c context.Context, ui *model.UserInfo) (err error)
- func (d *Dao) AllEvent(c context.Context) (list []*model.Event, err error)
- func (d *Dao) AuditInfo(c context.Context, mid int64, remoteIP string) (rs *model.AuditInfo, err error)
- func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error)
- func (d *Dao) BlockAccount(c context.Context, mid int64) (err error)
- func (d *Dao) BlockMidCache(c context.Context, batchNo int64, num int64) (res []int64, err error)
- func (d *Dao) Close()
- func (d *Dao) Configs(c context.Context) (res map[string]string, err error)
- func (d *Dao) DelInfoCache(c context.Context, mid int64) (err error)
- func (d *Dao) Event(c context.Context, eventName string) (event *model.Event, err error)
- func (d *Dao) EventHistoryByMidAndEvent(c context.Context, mid int64, eventID int64) (res *model.UserEventHistory, err error)
- func (d *Dao) Factor(c context.Context, serviceID, eventID int64, riskLevel int8) (factor *model.Factor, err error)
- func (d *Dao) FactorGroup(c context.Context, groupName string) (factorGroup *model.FactorGroup, err error)
- func (d *Dao) HistoryList(c context.Context, mid int64, size int) (res []*model.UserEventHistory, err error)
- func (d *Dao) Ping(c context.Context) (err error)
- func (d *Dao) PingRedis(c context.Context) (err error)
- func (d *Dao) ProfileInfo(c context.Context, mid int64, remoteIP string) (profile *model.ProfileInfo, err error)
- func (d *Dao) PubScoreChange(c context.Context, mid int64, msg interface{}) (err error)
- func (d *Dao) RegisterProtection(c context.Context, args url.Values, ip string) (level int8, err error)
- func (d *Dao) SecurityLogin(c context.Context, mid int64, reason string) (err error)
- func (d *Dao) Service(c context.Context, serviceName string) (service *model.Service, err error)
- func (d *Dao) SetNXLockCache(c context.Context, k int64) (res bool, err error)
- func (d *Dao) SetUserInfoCache(c context.Context, ui *model.UserInfo) (err error)
- func (d *Dao) StatListByID(c context.Context, id int64) (list []*model.Statistics, err error)
- func (d *Dao) StatListByIDAndMid(c context.Context, mid, id int64) (list []*model.Statistics, err error)
- func (d *Dao) StatListByMid(c context.Context, mid int64) (list []*model.Statistics, err error)
- func (d *Dao) TelInfo(c context.Context, mid int64) (tel *model.TelInfo, err error)
- func (d *Dao) TelLevel(c context.Context, mid int64) (res *model.TelRiskLevel, err error)
- func (d *Dao) TelRiskLevel(c context.Context, mid int64) (riskLevel int8, err error)
- func (d *Dao) TxAddEventHistory(c context.Context, tx *sql.Tx, ueh *model.UserEventHistory) (err error)
- func (d *Dao) TxAddInfo(c context.Context, tx *sql.Tx, info *model.UserInfo) (id int64, err error)
- func (d *Dao) TxAddPunishment(c context.Context, tx *sql.Tx, mid int64, t int8, reason string) (err error)
- func (d *Dao) TxAddPunishmentQueue(c context.Context, tx *sql.Tx, mid int64, blockNo int64) (err error)
- func (d *Dao) TxClearReliveTimes(c context.Context, tx *sql.Tx, ui *model.UserInfo) (err error)
- func (d *Dao) TxUpdateBaseScore(c context.Context, tx *sql.Tx, ui *model.UserInfo) (err error)
- func (d *Dao) TxUpdateEventScore(c context.Context, tx *sql.Tx, mid int64, escore, score int8) (err error)
- func (d *Dao) TxUpdateEventScoreReLive(c context.Context, tx *sql.Tx, mid int64, escore, score int8) (err error)
- func (d *Dao) TxUpdateInfo(c context.Context, tx *sql.Tx, info *model.UserInfo) (err error)
- func (d *Dao) UnicomGiftState(c context.Context, mid int64) (state int, err error)
- func (d *Dao) UserInfo(c context.Context, mid int64) (res *model.UserInfo, err error)
- func (d *Dao) UserInfoCache(c context.Context, mid int64) (ui *model.UserInfo, err error)
Constants ¶
const ( TelRiskLevelLow = 1 TelRiskLevelMedium = 2 TelRiskLevelHigh = 3 TelRiskLevelUnknown = 4 )
tel level.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dao ¶
type Dao struct {
// contains filtered or unexported fields
}
Dao event dao def.
func (*Dao) AddBlockCache ¶
AddBlockCache add block cache.
func (*Dao) AddPunishmentQueue ¶
AddPunishmentQueue insert punishment queue.
func (*Dao) AddService ¶
AddService insert service to db.
func (*Dao) AddTelLevelInfo ¶
AddTelLevelInfo add tel level info.
func (*Dao) AddUserInfoCache ¶
AddUserInfoCache add info to cache , return err if key is exist already.
func (*Dao) AuditInfo ¶
func (d *Dao) AuditInfo(c context.Context, mid int64, remoteIP string) (rs *model.AuditInfo, err error)
AuditInfo get user audit info
func (*Dao) BlockAccount ¶
BlockAccount block account.
func (*Dao) BlockMidCache ¶
BlockMidCache get wait block mids.
func (*Dao) DelInfoCache ¶
DelInfoCache delete info cache.
func (*Dao) EventHistoryByMidAndEvent ¶
func (d *Dao) EventHistoryByMidAndEvent(c context.Context, mid int64, eventID int64) (res *model.UserEventHistory, err error)
EventHistoryByMidAndEvent get one event history with mid and eventID from db.
func (*Dao) Factor ¶
func (d *Dao) Factor(c context.Context, serviceID, eventID int64, riskLevel int8) (factor *model.Factor, err error)
Factor get factor from db.
func (*Dao) FactorGroup ¶
func (d *Dao) FactorGroup(c context.Context, groupName string) (factorGroup *model.FactorGroup, err error)
FactorGroup get factor group from db.
func (*Dao) HistoryList ¶
func (d *Dao) HistoryList(c context.Context, mid int64, size int) (res []*model.UserEventHistory, err error)
HistoryList query .
func (*Dao) ProfileInfo ¶
func (d *Dao) ProfileInfo(c context.Context, mid int64, remoteIP string) (profile *model.ProfileInfo, err error)
ProfileInfo get user profile info from account service.
func (*Dao) PubScoreChange ¶
PubScoreChange pub spy score change msg into databus.
func (*Dao) RegisterProtection ¶
func (d *Dao) RegisterProtection(c context.Context, args url.Values, ip string) (level int8, err error)
RegisterProtection register protection.
func (*Dao) SecurityLogin ¶
SecurityLogin security login
func (*Dao) SetNXLockCache ¶
SetNXLockCache redis lock.
func (*Dao) SetUserInfoCache ¶
SetUserInfoCache set info cache.
func (*Dao) StatListByID ¶
StatListByID stat list by id.
func (*Dao) StatListByIDAndMid ¶
func (d *Dao) StatListByIDAndMid(c context.Context, mid, id int64) (list []*model.Statistics, err error)
StatListByIDAndMid stat list by id.
func (*Dao) StatListByMid ¶
StatListByMid stat list by mid.
func (*Dao) TelRiskLevel ¶
TelRiskLevel tel risk level.
func (*Dao) TxAddEventHistory ¶
func (d *Dao) TxAddEventHistory(c context.Context, tx *sql.Tx, ueh *model.UserEventHistory) (err error)
TxAddEventHistory insert user_event_history.
func (*Dao) TxAddPunishment ¶
func (d *Dao) TxAddPunishment(c context.Context, tx *sql.Tx, mid int64, t int8, reason string) (err error)
TxAddPunishment insert punishment.
func (*Dao) TxAddPunishmentQueue ¶
func (d *Dao) TxAddPunishmentQueue(c context.Context, tx *sql.Tx, mid int64, blockNo int64) (err error)
TxAddPunishmentQueue insert punishment queue.
func (*Dao) TxClearReliveTimes ¶
TxClearReliveTimes do clear user relivetimes.
func (*Dao) TxUpdateBaseScore ¶
TxUpdateBaseScore do update user base score.
func (*Dao) TxUpdateEventScore ¶
func (d *Dao) TxUpdateEventScore(c context.Context, tx *sql.Tx, mid int64, escore, score int8) (err error)
TxUpdateEventScore update user event score.
func (*Dao) TxUpdateEventScoreReLive ¶
func (d *Dao) TxUpdateEventScoreReLive(c context.Context, tx *sql.Tx, mid int64, escore, score int8) (err error)
TxUpdateEventScoreReLive update event score and times
func (*Dao) TxUpdateInfo ¶
TxUpdateInfo insert or update user info by mid.
func (*Dao) UnicomGiftState ¶
UnicomGiftState get unicom gift state by mid from account service.