site

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 18 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 []site.Site
}

type CreateSiteData

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

type SearchData

type SearchData struct {
	Page              int    `json:"page"`               // 第几页
	PageSize          int    `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 {
	List(ctx core.Context) (listData []*site.Site, err error)
	CategoryList(ctx core.Context) (listData []*category.Category, err error)
	PageList(ctx core.Context, searchData *SearchData) (listData []*site.Site, err error)
	PageListCount(ctx core.Context, searchData *SearchData) (total int64, err error)
	UpdateUsed(ctx core.Context, id int32, used site.IsUsedStatus) (err error)
	Delete(ctx core.Context, id int32) (err error)
	Create(ctx core.Context, sitesData []*CreateSiteData) (successCount, failCount int32)
	CategorySite(ctx core.Context) (categorySites []*CategorySite, err error)
	UpdateSite(ctx core.Context, updateSite *UpdateSiteRequest) (err error)
	// contains filtered or unexported methods
}

func New

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

type UpdateSiteRequest

type UpdateSiteRequest struct {
	Id          int32                 `json:"id"`
	CategoryId  int32                 `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