entity

package
v0.0.0-...-b696ed4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	ID          string   `json:"id" form:"id"`
	Title       string   `json:"title" form:"title"`
	Slug        string   `json:"slug" form:"slug"`
	HTMLContent string   `json:"html_content" form:"html_content"`
	CategoryIDs []int    `json:"category_id" form:"category_id"`
	Metadata    Metadata `json:"metadata" form:"metadata"`
	CreatedAt   string   `json:"created_at" form:"created_at"`
	UpdatedAt   string   `json:"updated_at" form:"updated_at"`
}

type ArticleResponse

type ArticleResponse struct {
	ID           string             `json:"id"`
	Title        string             `json:"title"`
	Slug         string             `json:"slug"`
	HTMLContent  string             `json:"html_content"`
	Metadata     string             `json:"metadata"`
	CreatedAt    string             `json:"created_at"`
	UpdatedAt    string             `json:"updated_at"`
	CategoryList []CategoryResponse `json:"categories"`
}

type Category

type Category struct {
	ID        int    `json:"id" form:"id" param:"id"`
	Title     string `json:"title" form:"title"`
	Slug      string `json:"slug" form:"slug"`
	CreatedAt string `json:"created_at" form:"created_at"`
	UpdatedAt string `json:"updated_at" form:"updated_at"`
}

type CategoryResponse

type CategoryResponse struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	Slug  string `json:"slug"`
}

type DeleteArticleRequest

type DeleteArticleRequest struct {
	ID string `json:"id" form:"id" param:"id" validate:"required"`
}

type DeleteCategoryRequest

type DeleteCategoryRequest struct {
	ID int `json:"id" form:"id" param:"id" validate:"required"`
}

type GetArticleDetailsRequest

type GetArticleDetailsRequest struct {
	ID string `json:"id" form:"id" param:"id" validate:"required"`
}

type GetArticlesRequest

type GetArticlesRequest struct {
	Limit       int    `param:"limit" json:"limit" form:"limit"`
	Offset      int    `param:"offset" json:"offset" form:"offset"`
	SortBy      string `param:"sort_by" json:"sort_by" form:"sort_by"`
	OrderBy     string `param:"order_by" json:"order_by" form:"order_by"`
	OrderByBool bool
}

type GetCategoriesRequest

type GetCategoriesRequest struct {
	Limit  int `json:"limit" form:"limit"`
	Offset int `json:"offset" form:"offset"`
}

type GetCategoryDetailsRequest

type GetCategoryDetailsRequest struct {
	ID int `json:"id" form:"id" param:"id" validate:"required"`
}

type GetUserReq

type GetUserReq struct {
	Phone    string `json:"phone"`
	Password string `json:"password"`
}

type InsertArticleRequest

type InsertArticleRequest struct {
	ID          string `json:"id" form:"id"`
	Title       string `json:"title" form:"title" validate:"required"`
	Slug        string `json:"slug" form:"slug" validate:"required"`
	HTMLContent string `json:"htmlcontent" form:"html_content" validate:"required"`
	CategoryIDs []int  `json:"category_id" form:"category_id" validate:"required"`
	Metadata    string `json:"metadata" form:"metadata" validate:"required"`
	CreatedAt   string `json:"created_at" form:"created_at"`
	UpdatedAt   string `json:"updated_at" form:"updated_at"`
}

type InsertCategoryRequest

type InsertCategoryRequest struct {
	ID        int    `json:"id" form:"id" param:"id"`
	Title     string `json:"title" form:"title" validate:"required"`
	Slug      string `json:"slug" form:"slug" validate:"required"`
	CreatedAt string `json:"created_at" form:"created_at"`
	UpdatedAt string `json:"updated_at" form:"updated_at"`
}

type Metadata

type Metadata struct {
	Title       string   `json:"meta_title"`
	Description string   `json:"meta_description"`
	Author      string   `json:"meta_author"`
	Keywords    []string `json:"meta_keywords"`
	Robots      []string `json:"meta_robots"`
}

type UpdateArticleRequest

type UpdateArticleRequest struct {
	ID          string `json:"id" form:"id"`
	Title       string `json:"title" form:"title"`
	Slug        string `json:"slug" form:"slug"`
	HTMLContent string `json:"htmlcontent" form:"html_content"`
	CategoryIDs []int  `json:"category_id" form:"category_id"`
	Metadata    string `json:"metadata" form:"metadata"`
	CreatedAt   string `json:"created_at" form:"created_at"`
	UpdatedAt   string `json:"updated_at" form:"updated_at"`
}

type UpdateCategoryRequest

type UpdateCategoryRequest struct {
	ID        int    `json:"id" form:"id" param:"id"`
	Title     string `json:"title" form:"title"`
	Slug      string `json:"slug" form:"slug"`
	CreatedAt string `json:"created_at" form:"created_at"`
	UpdatedAt string `json:"updated_at" form:"updated_at"`
}

type User

type User struct {
	Phone    string `json:"phone"`
	Name     string `json:"name"`
	Role     string `json:"role"`
	Password string `json:"password"`
}

type UserClaims

type UserClaims struct {
	Name      string               `json:"name"`
	Phone     string               `json:"phone"`
	Role      string               `json:"role"`
	ExpiredAt time.Time            `json:"expired_at"`
	Claims    jwt.RegisteredClaims `json:"claims"`
}

type UserClaimsResponse

type UserClaimsResponse struct {
	Name      string    `json:"name"`
	Phone     string    `json:"phone"`
	Role      string    `json:"role"`
	ExpiredAt time.Time `json:"expired_at"`
}

type UserJWT

type UserJWT struct {
	Phone string `json:"phone"`
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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