Documentation ¶
Index ¶
- Constants
- func BmGetInt64OrDefault(c *bm.Context, key string, defaul int64) (value int64, exist bool)
- func BmGetStringOrDefault(c *bm.Context, key string, defaul string) (value string, exist bool)
- func BmHTTPErrorWithMsg(c *bm.Context, err error, msg string)
- type Service
- func (s *Service) AddGroup(c *blademaster.Context, arg *model.AddGroupArg) (result sql.Result, err error)
- func (s *Service) AddUpPassedCache(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
- func (s *Service) AddUpPassedCacheByStaff(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
- func (s *Service) Close()
- func (s *Service) DelUpPassedCache(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
- func (s *Service) DelUpPassedCacheByStaff(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
- func (s *Service) Edit(c context.Context, mid int64, isAuthor int, from uint8) (row int64, err error)
- func (s *Service) GetCardInfo(ctx *blademaster.Context, mid int64) (card *model.UpCard, err error)
- func (s *Service) GetCardInfoByMids(ctx *blademaster.Context, mids []int64) (cards map[int64]*model.UpCard, err error)
- func (s *Service) GetGroup(c *blademaster.Context, arg *model.GetGroupArg) (res []*model.UpGroup, err error)
- func (s *Service) GetHighAllyUps(ctx context.Context, req *v1.HighAllyUpsReq) (res *v1.HighAllyUpsReply, err error)
- func (s *Service) GetUpInfoActive(ctx context.Context, req *model.UpInfoActiveReq) (res *model.UpInfoActiveReply, err error)
- func (s *Service) GetUpsInfoActive(ctx context.Context, req *model.UpsInfoActiveReq) (res map[int64]*model.UpInfoActiveReply, err error)
- func (s *Service) IdentifyAll(c context.Context, mid int64, ip string) (ia *model.IdentifyAll, err error)
- func (s *Service) Info(c context.Context, mid int64, from uint8) (isAuthor int, err error)
- func (s *Service) ListCardBase(ctx *blademaster.Context) (mids []int64, err error)
- func (s *Service) ListCardDetail(ctx context.Context, offset uint, size uint) (cards map[int64]*model.UpCard, total int, err error)
- func (s *Service) ListUpBase(c *bm.Context, size int, lastID int64, activity []int64) (mids []int64, newLastID int64, err error)
- func (s *Service) Ping(c context.Context) (err error)
- func (s *Service) RawUpSwitch(c context.Context, mid int64, from uint8) (state int, err error)
- func (s *Service) RemoveGroup(c *blademaster.Context, arg *model.RemoveGroupArg) (result sql.Result, err error)
- func (s *Service) SetAuthServer(authSvr *permit.Permit)
- func (s *Service) SetSwitch(c context.Context, mid int64, state int, from uint8) (row int64, err error)
- func (s *Service) SetUpSwitch(c context.Context, req *upgrpc.UpSwitchReq) (res *upgrpc.NoReply, err error)
- func (s *Service) ShardingQueueIndex(mid int64) (i int)
- func (s *Service) SpecialAdd(c context.Context, adminName string, special *model.UpSpecial, mids ...int64) (affectedRow int64, err error)
- func (s *Service) SpecialDel(c *bm.Context, id int64) (affectedRow int64, err error)
- func (s *Service) SpecialEdit(c *bm.Context, special *model.UpSpecial, id int64) (affectedRow int64, err error)
- func (s *Service) SpecialGet(c *bm.Context, arg *model.GetSpecialArg) (res []*model.UpSpecialWithName, total int, err error)
- func (s *Service) SpecialGetByMid(c *bm.Context, arg *model.GetSpecialByMidArg) (res []*model.UpSpecial, err error)
- func (s *Service) SpecialGroupPermit(c *blademaster.Context, groupID int64) (err error)
- func (s *Service) Start(c chan *databus.Message)
- func (s *Service) UpArcs(c context.Context, arg *upgrpc.UpArcsReq) (res *upgrpc.UpArcsReply, err error)
- func (s *Service) UpAttr(c context.Context, req *upgrpc.UpAttrReq) (res *upgrpc.UpAttrReply, err error)
- func (s *Service) UpBaseStats(c context.Context, req *upgrpc.UpStatReq) (res *upgrpc.UpBaseStatReply, err error)
- func (s *Service) UpCount(c context.Context, arg *upgrpc.UpCountReq) (res *upgrpc.UpCountReply, err error)
- func (s *Service) UpGroupMids(c context.Context, req *upgrpc.UpGroupMidsReq) (res *upgrpc.UpGroupMidsReply, err error)
- func (s *Service) UpGroups(c context.Context, req *upgrpc.NoArgReq) (res *upgrpc.UpGroupsReply, err error)
- func (s *Service) UpInfoActivitys(c context.Context, req *upgrpc.UpListByLastIDReq) (res *upgrpc.UpActivityListReply, err error)
- func (s *Service) UpSpecial(c context.Context, req *upgrpc.UpSpecialReq) (res *upgrpc.UpSpecialReply, err error)
- func (s *Service) UpSwitch(c context.Context, req *upgrpc.UpSwitchReq) (res *upgrpc.UpSwitchReply, err error)
- func (s *Service) UpSwitchs(c context.Context, mid int64, from uint8) (state int, err error)
- func (s *Service) UpdateGroup(c *blademaster.Context, arg *model.EditGroupArg) (result sql.Result, err error)
- func (s *Service) UpsAidPubTime(c context.Context, arg *upgrpc.UpsArcsReq) (res *upgrpc.UpsAidPubTimeReply, err error)
- func (s *Service) UpsArcs(c context.Context, arg *upgrpc.UpsArcsReq) (res *upgrpc.UpsArcsReply, err error)
- func (s *Service) UpsByGroup(c context.Context, group int64) (ups []*model.UpSpecial)
- func (s *Service) UpsCount(c context.Context, arg *upgrpc.UpsCountReq) (res *upgrpc.UpsCountReply, err error)
- func (s *Service) UpsSpecial(c context.Context, req *upgrpc.UpsSpecialReq) (res *upgrpc.UpsSpecialReply, err error)
- type UpSpecialLogInfo
Constants ¶
const ( //ActionAdd add ActionAdd = "add" //ActionEdit edit ActionEdit = "edit" //ActionDelete delete ActionDelete = "delete" )
Variables ¶
This section is empty.
Functions ¶
func BmGetInt64OrDefault ¶
BmGetInt64OrDefault get int64
func BmGetStringOrDefault ¶
BmGetStringOrDefault get string
Types ¶
type Service ¶
Service is service.
func (*Service) AddGroup ¶
func (s *Service) AddGroup(c *blademaster.Context, arg *model.AddGroupArg) (result sql.Result, err error)
AddGroup add group
func (*Service) AddUpPassedCache ¶
func (s *Service) AddUpPassedCache(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
AddUpPassedCache add up passed archive cache.
func (*Service) AddUpPassedCacheByStaff ¶
func (s *Service) AddUpPassedCacheByStaff(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
AddUpPassedCacheByStaff add up passed archive cache by staff.
func (*Service) DelUpPassedCache ¶
func (s *Service) DelUpPassedCache(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
DelUpPassedCache delete up passed archive cache.
func (*Service) DelUpPassedCacheByStaff ¶
func (s *Service) DelUpPassedCacheByStaff(c context.Context, arg *upgrpc.UpCacheReq) (res *upgrpc.NoReply, err error)
DelUpPassedCacheByStaff delete up passed archive cache by staff.
func (*Service) Edit ¶
func (s *Service) Edit(c context.Context, mid int64, isAuthor int, from uint8) (row int64, err error)
Edit 处理通过databus注册的up主信息。如果该up曾经注册过则更新attr并更新db,否则第一次计算attr并插入db。
func (*Service) GetCardInfo ¶
GetCardInfo get card content by mid
func (*Service) GetCardInfoByMids ¶
func (s *Service) GetCardInfoByMids(ctx *blademaster.Context, mids []int64) (cards map[int64]*model.UpCard, err error)
GetCardInfoByMids get <mid, card> map by mids
func (*Service) GetGroup ¶
func (s *Service) GetGroup(c *blademaster.Context, arg *model.GetGroupArg) (res []*model.UpGroup, err error)
GetGroup get group
func (*Service) GetHighAllyUps ¶
func (s *Service) GetHighAllyUps(ctx context.Context, req *v1.HighAllyUpsReq) (res *v1.HighAllyUpsReply, err error)
GetHighAllyUps service get high ally ups
func (*Service) GetUpInfoActive ¶
func (s *Service) GetUpInfoActive(ctx context.Context, req *model.UpInfoActiveReq) (res *model.UpInfoActiveReply, err error)
GetUpInfoActive get up info active
func (*Service) GetUpsInfoActive ¶
func (s *Service) GetUpsInfoActive(ctx context.Context, req *model.UpsInfoActiveReq) (res map[int64]*model.UpInfoActiveReply, err error)
GetUpsInfoActive get ups info active
func (*Service) IdentifyAll ¶
func (s *Service) IdentifyAll(c context.Context, mid int64, ip string) (ia *model.IdentifyAll, err error)
IdentifyAll get all type of uper auth.
func (*Service) ListCardBase ¶
func (s *Service) ListCardBase(ctx *blademaster.Context) (mids []int64, err error)
ListCardBase list card mids
func (*Service) ListCardDetail ¶
func (s *Service) ListCardDetail(ctx context.Context, offset uint, size uint) (cards map[int64]*model.UpCard, total int, err error)
ListCardDetail page list card content
func (*Service) ListUpBase ¶
func (s *Service) ListUpBase(c *bm.Context, size int, lastID int64, activity []int64) (mids []int64, newLastID int64, err error)
ListUpBase list up base info
func (*Service) RawUpSwitch ¶
RawUpSwitch for creative with no cache.
func (*Service) RemoveGroup ¶
func (s *Service) RemoveGroup(c *blademaster.Context, arg *model.RemoveGroupArg) (result sql.Result, err error)
RemoveGroup remove group
func (*Service) SetAuthServer ¶
SetAuthServer set auth
func (*Service) SetSwitch ¶
func (s *Service) SetSwitch(c context.Context, mid int64, state int, from uint8) (row int64, err error)
SetSwitch insert or update switch。
func (*Service) SetUpSwitch ¶
func (s *Service) SetUpSwitch(c context.Context, req *upgrpc.UpSwitchReq) (res *upgrpc.NoReply, err error)
SetUpSwitch .
func (*Service) ShardingQueueIndex ¶
ShardingQueueIndex sharding queue index
func (*Service) SpecialAdd ¶
func (s *Service) SpecialAdd(c context.Context, adminName string, special *model.UpSpecial, mids ...int64) (affectedRow int64, err error)
SpecialAdd add special
func (*Service) SpecialDel ¶
SpecialDel id 是数据库主键
func (*Service) SpecialEdit ¶
func (s *Service) SpecialEdit(c *bm.Context, special *model.UpSpecial, id int64) (affectedRow int64, err error)
SpecialEdit edit up special
func (*Service) SpecialGet ¶
func (s *Service) SpecialGet(c *bm.Context, arg *model.GetSpecialArg) (res []*model.UpSpecialWithName, total int, err error)
SpecialGet 这个接口支持更多参数,直接从数据库来查询
func (*Service) SpecialGetByMid ¶
func (s *Service) SpecialGetByMid(c *bm.Context, arg *model.GetSpecialByMidArg) (res []*model.UpSpecial, err error)
SpecialGetByMid get special
func (*Service) SpecialGroupPermit ¶
func (s *Service) SpecialGroupPermit(c *blademaster.Context, groupID int64) (err error)
SpecialGroupPermit check permit for special groups
func (*Service) UpArcs ¶
func (s *Service) UpArcs(c context.Context, arg *upgrpc.UpArcsReq) (res *upgrpc.UpArcsReply, err error)
UpArcs upper passed.
func (*Service) UpAttr ¶
func (s *Service) UpAttr(c context.Context, req *upgrpc.UpAttrReq) (res *upgrpc.UpAttrReply, err error)
UpAttr .
func (*Service) UpBaseStats ¶
func (s *Service) UpBaseStats(c context.Context, req *upgrpc.UpStatReq) (res *upgrpc.UpBaseStatReply, err error)
UpBaseStats .
func (*Service) UpCount ¶
func (s *Service) UpCount(c context.Context, arg *upgrpc.UpCountReq) (res *upgrpc.UpCountReply, err error)
UpCount upper count.
func (*Service) UpGroupMids ¶
func (s *Service) UpGroupMids(c context.Context, req *upgrpc.UpGroupMidsReq) (res *upgrpc.UpGroupMidsReply, err error)
UpGroupMids .
func (*Service) UpGroups ¶
func (s *Service) UpGroups(c context.Context, req *upgrpc.NoArgReq) (res *upgrpc.UpGroupsReply, err error)
UpGroups .
func (*Service) UpInfoActivitys ¶
func (s *Service) UpInfoActivitys(c context.Context, req *upgrpc.UpListByLastIDReq) (res *upgrpc.UpActivityListReply, err error)
UpInfoActivitys up info activity by last_id.
func (*Service) UpSpecial ¶
func (s *Service) UpSpecial(c context.Context, req *upgrpc.UpSpecialReq) (res *upgrpc.UpSpecialReply, err error)
UpSpecial .
func (*Service) UpSwitch ¶
func (s *Service) UpSwitch(c context.Context, req *upgrpc.UpSwitchReq) (res *upgrpc.UpSwitchReply, err error)
UpSwitch for app with cache.
func (*Service) UpdateGroup ¶
func (s *Service) UpdateGroup(c *blademaster.Context, arg *model.EditGroupArg) (result sql.Result, err error)
UpdateGroup update group
func (*Service) UpsAidPubTime ¶
func (s *Service) UpsAidPubTime(c context.Context, arg *upgrpc.UpsArcsReq) (res *upgrpc.UpsAidPubTimeReply, err error)
UpsAidPubTime get aid and pime by mids
func (*Service) UpsArcs ¶
func (s *Service) UpsArcs(c context.Context, arg *upgrpc.UpsArcsReq) (res *upgrpc.UpsArcsReply, err error)
UpsArcs get archives by mids.
func (*Service) UpsByGroup ¶
UpsByGroup Flows get group ups list.
func (*Service) UpsCount ¶
func (s *Service) UpsCount(c context.Context, arg *upgrpc.UpsCountReq) (res *upgrpc.UpsCountReply, err error)
UpsCount uppers count
func (*Service) UpsSpecial ¶
func (s *Service) UpsSpecial(c context.Context, req *upgrpc.UpsSpecialReq) (res *upgrpc.UpsSpecialReply, err error)
UpsSpecial .
type UpSpecialLogInfo ¶
type UpSpecialLogInfo struct { Up *model.UpSpecialWithName UpOld *model.UpSpecialWithName UID int64 UName string CTime time.Time Action string }
UpSpecialLogInfo special log