site

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategorySite

type CategorySite struct {
	Category string
	SiteList []model.Site
}

type CreateSiteData

type CreateSiteData struct {
	CategoryId int64  `json:"category_id"`
	Url        string `json:"Url" validate:"url, http_url"`
}

type SearchData

type SearchData struct {
	Page              int64  `json:"page"`               // 第几页
	PageSize          int64  `json:"page_size"`          // 每页显示条数
	BusinessKey       string `json:"business_key"`       // 调用方key
	BusinessSecret    string `json:"business_secret"`    // 调用方secret
	BusinessDeveloper string `json:"business_developer"` // 调用方对接人
	Remark            string `json:"remark"`             // 备注
	Search            string `json:"search"`             // 搜索关键字
}

type Service

type Service interface {
	CategoryList(ctx core.Context) (categories []*model.Category, err error)
	PageList(ctx core.Context, searchData *SearchData) (sites []*model.Site, err error)
	PageListCount(ctx core.Context, searchData *SearchData) (total int64, err error)
	UpdateUsed(ctx core.Context, id, used int64) (err error)
	Delete(ctx core.Context, id int64) (err error)
	Create(ctx core.Context, sitesData []*CreateSiteData) (successCount, failCount int64)
	CategorySite(ctx core.Context) (categorySites []*CategorySite, err error)
	UpdateSite(ctx core.Context, updateSite *UpdateSiteRequest) (err error)
	Sync(ctx core.Context, id int64) (err error)
	// contains filtered or unexported methods
}

func New

func New(db mysql.Repo, cache redis.Repo) Service

type UpdateSiteRequest

type UpdateSiteRequest struct {
	Id          int64                 `json:"id"`
	CategoryId  int64                 `json:"category_id"` // 网站分类id
	Title       string                `json:"title"`       // 网站标题
	Thumb       string                `json:"thumb"`       // 网站 logo
	Description string                `json:"description"` // 网站描述
	Url         string                `json:"url"`         // 网站地址
	File        *multipart.FileHeader `json:"file"`        // 上传 logo 图片
}

Jump to

Keyboard shortcuts

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