service

package
v0.0.0-...-3cb022a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAbout

func RegisterAbout(i IAbout)

func RegisterBlog

func RegisterBlog(i IBlog)

func RegisterCategory

func RegisterCategory(i ICategory)

func RegisterComment

func RegisterComment(i IComment)

func RegisterContext

func RegisterContext(i IContext)

func RegisterMiddleware

func RegisterMiddleware(i IMiddleware)

func RegisterMoment

func RegisterMoment(i IMoment)

func RegisterSiteSettings

func RegisterSiteSettings(i ISiteSettings)

func RegisterTags

func RegisterTags(i ITags)

func RegisterUser

func RegisterUser(i IUser)

Types

type IAbout

type IAbout interface {
	About(ctx context.Context) (out *model.AboutOutput, err error)
	UpdateAbout(ctx context.Context, in model.AboutOutput) (err error)
}

func About

func About() IAbout

type IBlog

type IBlog interface {
	CreateBlog(ctx context.Context, in model.CreateBlogInput) (err error)
	UpdateBlog(ctx context.Context, in v1.UpdateBlogReq) (err error)
	BlogsList(ctx context.Context, title string, categroyId, page, size int) (out *model.BlogsListOutput, err error)
	BlogDetail(ctx context.Context, id int) (out *model.BlogDetailOutput, err error)
	UpdateBlogTop(ctx context.Context, blogId int, top bool) (err error)
	UpdateBlogRecommend(ctx context.Context, blogId int, recommend bool) (err error)
	UpdateBlogVisibility(ctx context.Context, in model.UpdateBlogVisibilityInput) (err error)
	DeleteBlog(ctx context.Context, blogId int) (err error)
	NbBlogs(ctx context.Context, page int) (out *model.BlogsListOutput, totalPage int, err error)
}

func Blog

func Blog() IBlog

type ICategory

type ICategory interface {
	GetCategoryList(ctx context.Context) (out []*entity.Category, err error)
	ShowCategory(ctx context.Context, page, size int) (out *model.AllCategoryOutput, err error)
	AddCategory(ctx context.Context, name string) (err error)
	UpdateCategory(ctx context.Context, id int, name string) (err error)
	DeleteCategory(ctx context.Context, id int) (err error)
}

func Category

func Category() ICategory

type IComment

type IComment interface {
	Comment(ctx context.Context, in model.CommentInput) (err error)
	CommentList(ctx context.Context) (out *model.CommentListOutput, err error)
}

func Comment

func Comment() IComment

type IContext

type IContext interface {
	Init(r *ghttp.Request, customCtx *model.Context)
	Get(ctx context.Context) *model.Context
	SetToken(ctx context.Context, ctxToken *token.MyCacheToken)
	SetData(ctx context.Context, data g.Map)
}

func Context

func Context() IContext

type IMiddleware

type IMiddleware interface {
	I18NMiddleware(r *ghttp.Request)
	ResponseHandler(r *ghttp.Request)
	MiddlewareCORS(r *ghttp.Request)
	Ctx(r *ghttp.Request)
	TokenAuth(r *ghttp.Request)
}

func Middleware

func Middleware() IMiddleware

type IMoment

type IMoment interface {
	CreateMoment(ctx context.Context, in model.CreateMomentInput) (err error)
	ShowMoments(ctx context.Context, page, size int) (out *model.ShowMomentOutput, err error)
	UpdatePublishedStatus(ctx context.Context, momentId int, isPublished bool) (err error)
	MomoentDetil(ctx context.Context, momentId int) (out *model.MomentDetilOutput, err error)
	UpdateMoment(ctx context.Context, in entity.Moment) (err error)
	DeleteMoment(ctx context.Context, momenId int) (err error)
}

func Moment

func Moment() IMoment

type ISiteSettings

type ISiteSettings interface {
	SiteSettingsDetil(ctx context.Context) (out *model.SiteSettingsDetilOutput, err error)
	UpdateSiteSettings(ctx context.Context, in model.UpdateSiteSettingsInput) (err error)
	Site(ctx context.Context) (out *model.SiteOutput, err error)
	Badges(ctx context.Context) (out []*model.Badges, err error)
	Introduction(ctx context.Context) (out *model.Introduction, err error)
	NewBlogList(ctx context.Context) (out []*model.NewBlogList, err error)
	RandomBlogList(ctx context.Context) (out []*model.RandomBlogList, err error)
	SiteInfo(ctx context.Context) (out *model.SiteInfo, err error)
}

func SiteSettings

func SiteSettings() ISiteSettings

type ITags

type ITags interface {
	GetTagsList(ctx context.Context) (out []*entity.Tag, err error)
	ShowTags(ctx context.Context, page, size int) (out *model.AllTagsOutput, err error)
	AddTags(ctx context.Context, name, color string) (err error)
	UpdateTags(ctx context.Context, id int, name, color string) (err error)
	DeleteTags(ctx context.Context, id int) (err error)
}

func Tags

func Tags() ITags

type IUser

type IUser interface {
	Login(ctx context.Context, username, password string) (out *model.UserLoginOutput, err error)
}

func User

func User() IUser

Jump to

Keyboard shortcuts

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