Documentation ¶
Index ¶
- Constants
- func CreateActivity(ac *ActivityDO) error
- func CreateRegistration(rs *RegistrationDO) error
- func CreateUser(user *UsersDO) error
- func GetActivity(ac *ActivityDO) error
- func GetActivityWithRegisUsers()
- func QueryAndUpdateAcCurCount(acId uint, curCount int) error
- func QueryAndUpdateRegistration(userId, acId, status uint) error
- func QueryAndUpdateUser(openId string, user *UsersDO) error
- func QueryAndUpdateUserNameAndPhone(openId string, user *UsersDO) error
- func QueryAndUpdateUserRole(contactId int, newRole int) error
- func UpdateActivityDO(ac *ActivityDO) error
- func UpdateRegistrationDO(rs *RegistrationDO) error
- type ActionRes
- type ActivityDO
- type ActivityVO
- type AuthData
- type FetchActivityParam
- type Indicators
- type LoginData
- type Point
- type RegistrationActivityParam
- type RegistrationDO
- type RegistrationUserVO
- type SearchActivitiesParam
- type SearchOneUserParam
- type SearchUsersParam
- type Status
- type UpdateActivityParam
- type UpdateUserParam
- type UpdateUserRoleParam
- type UserInfo
- type UserVO
- type UsersDO
- func GetUserByNikeNameAndRole(nikeName string, roleId int) (UsersDO, error)
- func GetUserByPhoneAndRole(phone string, roleId int) (UsersDO, error)
- func QueryUser(openId string) (UsersDO, error)
- func QueryUserByID(id uint) (UsersDO, error)
- func SearchContactsList(param SearchUsersParam) (total int, contacts []*UsersDO, err error)
- type VerifyActivityParam
- type Watermark
Constants ¶
View Source
const ( UnderReview = 1 FailToPassReview = 2 Approved = 3 RegistrationDeadline = 4 ActivityEnd = 5 ActivityCancel = 6 Unknown )
View Source
const ( UnderReviewDesc = "未审核" FailToPassReviewDesc = "审核不通过" ApprovedDesc = "报名中" RegistrationDeadlineDesc = "报名已截止" ActivityEndDesc = "活动结束" ActivityCancelDesc = "活动关闭" UnknownDesc = "未知错误" )
View Source
const ( RegistrationDone = iota RegistrationCancel )
View Source
const ( Admin = 1 Editor = 2 Leader = 3 SimpleUser = 9 BlackUser = 10 )
Variables ¶
This section is empty.
Functions ¶
func CreateActivity ¶
func CreateActivity(ac *ActivityDO) error
func CreateRegistration ¶
func CreateRegistration(rs *RegistrationDO) error
func CreateUser ¶
func GetActivity ¶
func GetActivity(ac *ActivityDO) error
func GetActivityWithRegisUsers ¶
func GetActivityWithRegisUsers()
func QueryAndUpdateUser ¶
func QueryAndUpdateUserRole ¶
func UpdateActivityDO ¶
func UpdateActivityDO(ac *ActivityDO) error
func UpdateRegistrationDO ¶
func UpdateRegistrationDO(rs *RegistrationDO) error
Types ¶
type ActivityDO ¶
type ActivityDO struct { ID uint `gorm:"primary_key"` UpdatedAt time.Time CreatedAt time.Time Title string `gorm:"title"` StartPlace string `gorm:"start_place"` EndPlace string `gorm:"end_place"` StartTime int64 `gorm:"start_time"` RegistrationDeadline int64 `gorm:"registration_deadline"` CollectionPlace string `gorm:"collection_place"` LeaderID uint `gorm:"leader_id"` LeaderSay string `gorm:"leader_say"` RouteDesc string `gorm:"route_desc"` RoutePics string `gorm:"route_pics"` Attention string `gorm:"attention"` CurCount int `gorm:"cur_count"` CountLimit int `gorm:"count_limit"` RouteId int `gorm:"route_id"` QrCode string `gorm:"qr_code"` Status int `gorm:"status"` }
func SearchActivityList ¶
func SearchActivityList(param SearchActivitiesParam) (total int, activities []*ActivityDO, err error)
SearchActivityList ...
func (ActivityDO) TableName ¶
func (ActivityDO) TableName() string
type ActivityVO ¶
type ActivityVO struct { ID uint `json:"id"` Title string `json:"title"` StartPlace string `json:"start_place"` EndPlace string `json:"end_place"` StartTime int64 `json:"start_time"` RegistrationDeadline int64 `json:"registration_deadline"` CollectionPlace string `json:"collection_place"` LeaderID uint `json:"leader_id"` LeaderName string `json:"leader_name"` Phone string `json:"phone"` LeaderSay string `json:"leader_say"` RouteDesc string `json:"route_desc"` RoutePics string `json:"route_pics"` Attention string `json:"attention"` CurCount int `json:"cur_count"` CountLimit int `json:"count_limit"` QrCode string `json:"qr_code"` Status int `json:"status"` StatusDesc string `json:"status_desc"` ActionList []*ActionRes `json:"action_list"` AvatarUrls []string `json:"avatar_urls"` }
type FetchActivityParam ¶
type FetchActivityParam struct {
ID int `json:"id" form:"id"`
}
type Indicators ¶
type Indicators struct {
Points []*Point `json:"points"`
}
type RegistrationActivityParam ¶
type RegistrationActivityParam struct {
ActivityID uint `json:"activity_id"`
}
type RegistrationDO ¶
type RegistrationDO struct { ID uint `gorm:"primary_key"` UpdatedAt time.Time `gorm:"updated_at"` CreatedAt time.Time `gorm:"created_at"` UserID uint `gorm:"user_id"` ActivityID uint `gorm:"activity_id"` CancelTime time.Time `gorm:"cancel_time"` Status int `gorm:"status"` }
func GetRegistrationByUIDAndAcID ¶
func GetRegistrationByUIDAndAcID(userId, acId uint) (rss []*RegistrationDO, err error)
func GetRegistrationListByAcID ¶
func GetRegistrationListByAcID(acId uint) (rss []*RegistrationDO, err error)
func GetRegistrationOnlineByUIDAndAcID ¶
func GetRegistrationOnlineByUIDAndAcID(userId, acId uint) (rss []*RegistrationDO, err error)
func (RegistrationDO) TableName ¶
func (RegistrationDO) TableName() string
type RegistrationUserVO ¶
type RegistrationUserVO struct { RegistrationDO UserVO }
func GetRegistrationWithUsers ¶
func GetRegistrationWithUsers(id uint) (rss []*RegistrationUserVO, err error)
select * from registration join users on registration.user_id = users.id where activity_id = 32;
type SearchActivitiesParam ¶
type SearchActivitiesParam struct { Page string `json:"page" form:"page"` PageSize string `json:"pagesize" form:"pagesize"` LeaderID uint `json:"leader_id" form:"leader_id"` UserID uint `json:"user_id" form:"user_id"` Status uint `json:"status" form:"status"` ID int `json:"id" form:"id"` Title string `json:"title" form:"title"` StartTime string `json:"start_time" form:"start_time"` RegistrationDeadline string `json:"registration_deadline" form:"registration_deadline"` CollectionPlace string `json:"collection_place" form:"collection_place"` LeaderName string `json:"leader_name" form:"leader_name"` }
type SearchOneUserParam ¶
type SearchUsersParam ¶
type Status ¶
func GetGlobalStatus ¶
type UpdateActivityParam ¶
type UpdateActivityParam struct { ID uint `json:"id"` IsCancel bool `json:"is_cancel"` Activity ActivityVO `json:"activity"` }
type UpdateUserParam ¶
type UpdateUserRoleParam ¶
type UserInfo ¶
type UserInfo struct { OpenId string `json:"openId"` NickName string `json:"nickName"` RoleID int `json:"roleId"` Gender uint `json:"gender"` Language string `json:"language"` City string `json:"city"` Province string `json:"province"` Country string `json:"country"` AvatarUrl string `json:"avatarUrl"` Id string `json:"id"` Watermark Watermark `json:"watermark"` }
type UserVO ¶
type UserVO struct { ID uint `json:"id"` Name string `json:"name"` Nickname string `json:"nickName"` Gender uint `json:"gender"` City string `json:"city"` AvatarUrl string `json:"avatarUrl"` Campus string `json:"campus"` Phone string `json:"phone"` RoleId int `json:"roleId"` BanStatus int `json:"ban_status"` }
type UsersDO ¶
type UsersDO struct { ID uint `gorm:"primary_key"` UpdatedAt time.Time CreatedAt time.Time Name string Nickname string Gender uint City string AvatarUrl string Campus string Phone string Major string WeId string OpenId string RoleId int BanStatus int LastBanPoint time.Time BanTime int }
func QueryUserByID ¶
func SearchContactsList ¶
func SearchContactsList(param SearchUsersParam) (total int, contacts []*UsersDO, err error)
type VerifyActivityParam ¶
Click to show internal directories.
Click to hide internal directories.