common

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(ctx *gin.Context, message string)

func FailAuth

func FailAuth(ctx *gin.Context, message string)

token过期

func FailAuthWs added in v1.3.0

func FailAuthWs(c chan *Response, message string)

token过期

func FailNotFound

func FailNotFound(ctx *gin.Context)

func FailWs added in v1.3.0

func FailWs(c chan *Response, message string)

func Success

func Success(ctx *gin.Context, data interface{})

带data

func SuccessAuth

func SuccessAuth(ctx *gin.Context, token string, data interface{})

func SuccessAuthWs added in v1.3.0

func SuccessAuthWs(c chan *Response, token string)

func SuccessOk

func SuccessOk(ctx *gin.Context, message string)

带msg,不带data

func SuccessWs added in v1.3.0

func SuccessWs(c chan *Response, data interface{})

Types

type DatingInfo added in v1.3.1

type DatingInfo struct {
	Dating DatingSimple `json:"dating"`
	Users  []DatingUser `json:"users"`
}

getDating数据

type DatingList

type DatingList struct {
	Id           uint     `db:"id" json:"id"`
	Status       int8     `db:"status" json:"status"`
	AddTime      int64    `db:"add_time" json:"-"`
	AddTimeStr   string   `json:"add_time"`
	UtId         uint     `db:"ut_id" json:"ut_id"`
	CreateUserId uint     `db:"create_user_id" json:"create_user_id"`
	AvatarUrl    []string `json:"avatar_url"`
}

type DatingPost

type DatingPost struct {
	Id   uint     `json:"id"`
	Info InfoPost `json:"info"`
}

type DatingResult added in v1.2.0

type DatingResult struct {
	Res  bool     `json:"r" info:"匹配是否成功"`
	Date []string `json:"d"`
}

Result的数据

type DatingSimple added in v1.3.1

type DatingSimple struct {
	CreateUserId uint         `json:"create_user_id"`
	Id           uint         `json:"id"`
	Status       int8         `json:"status"`
	Result       DatingResult `json:"result"`
}

type DatingUser

type DatingUser struct {
	UtId         uint           `db:"ut_id" json:"ut_id"`
	Info         string         `db:"info" json:"-"`
	Id           uint           `db:"id" json:"id"`
	NickName     string         `db:"nick_name" json:"nick_name"`
	Path         string         `db:"path" json:"avatar_url"`
	InfoResponse []InfoResponse `json:"info"`
}

func (*DatingUser) InfoUnmarshal

func (d *DatingUser) InfoUnmarshal() *db.UserTimeInfo

json转结构体

type DatingUserAvatar

type DatingUserAvatar struct {
	DatingId uint   `db:"dating_id" json:"dating_id"`
	Path     string `db:"path" json:"path"`
}

type DatingUserJoin

type DatingUserJoin struct {
	UserId       uint `db:"user_id" json:"user_id"`
	DatingId     uint `db:"dating_id" json:"dating_id"`
	CreateUserId uint `db:"create_user_id" json:"create_user_id"`
}

type FeedbackPost

type FeedbackPost struct {
	Desc string `json:"desc"`
}

type GetDatingListPost

type GetDatingListPost struct {
	Page   uint `json:"page"`
	LastId uint `json:"last_id"` //上次获取最后的ut_id
}

type GetDatingPost

type GetDatingPost struct {
	Id uint `json:"id"`
}

type InfoPost

type InfoPost struct {
	Time [][2]string `json:"t"`
}

func (*InfoPost) Marshal

func (i *InfoPost) Marshal() (string, error)

type InfoResponse added in v1.2.0

type InfoResponse struct {
	Tag  string    `json:"tag"`
	Time [2]string `json:"t"`
	Res  uint8     `json:"res"` //结果; 0:不匹配;1:完全匹配;2:部分匹配
}

type JwtInfo

type JwtInfo struct {
	jwt.RegisteredClaims
}

type LoginPost

type LoginPost struct {
	Code string `json:"code"`
}

type QuitDatingPost

type QuitDatingPost struct {
	Id   uint `json:"id"` //优先此值
	UtId uint `json:"ut_id"`
}

type Response

type Response struct {
	Code  int8        `json:"code"`
	Data  interface{} `json:"data"`
	Msg   string      `json:"msg"`
	Token string      `json:"token,omitempty"`
}

type UerTimePost

type UerTimePost struct {
	UtId uint     `json:"ut_id"`
	Info InfoPost `json:"info"`
}

type UserInfo

type UserInfo struct {
	db.User
	AvatarUrl string `json:"avatar_url"`
}

type UserInfoPost

type UserInfoPost struct {
	LoginPost
	NickName string `json:"nick_name"` //昵称

}

Jump to

Keyboard shortcuts

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