service

package
v0.0.0-...-5aa83a4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Pool *redis.Pool
)

Functions

func CancelRegistrationActivity

func CancelRegistrationActivity(userId uint, acId uint) error

CancelRegistrationActivity ...

func ConvertUserDOToVo

func ConvertUserDOToVo(do *model.UsersDO) model.UserVO

ConvertUserDOToVo ...

func FetchStatusCycle

func FetchStatusCycle() error

FetchStatusCycle...

func GenRandString

func GenRandString(length int) string

GenRandString ...

func GenToken

func GenToken(authStr string) (token string)

GenToken ...

func GetActivity

func GetActivity(id uint) (model.ActivityVO, error)

GetActivity ...

func GetContactByPhoneOrNickName

func GetContactByPhoneOrNickName(sKey string, roleId int) (*model.UserVO, error)

GetContactByPhoneOrNickName ...

func GetOpenIdByToken

func GetOpenIdByToken(token string) (string, error)

GetOpenIdByToken ...

func GetRegistrationUsers

func GetRegistrationUsers(acId uint) ([]*model.RegistrationUserVO, error)

GetRegistrationUsers ...

func GetStatusItem

func GetStatusItem(name string) string

GetStatusItem...

func GetUserByOpenID

func GetUserByOpenID(id string) (model.UsersDO, error)

GetUserByOpenID ...

func HasUserRegisterActivity

func HasUserRegisterActivity(userId, acId uint) (bool, bool, error)

HasUserRegisterActivity ...

func QueryUserByID

func QueryUserByID(id uint) (model.UsersDO, error)

QueryUserByID ...

func RFC3339StringToTime

func RFC3339StringToTime(str string) (t *time.Time, err error)

RFC3339StringToTime ...

func RegistrationActivity

func RegistrationActivity(userId uint, acId uint) error

RegistrationActivity ...

func SaveActivity

func SaveActivity(vo *model.ActivityVO) error

SaveActivity ...

func SaveSession

func SaveSession(ttl uint64, token, userData string) error

SaveSession ...

func SaveUserOpenID

func SaveUserOpenID(openId string) error

SaveUserOpenID ...

func SearchActivities

func SearchActivities(param model.SearchActivitiesParam) (int, []*model.ActivityVO, error)

SearchActivities ...

func SearchContacts

func SearchContacts(param model.SearchUsersParam) (int, []*model.UserVO, error)

SearchContacts ...

func StringWithCharset

func StringWithCharset(length int, charset string) string

StringWithCharset ...

func TryGetUserSession

func TryGetUserSession(token string) (string, error)

TryGetUserSession ...

func UpdateActivity

func UpdateActivity(param model.UpdateActivityParam) error

UpdateActivity ...

func UpdateRegisterUserCount

func UpdateRegisterUserCount(acId uint) error

UpdateRegisterUserCount ...

func UpdateUserInfo

func UpdateUserInfo(openId string, user model.UsersDO) error

UpdateUserInfo ...

func UpdateUserRole

func UpdateUserRole(id int, newRole int) error

UpdateUserRole ...

func VerifyActivity

func VerifyActivity(id uint, st int) error

VerifyActivity ...

Types

type AuthResult

type AuthResult struct {
	Openid     string `json:"openid"`
	SessionKey string `json:"session_key"`
	Unionid    string `json:"unionid"`
	Errcode    int    `json:"errcode"`
	Errmsg     string `json:"errmsg"`
}

func WxJsCode2Session

func WxJsCode2Session(code string) (AuthResult, error)

小程序登录凭证校验 https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/login/auth.code2Session.html code: 小程序端通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器 AuthResult: 认证的结果

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler...

func NewScheduler

func NewScheduler() *Scheduler

NewScheduler...

func (*Scheduler) AddTask

func (s *Scheduler) AddTask(period uint64, run func() error)

AddTask...

func (*Scheduler) RunAllTasks

func (s *Scheduler) RunAllTasks()

RunAllTasks...

func (*Scheduler) StopAllTasks

func (s *Scheduler) StopAllTasks()

StopAllTasks...

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task...

Jump to

Keyboard shortcuts

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