model

package
v0.0.0-...-691314a Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateIndex

func CreateIndex() error

func CreateLinkTrace

func CreateLinkTrace(lt *LinkTrace) error

func GetLinkBySc

func GetLinkBySc(sc string) (link string, err error)

Types

type Link struct {
	field.DefaultField `bson:",inline"`

	Sc        string `bson:"sc" json:"sc"`                 // 短链代码
	Status    string `bson:"status" json:"status"`         // 短链状态
	OriginURL string `bson:"origin_url" json:"origin_url"` // 原始链接
	Exp       uint32 `bson:"exp" json:"exp"`               // 过期时间
}
func CreateLink(sc string, originalURL string, exp uint32) (*Link, error)

func GetLinkDetailBySc

func GetLinkDetailBySc(sc string) (l *Link, err error)
func GetLinkList(page, pageSize int64) (list []*Link, err error)

type LinkTrace

type LinkTrace struct {
	field.DefaultField `bson:",inline"`

	Sc     string `bson:"sc"`
	URL    string `bson:"url"`
	Ip     string `bson:"ip"`
	UA     string `bson:"ua"`
	Cookie string `bson:"cookie"`
}

func GetLinkTraceList

func GetLinkTraceList(page, pageSize int64) (lt []*LinkTrace, err error)

func GetLinkTraceListBySc

func GetLinkTraceListBySc(sc string, page, pageSize int64) (lt []*LinkTrace, err error)

Jump to

Keyboard shortcuts

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