web

package
v0.0.0-...-e68aaec Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtId

type ArtId struct {
	Aid int64 `json:"aid,omitempty"`
}

type Article

type Article struct {
	Id       int64  `json:"id,omitempty"`
	Uid      int64  `json:"uid,omitempty"`
	Title    string `json:"title,omitempty" validate:"required"`
	Content  string `json:"content,omitempty"`
	Abstract string `json:"abstract,omitempty"`
	Ctime    string `json:"ctime,omitempty"`
	Author   Author `json:"author,omitempty"`
}

type ArticleHandler

type ArticleHandler struct {

	// 通过组合userService 来实现查询作者?
	UserSvc user.Service
	// contains filtered or unexported fields
}

func NewArticleHandler

func NewArticleHandler(svc service.Service, UserSvc user.Service) *ArticleHandler

func (*ArticleHandler) DelPubDetail

func (h *ArticleHandler) DelPubDetail(ctx *ginx.Context, req ArtId) (ginx.Result, error)

func (*ArticleHandler) Detail

func (h *ArticleHandler) Detail(ctx *ginx.Context,
	req ArtId) (ginx.Result, error)

func (*ArticleHandler) List

func (h *ArticleHandler) List(ctx *ginx.Context,
	req Page, sess session.Session) (ginx.Result, error)

func (*ArticleHandler) PrivateRoutes

func (h *ArticleHandler) PrivateRoutes(server *gin.Engine)

func (*ArticleHandler) PubDetail

func (h *ArticleHandler) PubDetail(ctx *ginx.Context,
	req ArtId) (ginx.Result, error)

func (*ArticleHandler) PubList

func (h *ArticleHandler) PubList(ctx *ginx.Context,
	req Page) (ginx.Result, error)

func (*ArticleHandler) PublicRoutes

func (h *ArticleHandler) PublicRoutes(server *gin.Engine)

func (*ArticleHandler) Publish

func (h *ArticleHandler) Publish(ctx *ginx.Context,
	req SaveReq, sess session.Session) (ginx.Result, error)

func (*ArticleHandler) Save

func (h *ArticleHandler) Save(ctx *ginx.Context,
	req SaveReq, sess session.Session) (ginx.Result, error)

type ArtsList

type ArtsList struct {
	Arts  []Article `json:"arts,omitempty"`
	Total int64     `json:"total,omitempty"`
}

type Author

type Author struct {
	Nickname string `json:"nickname"`
	Avatar   string `json:"avatar"`
}

type Page

type Page struct {
	Offset int `json:"offset,omitempty" binding:"min=0"`
	Limit  int `json:"limit,omitempty" binding:"min=10"`
}

Page 分页

type SaveReq

type SaveReq struct {
	Id      int64  `json:"id,omitempty"`
	Uid     int64  `json:"uid,omitempty"`
	Title   string `json:"title,omitempty" binding:"required"`
	Content string `json:"content,omitempty"`
}

Jump to

Keyboard shortcuts

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