website

package
v0.0.0-...-23bce59 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *gin.Context)

Create

func Delete

func Delete(c *gin.Context)

Delete

func GetWebsite

func GetWebsite(c *gin.Context)

获取单个网站,对外提供

func Update

func Update(c *gin.Context)

Update

func WebsiteList

func WebsiteList(c *gin.Context)

WebsiteList列表

Types

type Website

type Website struct {
	ID          primitive.ObjectID `json:"_id" bson:"_id,omitempty"`                 //bson是用来创建后返回,omitempty是可选
	UserID      primitive.ObjectID `json:"user_id" bson:"user_id,omitempty"`         //用户id
	Name        string             `json:"name" bson:"name,omitempty"`               //网站名 TDK title
	Description string             `json:"description" bson:"description,omitempty"` //描述 TDK description
	Keywords    string             `json:"keywords" bson:"keywords,omitempty"`       //关键字 TDK keywords
	Icon        string             `json:"icon" bson:"icon,omitempty"`               //图标
	Category    string             `json:"category" bson:"category,omitempty"`       //网站分类
	Status      int                `json:"status" bson:"status,omitempty"`           //状态
	CreatedAt   time.Time          `json:"created_at" bson:"created_at,omitempty"`
	UpdatedAt   time.Time          `json:"updated_at" bson:"updated_at,omitempty"`
}

type WebsiteService

type WebsiteService interface {
	GetWebsiteList(offset, limit int64, search Website) (website []Website, count int64, err error)
	GetWebsite(name, url string) (website Website, pageData page.Page, err error)
	CreateWebsite(website *Website) (err error)
	UpdateWebsite(website *Website) (err error)
	DeleteWebsite(userID primitive.ObjectID, websiteID primitive.ObjectID) (err error)
}

func NewService

func NewService(mongo *mongo.Database) WebsiteService

Jump to

Keyboard shortcuts

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