ToolsShortURL

package
v5.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteByID

func DeleteByID(args *ArgsDeleteByID) (err error)

DeleteByID 删除ID

func Run

func Run()

Types

type ArgsCreate

type ArgsCreate struct {
	//过期时间
	ExpireAt time.Time `db:"expire_at" json:"expireAt" check:"isoTime"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
	//是否公开
	IsPublic bool `db:"is_public" json:"isPublic" check:"bool"`
	//存储的数据集合
	Data string `db:"data" json:"data"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}

ArgsCreate 建立新的短域名参数

type ArgsDeleteByID

type ArgsDeleteByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	// 可选
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//用户ID
	// 可选
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsDeleteByID 删除ID参数

type ArgsGetByID

type ArgsGetByID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//组织ID
	// 可选
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//用户ID
	// 可选
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsGetByID 查看ID参数

type ArgsGetByKey

type ArgsGetByKey struct {
	//key
	Key string `db:"key" json:"key" check:"mark"`
	//组织ID
	// 可选
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//用户ID
	// 可选
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsGetByKey 查询key参数

type ArgsGetList

type ArgsGetList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsGetList 查看列表参数

type FieldsShortURL

type FieldsShortURL struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//过期时间
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//唯一key
	Key string `db:"key" json:"key"`
	//组织ID
	OrgID int64 `db:"org_id" json:"orgID"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID"`
	//是否公开
	IsPublic bool `db:"is_public" json:"isPublic"`
	//存储的数据集合
	Data string `db:"data" json:"data"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params"`
}

FieldsShortURL 短域名结构

func Create

func Create(args *ArgsCreate) (data FieldsShortURL, err error)

Create 建立新的短域名

func GetByID

func GetByID(args *ArgsGetByID) (data FieldsShortURL, err error)

GetByID 查看ID

func GetByKey

func GetByKey(args *ArgsGetByKey) (data FieldsShortURL, err error)

GetByKey 查询key

func GetList

func GetList(args *ArgsGetList) (dataList []FieldsShortURL, dataCount int64, err error)

GetList 查看列表

Jump to

Keyboard shortcuts

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