model

package
v1.0.38 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: AGPL-3.0 Imports: 10 Imported by: 1

Documentation

Overview

Package model @Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(user *User) error

AddUser *

  • @Description:
  • @param user
  • @return error

func AddWechatUser added in v1.0.37

func AddWechatUser(user *WechatUser) error

func DeleteUser

func DeleteUser(uid string) error

DeleteUser

@Description:
* @param uid
* @return error

func DeleteWechatUser added in v1.0.37

func DeleteWechatUser(openID string) error

func SearchAnswer added in v1.0.34

func SearchAnswer(title string) string

func SetPush

func SetPush(push func(id, kind, message string))

func TokenToCookies

func TokenToCookies(token string) []*http.Cookie

func UpdateUser

func UpdateUser(user *User) error

UpdateUser *

  • @Description:
  • @param user
  • @return error

func UpdateWechatUser added in v1.0.37

func UpdateWechatUser(user *WechatUser) error

func UserCount

func UserCount(uid string) int

UserCount *

  • @Description:
  • @param uid
  • @return int

func WechatUserCount added in v1.0.37

func WechatUserCount(openID string) int

Types

type User

type User struct {
	Nick      string `json:"nick"`
	UID       string `json:"uid"`
	Token     string `json:"token"`
	LoginTime int64  `json:"login_time"`
	PushId    string `json:"push_id"`
	Status    int    `json:"status"`
}

User *

  • @Description:

func Find

func Find(uid string) *User

Find *

  • @Description:
  • @param uid
  • @return *User

func Query

func Query() ([]*User, error)

Query *

  • @Description: 查询所有未掉线的用户
  • @return []*User
  • @return error

func QueryByPushID

func QueryByPushID(pushID string) ([]*User, error)

QueryByPushID *

  • @Description: 根据推送平台的key查询用户
  • @return []*User
  • @return error

func QueryFailUser added in v1.0.33

func QueryFailUser() ([]*User, error)

func (*User) ToBrowserCookies

func (u *User) ToBrowserCookies() []playwright.BrowserContextAddCookiesOptionsCookies

func (*User) ToCookies

func (u *User) ToCookies() []*http.Cookie

ToCookies *

  • @Description: 获取user的cookie
  • @receiver u
  • @return []*http.Cookie

type WechatUser added in v1.0.37

type WechatUser struct {
	OpenID          string `json:"open_id"`
	Remark          string `json:"remark"`
	Status          int    `json:"status"`
	LastRequestTime int64  `json:"last_request_time"`
}

func FindWechatUser added in v1.0.37

func FindWechatUser(openID string) (*WechatUser, error)

func QueryWechatByCondition added in v1.0.37

func QueryWechatByCondition(condition string) ([]*WechatUser, error)

Jump to

Keyboard shortcuts

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