Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActivityObj *ActivityObject
	ActivityMap map[uint32][]*ActivityDBData //存储数据
	MaxId       uint32
)

Functions

func Initialize

func Initialize()

func LoadActivityDetails

func LoadActivityDetails(idx uint32, datas *[]*proto.ST_ActivityContent_PB)

func LoadActivityScores

func LoadActivityScores(activityIdx uint32, serial uint32, res *[]*proto.ST_ActivityScore_User)

func UpsertActivityData

func UpsertActivityData(idx uint32, doc interface{}) error

func UpsertActivityDetailData

func UpsertActivityDetailData(_id string, idx, contentID uint32, doc interface{}) error

func UpsertActivityScoreNormal

func UpsertActivityScoreNormal(_id string, idx uint32, uid uint64, doc interface{}) error

Types

type ActivityDBData

type ActivityDBData struct {
	IDx  uint32
	Data *proto.ST_Activity_PB
}

type ActivityDetailDBData

type ActivityDetailDBData struct {
	ID        uint32
	IDx       uint32
	ContentID uint32
	Detail    *proto.ST_ActivityContent_PB
}

type ActivityDetailDocument

type ActivityDetailDocument struct {
	ID string "_id"

	IDx       uint32 "idx"
	ContentID uint32 "cid"
	Detail    []byte "detail"
}

type ActivityDetailObject

type ActivityDetailObject struct {
	DBAction.DBObject

	sync.RWMutex
	ActivityDetailMap map[string]*proto.ST_ActivityContent_PB
	SendTopList       bool
	// contains filtered or unexported fields
}
var (
	ActicityDetailObj *ActivityDetailObject
)

func (*ActivityDetailObject) ClearAll

func (this *ActivityDetailObject) ClearAll()

func (*ActivityDetailObject) GetTableName

func (o *ActivityDetailObject) GetTableName() string

func (*ActivityDetailObject) GroupRange

func (this *ActivityDetailObject) GroupRange(onlyRead bool, id int, class int, cid int, callback func(data *proto.ST_ActivityContent_PB) bool)

func (*ActivityDetailObject) Init

func (o *ActivityDetailObject) Init(dbName, tableName string)

func (*ActivityDetailObject) LoadActivityDetail

func (o *ActivityDetailObject) LoadActivityDetail(id uint32)

func (*ActivityDetailObject) NewGroup

func (*ActivityDetailObject) SaveTipslistDB

func (this *ActivityDetailObject) SaveTipslistDB()

type ActivityDocument

type ActivityDocument struct {
	ID       uint32 "_id"
	Activity []byte "activity"
}

type ActivityObject

type ActivityObject struct {
	DBAction.DBObject

	sync.RWMutex
	ActivityDetailMap map[uint32]*proto.ST_Activity_PB
	// contains filtered or unexported fields
}

func (*ActivityObject) Find

func (this *ActivityObject) Find(onlyRead bool, ServerID, id uint32, callback func(data *proto.ST_Activity_PB) bool)

func (*ActivityObject) FindIgnoreServerid

func (this *ActivityObject) FindIgnoreServerid(onlyRead bool, id uint32, callback func(data *proto.ST_Activity_PB) bool)

func (*ActivityObject) ForEach1

func (this *ActivityObject) ForEach1(callback func(document *ActivityDocument))

func (*ActivityObject) GetTableName

func (o *ActivityObject) GetTableName() string

func (*ActivityObject) Init

func (o *ActivityObject) Init(dbName, tableName string)

func (*ActivityObject) LoadAllActivities

func (this *ActivityObject) LoadAllActivities() error

func (*ActivityObject) New

func (this *ActivityObject) New(ServerID, id uint32, StagetEndTime uint64, time string) *proto.ST_Activity_PB

func (*ActivityObject) Range

func (this *ActivityObject) Range(onlyRead bool, callback func(data *proto.ST_Activity_PB) bool)

func (*ActivityObject) RemoveActivityByID

func (o *ActivityObject) RemoveActivityByID(id uint32) error

func (*ActivityObject) Save

func (this *ActivityObject) Save()

type NormalScoreDBData

type NormalScoreDBData struct {
	IDx       uint32
	ContentID uint32
	SerialID  uint32
	UserID    uint64
	ScoreData *proto.ST_ActivityScore_PB
}

type NormalScoreDocument

type NormalScoreDocument struct {
	ID string "_id"

	ContentID   uint32 "contentid"
	SerialID    uint32 "serialid"
	UserID      uint64 "userid"
	ActivityIdx uint32 "index" // idx of Activity
	ScoreData   []byte "data"
}

type ScoreNormalObject

type ScoreNormalObject struct {
	DBAction.DBObject
	// contains filtered or unexported fields
}
var (
	ScoreNormalObj *ScoreNormalObject
)

func (*ScoreNormalObject) DeleteDatasNotSerial

func (o *ScoreNormalObject) DeleteDatasNotSerial(idx, serial uint32)

func (*ScoreNormalObject) GetTableName

func (o *ScoreNormalObject) GetTableName() string

func (*ScoreNormalObject) Init

func (o *ScoreNormalObject) Init(dbName, tableName string)

func (*ScoreNormalObject) RemoveActivityScoreById

func (o *ScoreNormalObject) RemoveActivityScoreById(id uint32) error