response

package
v0.0.0-...-70261f9 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR   = 504
	SUCCESS = 200
)

Variables

This section is empty.

Functions

func Fail

func Fail(c *gin.Context)

func FailWithDetailed

func FailWithDetailed(c *gin.Context, message string, data interface{})

func FailWithMessage

func FailWithMessage(c *gin.Context, message string)

func Ok

func Ok(c *gin.Context)

func OkWithData

func OkWithData(c *gin.Context, data interface{})

func OkWithDetailed

func OkWithDetailed(c *gin.Context, message string, data interface{})

func OkWithMessage

func OkWithMessage(c *gin.Context, message string)

func Result

func Result(c *gin.Context, code int, msg string, data interface{})

Types

type ApiTree

type ApiTree struct {
	entity.Api
	Children []*ApiTree
}

type ArticleArchivesDTO

type ArticleArchivesDTO struct {
	ID           int       `json:"id"`            // 文章ID
	ArticleCover string    `json:"article_cover"` // 文章缩略图
	ArticleTitle string    `json:"article_title"` // 标题
	CreatedAt    time.Time `json:"created_at"`    // 创建时间
}

ArticleArchivesDTO represents a recommended article

type ArticleConditionDTO

type ArticleConditionDTO struct {
	ArticleDTOList []*ArticleDTO `json:"article_dto_list"` // 文章列表
	ConditionName  string        `json:"condition_name"`   // 条件名
}

type ArticleDTO

type ArticleDTO struct {
	ID             int       `json:"id"`               // 文章ID
	ArticleCover   string    `json:"article_cover"`    // 文章缩略图
	ArticleTitle   string    `json:"article_title"`    // 标题
	ArticleContent string    `json:"article_content"`  // 内容
	LikeCount      int       `json:"like_count"`       // 点赞量
	ViewsCount     int       `json:"views_count"`      // 浏览量
	Type           int       `json:"type"`             // 文章类型
	OriginalURL    string    `json:"original_url"`     // 原文链接
	CreatedAt      time.Time `json:"created_at"`       // 发表时间
	UpdatedAt      time.Time `json:"updated_at"`       // 更新时间
	CategoryID     int       `json:"category_id"`      // 文章分类ID
	CategoryName   string    `json:"category_name"`    // 文章分类名
	ArticleTagList []*TagDTO `json:"article_tag_list"` // 文章标签列表
}

type ArticleDetails

type ArticleDetails struct {
	ID                   int                    `json:"id"`                     // 文章ID
	ArticleCover         string                 `json:"article_cover"`          // 文章缩略图
	ArticleTitle         string                 `json:"article_title"`          // 标题
	ArticleContent       string                 `json:"article_content"`        // 内容
	LikeCount            int                    `json:"like_count"`             // 点赞量
	ViewsCount           int                    `json:"views_count"`            // 浏览量
	Type                 int                    `json:"type"`                   // 文章类型
	OriginalURL          string                 `json:"original_url"`           // 原文链接
	CreatedAt            time.Time              `json:"created_at"`             // 发表时间
	UpdatedAt            time.Time              `json:"updated_at"`             // 更新时间
	CategoryID           int                    `json:"category_id"`            // 文章分类ID
	CategoryName         string                 `json:"category_name"`          // 文章分类名
	ArticleTagList       []*TagDTO              `json:"article_tag_list"`       // 文章标签列表
	LastArticle          *ArticlePaginationDTO  `json:"last_article"`           // 上一篇文章
	NextArticle          *ArticlePaginationDTO  `json:"next_article"`           // 下一篇文章
	RecommendArticleList []*ArticleRecommendDTO `json:"recommend_article_list"` // 推荐文章列表
	NewestArticleList    []*ArticleRecommendDTO `json:"newest_article_list"`    // 最新文章列表
}

ArticleDetails represents an article

type ArticlePaginationDTO

type ArticlePaginationDTO struct {
	// pagination fields...
	ID           int    `json:"id"`            // 文章ID
	ArticleCover string `json:"article_cover"` // 文章缩略图
	ArticleTitle string `json:"article_title"` // 标题
}

ArticlePaginationDTO represents pagination information for an article

type ArticleRecommendDTO

type ArticleRecommendDTO struct {
	// recommended article fields...
	ID           int       `json:"id"`            // 文章ID
	ArticleCover string    `json:"article_cover"` // 文章缩略图
	ArticleTitle string    `json:"article_title"` // 标题
	CreatedAt    time.Time `json:"created_at"`    // 创建时间
}

ArticleRecommendDTO represents a recommended article

type AutoCodeHistory

type AutoCodeHistory struct {
	ID           uint      `json:"ID" gorm:"column:id"`
	CreatedAt    time.Time `json:"CreatedAt" gorm:"column:created_at"`
	UpdatedAt    time.Time `json:"UpdatedAt" gorm:"column:updated_at"`
	BusinessDB   string    `json:"businessDB" gorm:"column:business_db"`
	TableName    string    `json:"tableName" gorm:"column:table_name"`
	StructName   string    `json:"structName" gorm:"column:struct_name"`
	StructCNName string    `json:"structCNName" gorm:"column:struct_cn_name"`
	Flag         int       `json:"flag" gorm:"column:flag"`
}

type Captcha

type Captcha struct {
	ID         string `json:"id"`
	EncodeData string `json:"encode_data"` // 验证码内容,base64编码
	Length     int    `json:"length"`
}

type Category

type Category struct {
	ID           int       `json:"id"`
	CategoryName string    `json:"category_name"` // 分类名
	ArticleCount int64     `json:"article_count"`
	CreatedAt    time.Time `json:"created_at"` // 创建时间
	UpdatedAt    time.Time `json:"updated_at"` // 更新时间
}

type Column

type Column struct {
	ColumnName    string `json:"columnName" gorm:"column:column_name"`       //列名
	ColumnType    string `json:"columnType" gorm:"column:column_type"`       //字段类型 varchar(11)
	ColumnDefault string `json:"columnDefault" gorm:"column:column_default"` //默认值
	ColumnComment string `json:"columnComment" gorm:"column:column_comment"` //备注
	DataType      string `json:"dataType" gorm:"column:data_type"`           //数据类型 varchar
	DataTypeLong  string `json:"dataTypeLong" gorm:"column:data_type_long"`  //数据长度
	IsNullable    string `json:"isNullable" gorm:"column:is_nullable"`       //是否可空
}

type CommentDTO

type CommentDTO struct {
	ID             int         `json:"id"`             // 评论id
	UserID         int         `json:"userId"`         // 用户id
	Nickname       string      `json:"nickname"`       // 用户昵称
	Avatar         string      `json:"avatar"`         // 用户头像
	WebSite        string      `json:"webSite"`        // 个人网站
	CommentContent string      `json:"commentContent"` // 评论内容
	LikeCount      int         `json:"likeCount"`      // 点赞数
	CreatedAt      time.Time   `json:"createdAt"`      // 评论时间
	ReplyCount     int64       `json:"replyCount"`     // 回复量
	ReplyDTOList   []*ReplyDTO `json:"replyDTOList"`   // 回复列表
}

CommentDTO 评论

type Db

type Db struct {
	Database string `json:"database" gorm:"column:database"`
}

type Login

type Login struct {
	Token    string     `json:"token"`
	UserInfo UserDetail `json:"userInfo"`
}

type LoginHistory

type LoginHistory struct {
	LoginType int    // 登录类型
	IpAddress string // ip host
	IpSource  string // ip 源
	LoginTime string // 创建时间
}
type MenuTree struct {
	entity.Menu
	Children []*MenuTree
}

type OauthLoginUrl

type OauthLoginUrl struct {
	Url string `json:"url" example:""` // 授权地址
}

type PageInfo

type PageInfo struct {
	Page     int   `json:"page"`
	PageSize int   `json:"pageSize"`
	Total    int64 `json:"total"`
}

type PageResult

type PageResult struct {
	List     interface{} `json:"list"`
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
	Total    int64       `json:"total"`
}

type ReplyDTO

type ReplyDTO struct {
	ID             int       `json:"id"`             // 评论id
	ParentID       int       `json:"parentId"`       // 父评论id
	UserID         int       `json:"userId"`         // 用户id
	Nickname       string    `json:"nickname"`       // 用户昵称
	Avatar         string    `json:"avatar"`         // 用户头像
	WebSite        string    `json:"webSite"`        // 个人网站
	ReplyUserID    int       `json:"replyUserId"`    // 被回复用户id
	ReplyNickname  string    `json:"replyNickname"`  // 被回复用户昵称
	ReplyWebSite   string    `json:"replyWebSite"`   // 被回复个人网站
	CommentContent string    `json:"commentContent"` // 评论内容
	LikeCount      int       `json:"likeCount"`      // 点赞数
	CreatedAt      time.Time `json:"createdAt"`      // 评论时间
}

ReplyDTO 回复

type Response

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

type RoleInfo

type RoleInfo struct {
	entity.Role
	MenuIdList     []int
	ResourceIdList []int
}

type Table

type Table struct {
	TableName string `json:"tableName" gorm:"column:table_name"`
}

type TagDTO

type TagDTO struct {
	// tag fields...
	ID      int    `json:"id"`       // 标签ID
	TagName string `json:"tag_name"` // 标签名
}

TagDTO represents a tag

type UserDetail

type UserDetail struct {
	ID            int    `json:"id"`
	Username      string `json:"username"`
	Nickname      string `json:"nickname"`
	Avatar        string `json:"avatar"`
	Intro         string `json:"intro"`
	Email         string `json:"email"`
	Status        int    `json:"status"`
	LoginType     int    `json:"login_type"`
	IpAddress     string `json:"ip_address"`
	IpSource      string `json:"ip_source"`
	CreatedAt     string `json:"created_at"`
	LastLoginTime string `json:"last_login_time"`

	Roles []*entity.Role
}

type UserInfo

type UserInfo struct {
	ID            int    `json:"id"`
	UUID          string `json:"user_id"`
	Username      string `json:"username"`
	Nickname      string `json:"nickname"`
	Avatar        string `json:"avatar"`
	Intro         string `json:"intro"`
	Email         string `json:"email"`
	LoginType     int    `json:"loginType"`
	IpAddress     string `json:"ip_address"`
	IpSource      string `json:"ip_source"`
	LastLoginTime string `json:"last_login_time"`

	Roles []*entity.Role
}

type UserMenu

type UserMenu struct {
	Id        int
	Name      string
	Path      string
	Component string
	Icon      string
	Rank      int
	IsHidden  bool
	Children  []UserMenu
}

Jump to

Keyboard shortcuts

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