Back to godoc.org

Package controller

v0.0.0-...-a196813
Latest Go to latest

The highest tagged major version is .

Published: Apr 11, 2020 | License: MIT | Module: github.com/aguncn/nezha

Index

func GetPage

func GetPage(c *gin.Context) (page, pagesize uint)

GetPage 获取每页数量

func RespData

func RespData(c *gin.Context, httpCode, code int, data interface{})

RespData 数据返回

func RespFail

func RespFail(c *gin.Context, httpCode, code int, detail string)

RespFail 返回操作失败

func RespJSON

func RespJSON(c *gin.Context, httpCode int, resp interface{})

RespJSON 返回JSON数据

func RespOk

func RespOk(c *gin.Context, httpCode, code int)

RespOk 返回操作成功

type Application

type Application struct {
	Log     logger.ILogger              `inject:""`
	Service service.IApplicationService `inject:""`
}

Application 注入IApplicationService

func (*Application) AddApplication

func (a *Application) AddApplication(c *gin.Context)

AddApplication 新增Application

func (*Application) GetApplication

func (a *Application) GetApplication(c *gin.Context)

GetApplication 获取单个Application

func (*Application) GetApplications

func (a *Application) GetApplications(c *gin.Context)

GetApplications 获取Applications信息

type Article

type Article struct {
	Log     logger.ILogger          `inject:""`
	Service service.IArticleService `inject:""`
}

Article 注入IArticleService

func (*Article) AddArticle

func (a *Article) AddArticle(c *gin.Context)

AddArticle 新增文章

func (*Article) GetArticle

func (a *Article) GetArticle(c *gin.Context)

GetArticle 获取单个文章

func (*Article) GetArticles

func (a *Article) GetArticles(c *gin.Context)

GetArticles 获取文章信息

func (*Article) GetTables

func (a *Article) GetTables(c *gin.Context)

GetTables 获取多个文章

type ResponseData

type ResponseData struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

ResponseData 数据返回结构体

type ResponseFail

type ResponseFail struct {
	Code   int    `json:"code"`
	Msg    string `json:"msg"`
	Detail string `json:"detail"`
}

ResponseFail 返回成功结构体

type ResponseSuccess

type ResponseSuccess struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

ResponseSuccess 返回成功结构体

type User

type User struct {
	Log     logger.ILogger       `inject:""`
	Service service.IUserService `inject:""`
}

User 注入IUserService

func (*User) AddUser

func (a *User) AddUser(c *gin.Context)

AddUser 新建用户

func (*User) DeleteUser

func (a *User) DeleteUser(c *gin.Context)

DeleteUser 删除用户

func (*User) GetUserInfo

func (a *User) GetUserInfo(c *gin.Context)

GetUserInfo 根据token获取用户信息

func (*User) GetUsers

func (a *User) GetUsers(c *gin.Context)

GetUsers 获取用户信息

func (*User) Logout

func (a *User) Logout(c *gin.Context)

Logout 退出登录

func (*User) RegisterUser

func (a *User) RegisterUser(c *gin.Context)

RegisterUser 注册用户

func (*User) UpdateUser

func (a *User) UpdateUser(c *gin.Context)

UpdateUser 修改用户

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier