controllers

package
v0.0.0-...-042b7a9 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthController

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

func NewAuthController

func NewAuthController(authService services.AuthService) AuthController

func (AuthController) Login

func (c AuthController) Login(ctx echo.Context) error

Login godoc

@Summary		Login User
@Description	Login user and get response JWT Token
@Tags			auth
@Accept			application/json
@Produce		application/json
@Param 			data body dto.LoginRequest true "Post"
@Router			/login [post]
@Success		200  {object}  response.Response{data=dto.LoginResponse}  "ok"
@Failure		400  {object}  response.Response{data=[]response.ValidationErrors}  "bad request"

func (AuthController) Register

func (c AuthController) Register(ctx echo.Context) error

Register godoc

@Summary		Register a new User
@Description	register a new user
@Tags			auth
@Accept			application/json
@Produce		application/json
@Param 			data body dto.RegisterRequest true "Post"
@Router			/register [post]
@Success		201  {object}  response.Response{data=dto.RegisterResponse}  "created"
@Failure		400  {object}  response.Response{data=[]response.ValidationErrors}  "bad request"

type BlogController

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

func NewBlogController

func NewBlogController(blogService services.BlogService, blogPolicy policies.BlogPolicy) BlogController

func (BlogController) Create

func (c BlogController) Create(ctx echo.Context) error

Create godoc

@Summary		Create a Post
@Description	Create a Post
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/blog_posts [post]
@Security 		BearerAuth
@Success		201  {object}  response.Response{data=dto.BlogPostCreateResponse}  "created"

func (BlogController) Delete

func (c BlogController) Delete(ctx echo.Context) error

Delete godoc

@Summary		Delete a Post
@Description	Delete a Post
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/blog_posts/{id} [delete]
@Security 		BearerAuth
@Success		204  {object}  response.Response{}  "no content"

func (BlogController) Detail

func (c BlogController) Detail(ctx echo.Context) error

Detail godoc

@Summary		Get detail a post
@Description	Get detail a post
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/blog_posts/{id} [get]
@Success		200  {object}  response.Response{data=dto.BlogPost}  "ok"

func (BlogController) FollowingBlogPostList

func (c BlogController) FollowingBlogPostList(ctx echo.Context) error

FollowingBlogPostList godoc

@Summary		Get Blog Posts by Following
@Description	Get Blog Posts by Following
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/following_blog_posts/ [get]
@Security 		BearerAuth
@Success		200  {object}  response.Response{data=dto.BlogPostPagination}  "ok"

func (BlogController) List

func (c BlogController) List(ctx echo.Context) error

List godoc

@Summary		Get Pagination and Several Posts
@Description	Get Pagination and Several Posts
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/blog_posts [get]
@Success		200  {object}  response.Response{data=dto.BlogPostPagination}  "ok"

func (BlogController) Update

func (c BlogController) Update(ctx echo.Context) error

Update godoc

@Summary		Update a Post
@Description	Update a Post
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/blog_posts/{id} [patch]
@Security 		BearerAuth
@Success		200  {object}  response.Response{data=dto.BlogPostUpdateResponse}  "ok"

type CommentController

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

func NewCommentController

func NewCommentController(commentService services.CommentService, commentPolicy policies.CommentPolicy) CommentController

func (CommentController) Create

func (c CommentController) Create(ctx echo.Context) error

Create godoc

@Summary		Create a Comment
@Description	Create a Comment
@Tags			comment
@Accept			application/json
@Produce		application/json
@Router			/comments [post]
@Security 		BearerAuth
@Success		201  {object}  response.Response{data=dto.CommentCreateResponse}  "created"

func (CommentController) Delete

func (c CommentController) Delete(ctx echo.Context) error

Delete godoc

@Summary		Delete a Comment
@Description	Delete a Comment
@Tags			comment
@Accept			application/json
@Produce		application/json
@Router			/comments/{id} [delete]
@Security 		BearerAuth
@Success		204  {object}  response.Response{}  "no content"

func (CommentController) Detail

func (c CommentController) Detail(ctx echo.Context) error

Detail godoc

@Summary		Get detail a Comment
@Description	Get detail a Comment
@Tags			comment
@Accept			application/json
@Produce		application/json
@Router			/comments/{id} [get]
@Success		200  {object}  response.Response{data=dto.Comment}  "ok"

func (CommentController) List

func (c CommentController) List(ctx echo.Context) error

List godoc

@Summary		Get Pagination and Several Comments
@Description	Get Pagination and Several Comments
@Tags			comment
@Accept			application/json
@Produce		application/json
@Router			/comments [get]
@Success		200  {object}  response.Response{data=dto.CommentPagination}  "ok"

func (CommentController) Update

func (c CommentController) Update(ctx echo.Context) error

Update godoc

@Summary		Update a Comment
@Description	Update a Comment
@Tags			comment
@Accept			application/json
@Produce		application/json
@Router			/comments/{id} [patch]
@Security 		BearerAuth
@Success		200  {object}  response.Response{data=dto.CommentUpdateResponse}  "ok"

type MainController

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

func NewMainController

func NewMainController(redis lib.IRedis) MainController

func (MainController) Index

func (c MainController) Index(ctx echo.Context) error

type UserController

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

func NewUserController

func NewUserController(authService services.AuthService, userService services.UserService, userPolicy policies.UserPolicy) UserController

func (UserController) Detail

func (c UserController) Detail(ctx echo.Context) error

Detail godoc

@Summary		Get Detail User
@Description	Get Detail User
@Tags			user
@Accept			application/json
@Produce		application/json
@Router			/users/{id} [get]
@Success		200  {object}  response.Response{data=dto.User}  "ok"

func (UserController) Follow

func (c UserController) Follow(ctx echo.Context) error

Follow godoc

@Summary		Following User
@Description	Following User
@Tags			user
@Accept			application/json
@Produce		application/json
@Router			/users/{id}/follow [post]
@Security 		BearerAuth
@Success		202  {object}  response.Response{}  "accepted"

func (UserController) List

func (c UserController) List(ctx echo.Context) error

List godoc

@Summary		Get Pagination and Several Users
@Description	Get Pagination and Several Users
@Tags			blog
@Accept			application/json
@Produce		application/json
@Router			/users [get]
@Success		200  {object}  response.Response{data=dto.UserPagination}  "ok"

func (UserController) Me

func (c UserController) Me(ctx echo.Context) error

Me godoc

@Summary		Get data Logged-in user
@Description	Get data Logged-in user
@Tags			user
@Accept			application/json
@Produce		application/json
@Router			/me [get]
@Security 		BearerAuth
@Success		200  {object}  response.Response{data=dto.MeResponse}  "ok"

func (UserController) MePassword

func (c UserController) MePassword(ctx echo.Context) error

MePassword godoc

@Summary		Get data Logged-in user
@Description	Get data Logged-in user
@Tags			user
@Accept			application/json
@Produce		application/json
@Param 			data body dto.MePasswordRequest true "Post"
@Router			/me/password [post]
@Security 		BearerAuth
@Success		200  {object}  response.Response{}  "ok"

func (UserController) MeUpdate

func (c UserController) MeUpdate(ctx echo.Context) error

MeUpdate godoc

@Summary		Update data Logged-in user
@Description	Update data Logged-in user
@Tags			user
@Accept			application/json
@Produce		application/json
@Param 			data body dto.MeUpdateRequest true "Post"
@Router			/me [patch]
@Security 		BearerAuth
@Success		200  {object}  response.Response{data=dto.MeResponse}  "ok"

func (UserController) UnFollow

func (c UserController) UnFollow(ctx echo.Context) error

UnFollow godoc

@Summary		UnFollowing User
@Description	UnFollowing User
@Tags			user
@Accept			application/json
@Produce		application/json
@Router			/users/{id}/unfollow [post]
@Security 		BearerAuth
@Success		202  {object}  response.Response{}  "accepted"

Jump to

Keyboard shortcuts

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