types

package
v0.0.1-Beta01 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package type - NekoBlog backend server types. This file is for avatar file types. Copyright (c) [2024], Author(s): - WhitePaper233<baizhiwp@gmail.com>

Package type - NekoBlog backend server types. This file is for user related types. Copyright (c) [2024], Author(s): - WhitePaper233<baizhiwp@gmail.com>

Package type - NekoBlog backend server types. This file is for token related types. Copyright (c) [2024], Author(s): - WhitePaper233<baizhiwp@gmail.com>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthBody

type AuthBody struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

AuthBody 认证请求体

type BearerTokenClaims

type BearerTokenClaims struct {
	jwt.RegisteredClaims
	UID      uint64 `json:"uid"`
	Username string `json:"username"`
}

BeaerTokenClaims Bearer Token 声明

type ImageFileType

type ImageFileType int

ImageFileType 图像文件类型

const (
	// IMAGE_FILE_TYPE_UNKNOWN 未知头像文件类型
	IMAGE_FILE_TYPE_UNKNOWN ImageFileType = -1

	// IMAGE_FILE_TYPE_WEBP WebP 格式的头像文件
	IMAGE_FILE_TYPE_WEBP ImageFileType = iota

	// IMAGE_FILE_TYPE_JPEG JPEG 格式的头像文件
	IMAGE_FILE_TYPE_JPEG

	// IMAGE_FILE_TYPE_PNG PNG 格式的头像文件
	IMAGE_FILE_TYPE_PNG
)

头像文件类型

type PostCreateBody

type PostCreateBody struct {
	Title   string   `json:"title" form:"title"`     //标题
	Content string   `json:"content" form:"content"` //内容
	Images  []string `json:"images" form:"images"`   // 上传图片的UUID
}

PostCreateBody 创建博文请求体

type UserAuthBody

type UserAuthBody struct {
	Username string `json:"username"` // 用户名
	Password string `json:"password"` // 密码
}

UserAuthBody 认证请求体

type UserCommentCreateBody

type UserCommentCreateBody struct {
	PostID  *uint64 `json:"post_id" form:"post_id"` // 博文ID
	Content string  `json:"content" form:"content"` // 内容
}

CommentCreatebody 创建评论请求体

type UserCommentDeleteBody

type UserCommentDeleteBody struct {
	CommentID *uint64 `json:"comment_id" form:"comment_id"` // 评论ID
}

UserPostInfo 创建博文请求体

type UserCommentUpdateBody

type UserCommentUpdateBody struct {
	CommentID *uint64 `json:"comment_id" form:"comment_id"` // 评论ID
	Content   string  `json:"content" form:"content"`       // 内容
}

UserCommentUpdateBody 更新评论请求体

type UserPostInfo

type UserPostInfo struct {
	UID   uint   `json:"id"`    // 用户ID
	Title string `json:"title"` // 标题

}

UserPostInfo 创建博文请求体

type UserUpdatePasswordBody

type UserUpdatePasswordBody struct {
	UserAuthBody        // 认证请求体
	NewPassword  string `json:"new_password"` // 新密码
}

UserRegisterBody 注册请求体

type UserUpdateProfileBody

type UserUpdateProfileBody struct {
	NickName *string `json:"nickname"` // 昵称
	Birth    *uint64 `json:"birth"`    // 出生日期
	Gender   *string `json:"gender"`   // 性别
}

UserUpdateProfileBody 更新用户资料请求体

Jump to

Keyboard shortcuts

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