comp

package
v0.0.0-...-e3494e8 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TABLE_USER     = "user"
	TABLE_GROUP    = "group"
	TABLE_ACTIVITY = "activity"
)

Variables

View Source
var TimeFormat = "2006-01-02 15:04:05"
View Source
var TimeFormatE = "2006-01-02T15:04:05Z07:00"

Functions

This section is empty.

Types

type APIActivity

type APIActivity struct {
	ID        int32     `json:"id"`
	UserID    int32     `json:"user_id"`
	Kind      int32     `json:"kind"`       // 活动分类:1羽毛球,2篮球,3足球,4聚餐...
	Type      int32     `json:"type"`       // 活动类型:1全局保护,2全局公开,3群组
	Status    int32     `json:"status"`     // 活动状态:1进行中,2正常结算完成,3手动终止
	Quota     int32     `json:"quota"`      // 名额
	GroupID   int32     `json:"group_id"`   // 群组ID
	Ahead     int32     `json:"ahead"`      // 提前取消报名限制(小时)
	FeeType   int32     `json:"fee_type"`   // 结算方式:1免费,2活动前,3活动后男女平均,4活动后男固定|女平摊,5活动后男平摊|女固定
	FeeMale   int32     `json:"fee_male"`   // 男费用
	FeeFemale int32     `json:"fee_female"` // 女费用
	Title     string    `json:"title"`
	Remark    string    `json:"remark"`
	Addr      string    `json:"addr"`
	BeginAt   time.Time `json:"begin_at"`
	EndAt     time.Time `json:"end_at"`
	Queue     []int32   `json:"queue"` // 报名队列
}

func (APIActivity) CanCancel

func (a APIActivity) CanCancel() bool

CanCancel 能否取消报名

func (APIActivity) GetIdFromQueueV

func (a APIActivity) GetIdFromQueueV(index int) int32

GetIdFromQueueV 根据索引从报名队列中获取ID

func (APIActivity) HasBegun

func (a APIActivity) HasBegun() bool

HasBegun 是否开始

func (APIActivity) InQueueV

func (a APIActivity) InQueueV(uid int32) bool

InQueueV 在报名中

func (APIActivity) IsPlanner

func (a APIActivity) IsPlanner(uid int32) bool

IsPlanner 是否发起者

func (APIActivity) NotEnough

func (a APIActivity) NotEnough(uid int32, total int) bool

NotEnough 要取消报名的数量超过已经报名的数量

func (APIActivity) OverQuota

func (a APIActivity) OverQuota(total int32) bool

OverQuota 报名的人数超过候补的限制,避免乱报名,如带100000人报名

func (*APIActivity) Settle

func (a *APIActivity) Settle(fee int32)

Settle 结算

type APIActivityUser

type APIActivityUser struct {
	ID         int32  `json:"id"`          // 活动报名id
	ActivityID int32  `json:"activity_id"` // 活动id
	UserID     int32  `json:"user_id"`     // 报名用户id
	Alias_     string `json:"alias"`       // 报名昵称
	IsFriend   int32  `json:"is_friend"`   // 是否朋友
}

type APIGroup

type APIGroup struct {
	ID         int32       `json:"id"`
	Level      int         `json:"level"`
	Scores     int         `json:"scores"`
	Name       string      `json:"name"`
	Notice     string      `json:"notice"`
	Addr       string      `json:"addr"`
	Activities []int32     `json:"activities"`
	Pending    []int32     `json:"pending"` // 申请入群列表
	Members    []APIMember `json:"members"`
}

func NewGroup

func NewGroup() *APIGroup

NewGroup 新建群组

func (APIGroup) AddActivity

func (g APIGroup) AddActivity(aid int32)

AddActivity 添加活动

func (*APIGroup) ExistsActivity

func (g *APIGroup) ExistsActivity(aid int32) bool

ExistsActivity 是否存在活动

func (APIGroup) IsManager

func (g APIGroup) IsManager(uid int32) bool

IsManager 是否管理员

func (APIGroup) IsMember

func (g APIGroup) IsMember(uid int32) bool

IsMember 是否群成员

func (APIGroup) IsOwner

func (g APIGroup) IsOwner(uid int32) bool

IsOwner 是否群主

func (APIGroup) ManagerCount

func (g APIGroup) ManagerCount() int

ManagerCount 管理员数量

func (APIGroup) NotIn

func (g APIGroup) NotIn(uid int32) bool

NotIn 不在群组

func (APIGroup) NotInPendingV

func (g APIGroup) NotInPendingV(index int) bool

NotInPendingV 不在申请列表

func (*APIGroup) OutDB

func (g *APIGroup) OutDB()

OutDB 反序列化

func (*APIGroup) Promote

func (g *APIGroup) Promote(uid int32) bool

Promote 提升管理员

func (*APIGroup) Remove

func (g *APIGroup) Remove(uid int32) bool

Remove 移除群组成员

func (*APIGroup) RemoveActivity

func (g *APIGroup) RemoveActivity(aid int32) bool

RemoveActivity 移除活动

func (*APIGroup) Transfer

func (g *APIGroup) Transfer(uid, mid int32) bool

Transfer 转让群主

type APIGroupApplication

type APIGroupApplication struct {
	ID      int32 `json:"id"`       // 申请id
	UserID  int32 `json:"user_id"`  // 用户id
	GroupID int32 `json:"group_id"` // 群组id
}

type APIGroupMember

type APIGroupMember struct {
	ID       int32     `json:"id"`       // 成员id
	GroupID  int32     `json:"group_id"` // 群组id
	UserID   int32     `json:"user_id"`  // 用户id
	Scores   int32     `json:"scores"`   // 积分
	Position int32     `json:"position"` // 群组职位
	Alias_   string    `json:"alias"`    // 群组中的昵称
	Avatar   string    `json:"avatar"`   // 头像
	EnterAt  time.Time `json:"enter_at"` // 进入群组时间
}

type APIMember

type APIMember struct {
	ID       int32     `json:"id"`
	UserID   int32     `json:"user_id"`
	GroupID  int32     `json:"group_id"`
	Scores   int32     `json:"scores"`
	Position int32     `json:"position"`
	Sex      int32     `json:"sex"`
	Avatar   string    `json:"avatar"`
	EnterAt  time.Time `json:"enter_at"`
	WxNick   string    `json:"wx_nick"`
	Nick     string    `json:"nick"`
}

type APIUser

type APIUser struct {
	ID         int32   `json:"id"`
	Sex        int     `json:"sex"`
	Scores     int     `json:"scores"`
	Username   string  `json:"username"`
	Token      string  `json:"token"`
	WxToken    string  `json:"wx_token"`
	WxNick     string  `json:"wx_nick"`
	Nick       string  `json:"nick"`
	Ip         string  `json:"ip"`
	Phone      string  `json:"phone"`
	Email      string  `json:"email"`
	Groups     []int32 `json:"groups"`
	Activities []int32 `json:"activities"`
}

type BodyObject

type BodyObject struct {
	Token string `json:"token" form:"token"`

	// 用户
	Username string `json:"username" form:"username"`
	Password string `json:"password" form:"password"`
	Nick     string `json:"nick" form:"nick"`
	Sex      uint   `json:"sex" form:"sex"`

	// 分页
	Page uint `json:"page" form:"page"`
	Num  uint `json:"num" form:"num"`

	// 活动
	GroupId     uint64 `json:"group_id" form:"group_id"`
	Kind        uint   `json:"kind" form:"kind"`
	Type        uint   `json:"type" form:"type"`
	Status      uint   `json:"status" form:"status"`
	Quota       uint   `json:"quota" form:"quota"`
	Title       string `json:"title" form:"title"`
	Remark      string `json:"remark" form:"remark"`
	Fee         uint   `json:"fee" form:"fee"`
	FeeType     uint   `json:"fee_type" form:"fee_type"`
	FeeMale     uint   `json:"fee_male" form:"fee_male"`
	FeeFemale   uint   `json:"fee_female" form:"fee_female"`
	Ahead       uint   `json:"ahead" form:"ahead"`
	BeginAt     string `json:"begin_at" form:"begin_at"`
	EndAt       string `json:"end_at" form:"end_at"`
	MaleCount   uint   `json:"male_count" form:"male_count"`
	FemaleCount uint   `json:"female_count" form:"female_count"`

	// 群组
	GroupName string `json:"name" form:"name"`
	Addr      string `json:"addr" form:"addr"`
	Notice    string `json:"notice" form:"notice"`
	Pass      bool   `json:"pass" form:"pass"`
	Index     uint   `json:"index" form:"index"`
}

func (*BodyObject) Reset

func (b *BodyObject) Reset()

type Player

type Player struct {
	Id     int64  `json:"id"`
	Sex    int    `json:"sex"`
	WxNick string `json:"wx_nick"`
	Nick   string `json:"nick"`
}

type Session

type Session struct {
	Uid     int32     `json:"uid"`
	Sex     int32     `json:"sex"`
	Token   string    `json:"token"`
	LoginAt time.Time `json:"login_at"`
}

Jump to

Keyboard shortcuts

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