blog

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogController

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

func (*BlogController) CreateBlogPost

func (bc *BlogController) CreateBlogPost(c *gin.Context)

CreateBlogPost godoc

@Summary		Creates a blog post
@Description	Creates a blog post
@Tags			blog
@Accept			json
@Produce		json
@Param			{object}	body		CreateBlogPostRequest	true	"Create blog post request"
@Success		200			{object}	BlogPostResponse
@Success		200			{object}	BlogPostPublicResponse
@Failure		500			{string}	string
@Failure		403			{string}	string
@Failure		400			{string}	string
@Router			/api/v1/blog/post/create [post]

func (*BlogController) GetBlogPost

func (bc *BlogController) GetBlogPost(c *gin.Context)

GetBlogPost godoc

@Summary		Gets a blog post
@Description	Gets a blog post
@Tags			blog
@Accept			json
@Produce		json
@Param			{object}	body		GetBlogPostRequest	true	"Get blog post request"
@Success		200			{object}	BlogPostResponse
@Success		200			{object}	BlogPostPublicResponse
@Failure		500			{string}	string
@Failure		403			{string}	string
@Failure		400			{string}	string
@Router			/api/v1/blog/post [post]

func (*BlogController) GetBlogPostList

func (bc *BlogController) GetBlogPostList(c *gin.Context)

GetBlogPostList godoc

@Summary		Gets a list of blog post
@Description	Gets a list of blog post
@Tags			blog
@Accept			json
@Produce		json
@Param			{object}	body		GetBlogPostListRequest	true	"Get blog post list request"
@Success		200			{object}	[]BlogPostResponse
@Success		200			{object}	[]BlogPostPublicResponse
@Failure		500			{string}	string
@Failure		403			{string}	string
@Failure		400			{string}	string
@Router			/api/v1/blog/post/list [post]

func (*BlogController) RemoveBlogPost

func (bc *BlogController) RemoveBlogPost(c *gin.Context)

RemoveBlogPost godoc

@Summary		Removess a blog post
@Description	Removes a blog post
@Tags			blog
@Accept			json
@Produce		json
@Param			{object}	body		RemoveBlogPostRequest	true	"Remove blog post list request"
@Success		200			{string}	string
@Failure		500			{string}	string
@Failure		403			{string}	string
@Failure		400			{string}	string
@Router			/api/v1/blog/post [delete]

func (*BlogController) UpdateBlogPost

func (bc *BlogController) UpdateBlogPost(c *gin.Context)

UpdateBlogPost godoc

@Summary		Updates a blog post
@Description	Updates a blog post
@Tags			blog
@Accept			json
@Produce		json
@Param			{object}	body		GetBlogPostListRequest	true	"Update blog post list request"
@Success		200			{object}	BlogPostResponse
@Success		200			{object}	BlogPostPublicResponse
@Failure		500			{string}	string
@Failure		403			{string}	string
@Failure		400			{string}	string
@Router			/api/v1/blog/post [put]

type BlogPost

type BlogPost struct {
	Id primitive.ObjectID `bson:"_id"`
	ID uint
	mr.MongoDbDatbaseObject
	myr.MysqlDatabaseObject
	pr.PosgresDatabaseObject
	Title      string
	Content    string
	IsDraft    bool
	IsFeatured bool
}

type BlogPostPublicResponse

type BlogPostPublicResponse struct {
	response.BaseWebResponse
	MongoDbId  string
	MysqlId    uint
	PostgresId uint
	Title      string
	Content    string
}

type BlogPostResponse

type BlogPostResponse struct {
	response.BaseWebResponse
	MongoDbId  string
	MysqlId    uint
	PostgresId uint
	Title      string
	Content    string
	IsDraft    bool
	IsFeatured bool
}

type CreateBlogPostRequest

type CreateBlogPostRequest struct {
	request.BaseWebRequest
	Title      string `binding:"required"` // Required
	Content    string `binding:"required"` // Required
	IsDraft    bool   `binding:"required"` // Required
	IsFeatured bool   `binding:"required"` // Required
}

type GetBlogPostListRequest

type GetBlogPostListRequest struct {
	request.BaseWebRequest
	MongoDbId  string
	MysqlId    uint
	PostgresId uint
	Content    string // Name is also some kind of content, therefore used as for text search=
	IsDraft    bool
	IsFeatured bool
}

type GetBlogPostRequest

type GetBlogPostRequest struct {
	request.BaseWebRequest
	MongoDbId  string
	MysqlId    uint
	PostgresId uint
	Content    string // Name is also some kind of content, therefore used as for text search
	IsDraft    bool   `binding:"required"` // Required
	IsFeatured bool   `binding:"required"` // Required
}

type IBlogController

type IBlogController interface {
	CreateBlogPost(c *gin.Context)
	GetBlogPost(c *gin.Context)
	GetBlogPostList(c *gin.Context)
	UpdateBlogPost(c *gin.Context)
	RemoveBlogPost(c *gin.Context)
}

type RemoveBlogPostRequest

type RemoveBlogPostRequest struct {
	request.BaseWebRequest
	MongoDbId  string `binding:"required"`
	MysqlId    uint   `binding:"required"`
	PostgresId uint   `binding:"required"`
}

type UpdateBlogPostRequest

type UpdateBlogPostRequest struct {
	request.BaseWebRequest
	MongoDbId  string `binding:"required"` // Required
	MysqlId    uint   `binding:"required"` // Required
	PostgresId uint   `binding:"required"` // Required
	Title      string
	Content    string
	IsDraft    bool `binding:"required"` // Required
	IsFeatured bool `binding:"required"` // Required
}

Jump to

Keyboard shortcuts

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