web

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteErrno

func WriteErrno(ctx *gin.Context, err *errno.Errno)

func WriteError

func WriteError(ctx *gin.Context, code int, message string)

func WriteResponse

func WriteResponse(ctx *gin.Context, code int, message string, data interface{})

func WriteSuccess

func WriteSuccess(ctx *gin.Context, data interface{})

Types

type ArticleEditReq

type ArticleEditReq struct {
	ID      int64  `json:"id"`
	Title   string `json:"title" binding:"required"`
	Content string `json:"content" binding:"required"`
}

type ArticleHandler

type ArticleHandler struct {
	// contains filtered or unexported fields
}

func (*ArticleHandler) Collect

func (h *ArticleHandler) Collect(ctx *gin.Context)

func (*ArticleHandler) Detail

func (h *ArticleHandler) Detail(ctx *gin.Context)

func (*ArticleHandler) Edit

func (h *ArticleHandler) Edit(ctx *gin.Context)

func (*ArticleHandler) History

func (h *ArticleHandler) History(ctx *gin.Context)

func (*ArticleHandler) Like

func (h *ArticleHandler) Like(ctx *gin.Context)

func (*ArticleHandler) List

func (h *ArticleHandler) List(ctx *gin.Context)

func (*ArticleHandler) PubDetail

func (h *ArticleHandler) PubDetail(ctx *gin.Context)

func (*ArticleHandler) Publish

func (h *ArticleHandler) Publish(ctx *gin.Context)

func (*ArticleHandler) RegisterRoutes

func (h *ArticleHandler) RegisterRoutes(g *gin.Engine)

func (*ArticleHandler) Withdraw

func (h *ArticleHandler) Withdraw(ctx *gin.Context)

type ListResp

type ListResp[T any] struct {
	Datas []T `json:"datas"`
	Total int `json:"total"`
}

type Page

type Page struct {
	Page     int64 `json:"page" binding:"omitempty,gt=0"`
	PageSize int64 `json:"pageSize" binding:"omitempty,gt=0"`
}

func (*Page) SetDefault

func (p *Page) SetDefault()

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type UserHandler

type UserHandler struct {
	// contains filtered or unexported fields
}

func NewUserHandler

func NewUserHandler(svc service.UserService, codeSvc service.CodeService, jwt ginxjwt.JWT) *UserHandler

func (*UserHandler) Edit

func (h *UserHandler) Edit(ctx *gin.Context)

func (*UserHandler) List

func (h *UserHandler) List(ctx *gin.Context)

func (*UserHandler) Login

func (h *UserHandler) Login(ctx *gin.Context)

func (*UserHandler) LoginSMS

func (h *UserHandler) LoginSMS(ctx *gin.Context)

func (*UserHandler) Logout

func (h *UserHandler) Logout(ctx *gin.Context)

func (*UserHandler) Profile

func (h *UserHandler) Profile(ctx *gin.Context)

func (*UserHandler) RefreshToken

func (h *UserHandler) RefreshToken(ctx *gin.Context)

func (*UserHandler) RegisterRoutes

func (h *UserHandler) RegisterRoutes(server *gin.Engine)

func (*UserHandler) SendCode

func (h *UserHandler) SendCode(ctx *gin.Context)

func (*UserHandler) Signup

func (h *UserHandler) Signup(ctx *gin.Context)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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