feat: update articles and swagger
This commit is contained in:
parent
17b32d68f4
commit
9fd0caa93a
|
|
@ -3,24 +3,24 @@ package entity
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type Articles struct {
|
type Articles struct {
|
||||||
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
||||||
Title string `json:"title" gorm:"type:varchar"`
|
Title string `json:"title" gorm:"type:varchar"`
|
||||||
Slug string `json:"slug" gorm:"type:varchar"`
|
Slug string `json:"slug" gorm:"type:varchar"`
|
||||||
Description string `json:"description" gorm:"type:varchar"`
|
Description string `json:"description" gorm:"type:varchar"`
|
||||||
HtmlDescription string `json:"html_description" gorm:"type:varchar"`
|
HtmlDescription string `json:"html_description" gorm:"type:varchar"`
|
||||||
TypeId int `json:"type_id" gorm:"type:int4"`
|
TypeId int `json:"type_id" gorm:"type:int4"`
|
||||||
Tags string `json:"tags" gorm:"type:varchar"`
|
Tags string `json:"tags" gorm:"type:varchar"`
|
||||||
ThumbnailPath string `json:"thumbnail_path" gorm:"type:varchar"`
|
ThumbnailPath *string `json:"thumbnail_path" gorm:"type:varchar"`
|
||||||
ThumbnailUrl string `json:"thumbnail_url" gorm:"type:varchar"`
|
ThumbnailUrl *string `json:"thumbnail_url" gorm:"type:varchar"`
|
||||||
PageUrl string `json:"page_url" gorm:"type:varchar"`
|
PageUrl *string `json:"page_url" gorm:"type:varchar"`
|
||||||
CreatedById int `json:"created_by_id" gorm:"type:int4"`
|
CreatedById *int `json:"created_by_id" gorm:"type:int4"`
|
||||||
ShareCount int `json:"share_count" gorm:"type:int4"`
|
ShareCount *int `json:"share_count" gorm:"type:int4"`
|
||||||
ViewCount int `json:"view_count" gorm:"type:int4"`
|
ViewCount *int `json:"view_count" gorm:"type:int4"`
|
||||||
DownloadCount int `json:"download_count" gorm:"type:int4"`
|
DownloadCount *int `json:"download_count" gorm:"type:int4"`
|
||||||
StatusId int `json:"status_id" gorm:"type:int4"`
|
StatusId *int `json:"status_id" gorm:"type:int4"`
|
||||||
IsPublish bool `json:"is_publish" gorm:"type:bool"`
|
IsPublish *bool `json:"is_publish" gorm:"type:bool"`
|
||||||
PublishedAt time.Time `json:"published_at" gorm:"type:timestamp"`
|
PublishedAt *time.Time `json:"published_at" gorm:"type:timestamp"`
|
||||||
IsActive bool `json:"is_active" gorm:"type:bool"`
|
IsActive *bool `json:"is_active" gorm:"type:bool"`
|
||||||
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
||||||
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
||||||
}
|
}
|
||||||
|
|
@ -29,11 +29,12 @@ func NewArticlesController(articlesService service.ArticlesService) ArticlesCont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All get all Articles
|
// All Articles
|
||||||
// @Summary Get all Articles
|
// @Summary Get all Articles
|
||||||
// @Description API for getting all Articles
|
// @Description API for getting all Articles
|
||||||
// @Tags Task
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
|
// @Param req query request.ArticlesQueryRequest false "query parameters"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 401 {object} response.Response
|
// @Failure 401 {object} response.Response
|
||||||
// @Failure 404 {object} response.Response
|
// @Failure 404 {object} response.Response
|
||||||
|
|
@ -55,16 +56,17 @@ func (_i *articlesController) All(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Articles list successfully retrieved"},
|
Messages: utilRes.Messages{"Articles list successfully retrieved"},
|
||||||
Data: articlesData,
|
Data: articlesData,
|
||||||
Meta: paging,
|
Meta: paging,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show get one Articles
|
// Show Articles
|
||||||
// @Summary Get one Articles
|
// @Summary Get one Articles
|
||||||
// @Description API for getting one Articles
|
// @Description API for getting one Articles
|
||||||
// @Tags Task
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
// @Param id path int true "Articles ID"
|
// @Param id path int true "Articles ID"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
|
|
@ -85,17 +87,18 @@ func (_i *articlesController) Show(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Articles successfully retrieved"},
|
Messages: utilRes.Messages{"Articles successfully retrieved"},
|
||||||
Data: articlesData,
|
Data: articlesData,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save create Articles
|
// Save Articles
|
||||||
// @Summary Create Articles
|
// @Summary Create Articles
|
||||||
// @Description API for create Articles
|
// @Description API for create Articles
|
||||||
// @Tags Task
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
// @Body request.ArticlesCreateRequest
|
// @Param payload body request.ArticlesCreateRequest true "Required payload"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 401 {object} response.Response
|
// @Failure 401 {object} response.Response
|
||||||
// @Failure 404 {object} response.Response
|
// @Failure 404 {object} response.Response
|
||||||
|
|
@ -114,16 +117,17 @@ func (_i *articlesController) Save(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Articles successfully created"},
|
Messages: utilRes.Messages{"Articles successfully created"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update update Articles
|
// Update Articles
|
||||||
// @Summary update Articles
|
// @Summary update Articles
|
||||||
// @Description API for update Articles
|
// @Description API for update Articles
|
||||||
// @Tags Task
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
// @Body request.ArticlesUpdateRequest
|
// @Param payload body request.ArticlesUpdateRequest true "Required payload"
|
||||||
// @Param id path int true "Articles ID"
|
// @Param id path int true "Articles ID"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 401 {object} response.Response
|
// @Failure 401 {object} response.Response
|
||||||
|
|
@ -148,14 +152,15 @@ func (_i *articlesController) Update(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Articles successfully updated"},
|
Messages: utilRes.Messages{"Articles successfully updated"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete delete Articles
|
// Delete Articles
|
||||||
// @Summary delete Articles
|
// @Summary delete Articles
|
||||||
// @Description API for delete Articles
|
// @Description API for delete Articles
|
||||||
// @Tags Task
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
// @Param id path int true "Articles ID"
|
// @Param id path int true "Articles ID"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
|
|
@ -176,6 +181,7 @@ func (_i *articlesController) Delete(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Articles successfully deleted"},
|
Messages: utilRes.Messages{"Articles successfully deleted"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,17 @@
|
||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/rs/zerolog"
|
||||||
"go-humas-be/app/database"
|
"go-humas-be/app/database"
|
||||||
"go-humas-be/app/database/entity"
|
"go-humas-be/app/database/entity"
|
||||||
"go-humas-be/app/module/articles/request"
|
"go-humas-be/app/module/articles/request"
|
||||||
"go-humas-be/utils/paginator"
|
"go-humas-be/utils/paginator"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type articlesRepository struct {
|
type articlesRepository struct {
|
||||||
DB *database.Database
|
DB *database.Database
|
||||||
|
Log zerolog.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
// ArticlesRepository define interface of IArticlesRepository
|
// ArticlesRepository define interface of IArticlesRepository
|
||||||
|
|
@ -20,9 +23,10 @@ type ArticlesRepository interface {
|
||||||
Delete(id uint) (err error)
|
Delete(id uint) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewArticlesRepository(db *database.Database) ArticlesRepository {
|
func NewArticlesRepository(db *database.Database, log zerolog.Logger) ArticlesRepository {
|
||||||
return &articlesRepository{
|
return &articlesRepository{
|
||||||
DB: db,
|
DB: db,
|
||||||
|
Log: log,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,6 +35,32 @@ func (_i *articlesRepository) GetAll(req request.ArticlesQueryRequest) (articles
|
||||||
var count int64
|
var count int64
|
||||||
|
|
||||||
query := _i.DB.DB.Model(&entity.Articles{})
|
query := _i.DB.DB.Model(&entity.Articles{})
|
||||||
|
query = query.Where("is_active = ?", true)
|
||||||
|
|
||||||
|
if req.Title != nil && *req.Title != "" {
|
||||||
|
title := strings.ToLower(*req.Title)
|
||||||
|
query = query.Where("LOWER(title) LIKE ?", "%"+strings.ToLower(title)+"%")
|
||||||
|
}
|
||||||
|
if req.Description != nil && *req.Description != "" {
|
||||||
|
description := strings.ToLower(*req.Description)
|
||||||
|
query = query.Where("LOWER(description) LIKE ?", "%"+strings.ToLower(description)+"%")
|
||||||
|
}
|
||||||
|
if req.TypeId != nil {
|
||||||
|
query = query.Where("type_id = ?", req.TypeId)
|
||||||
|
}
|
||||||
|
if req.Tags != nil && *req.Tags != "" {
|
||||||
|
tags := strings.ToLower(*req.Tags)
|
||||||
|
query = query.Where("LOWER(tags) LIKE ?", "%"+strings.ToLower(tags)+"%")
|
||||||
|
}
|
||||||
|
if req.TypeId != nil {
|
||||||
|
query = query.Where("type_id = ?", req.TypeId)
|
||||||
|
}
|
||||||
|
if req.IsPublish != nil {
|
||||||
|
query = query.Where("is_publish = ?", req.IsPublish)
|
||||||
|
}
|
||||||
|
if req.StatusId != nil {
|
||||||
|
query = query.Where("status_id = ?", req.StatusId)
|
||||||
|
}
|
||||||
query.Count(&count)
|
query.Count(&count)
|
||||||
|
|
||||||
req.Pagination.Count = count
|
req.Pagination.Count = count
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package request
|
||||||
import (
|
import (
|
||||||
"go-humas-be/app/database/entity"
|
"go-humas-be/app/database/entity"
|
||||||
"go-humas-be/utils/paginator"
|
"go-humas-be/utils/paginator"
|
||||||
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -11,44 +12,30 @@ type ArticlesGeneric interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArticlesQueryRequest struct {
|
type ArticlesQueryRequest struct {
|
||||||
Title string `json:"title" validate:"required"`
|
Title *string `json:"title"`
|
||||||
Slug string `json:"slug" validate:"required"`
|
Description *string `json:"description"`
|
||||||
Description string `json:"description" validate:"required"`
|
TypeId *int `json:"typeId"`
|
||||||
HtmlDescription string `json:"html_description" validate:"required"`
|
Tags *string `json:"tags"`
|
||||||
TypeId int `json:"type_id" validate:"required"`
|
StatusId *int `json:"statusId"`
|
||||||
Tags string `json:"tags" validate:"required"`
|
IsPublish *bool `json:"isPublish"`
|
||||||
ThumbnailPath string `json:"thumbnail_path" validate:"required"`
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
ThumbnailUrl string `json:"thumbnail_url" validate:"required"`
|
|
||||||
PageUrl string `json:"page_url" validate:"required"`
|
|
||||||
CreatedById int `json:"created_by_id" validate:"required"`
|
|
||||||
ShareCount int `json:"share_count" validate:"required"`
|
|
||||||
ViewCount int `json:"view_count" validate:"required"`
|
|
||||||
DownloadCount int `json:"download_count" validate:"required"`
|
|
||||||
StatusId int `json:"status_id" validate:"required"`
|
|
||||||
IsPublish bool `json:"is_publish" validate:"required"`
|
|
||||||
PublishedAt time.Time `json:"published_at" validate:"required"`
|
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
|
||||||
Pagination *paginator.Pagination `json:"pagination"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArticlesCreateRequest struct {
|
type ArticlesCreateRequest struct {
|
||||||
Title string `json:"title" validate:"required"`
|
Title string `json:"title" validate:"required"`
|
||||||
Slug string `json:"slug" validate:"required"`
|
Slug string `json:"slug" validate:"required"`
|
||||||
Description string `json:"description" validate:"required"`
|
Description string `json:"description" validate:"required"`
|
||||||
HtmlDescription string `json:"html_description" validate:"required"`
|
HtmlDescription string `json:"htmlDescription" validate:"required"`
|
||||||
TypeId int `json:"type_id" validate:"required"`
|
TypeId int `json:"typeId" validate:"required"`
|
||||||
Tags string `json:"tags" validate:"required"`
|
Tags string `json:"tags" validate:"required"`
|
||||||
ThumbnailPath string `json:"thumbnail_path" validate:"required"`
|
ThumbnailPath *string `json:"thumbnailPath"`
|
||||||
ThumbnailUrl string `json:"thumbnail_url" validate:"required"`
|
ThumbnailUrl *string `json:"thumbnailUrl"`
|
||||||
PageUrl string `json:"page_url" validate:"required"`
|
PageUrl *string `json:"pageUrl"`
|
||||||
CreatedById int `json:"created_by_id" validate:"required"`
|
CreatedById *int `json:"createdById"`
|
||||||
ShareCount int `json:"share_count" validate:"required"`
|
StatusId *int `json:"status_id"`
|
||||||
ViewCount int `json:"view_count" validate:"required"`
|
IsPublish *bool `json:"is_publish"`
|
||||||
DownloadCount int `json:"download_count" validate:"required"`
|
PublishedAt *time.Time `json:"published_at"`
|
||||||
StatusId int `json:"status_id" validate:"required"`
|
IsActive *bool `json:"is_active"`
|
||||||
IsPublish bool `json:"is_publish" validate:"required"`
|
|
||||||
PublishedAt time.Time `json:"published_at" validate:"required"`
|
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ArticlesCreateRequest) ToEntity() *entity.Articles {
|
func (req ArticlesCreateRequest) ToEntity() *entity.Articles {
|
||||||
|
|
@ -63,9 +50,6 @@ func (req ArticlesCreateRequest) ToEntity() *entity.Articles {
|
||||||
ThumbnailUrl: req.ThumbnailUrl,
|
ThumbnailUrl: req.ThumbnailUrl,
|
||||||
PageUrl: req.PageUrl,
|
PageUrl: req.PageUrl,
|
||||||
CreatedById: req.CreatedById,
|
CreatedById: req.CreatedById,
|
||||||
ShareCount: req.ShareCount,
|
|
||||||
ViewCount: req.ViewCount,
|
|
||||||
DownloadCount: req.DownloadCount,
|
|
||||||
StatusId: req.StatusId,
|
StatusId: req.StatusId,
|
||||||
IsPublish: req.IsPublish,
|
IsPublish: req.IsPublish,
|
||||||
PublishedAt: req.PublishedAt,
|
PublishedAt: req.PublishedAt,
|
||||||
|
|
@ -74,49 +58,67 @@ func (req ArticlesCreateRequest) ToEntity() *entity.Articles {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArticlesUpdateRequest struct {
|
type ArticlesUpdateRequest struct {
|
||||||
ID uint `json:"id" validate:"required"`
|
Title string `json:"title" validate:"required"`
|
||||||
Title string `json:"title" validate:"required"`
|
Slug string `json:"slug" validate:"required"`
|
||||||
Slug string `json:"slug" validate:"required"`
|
Description string `json:"description" validate:"required"`
|
||||||
Description string `json:"description" validate:"required"`
|
HtmlDescription string `json:"htmlDescription" validate:"required"`
|
||||||
HtmlDescription string `json:"html_description" validate:"required"`
|
TypeId int `json:"typeId" validate:"required"`
|
||||||
TypeId int `json:"type_id" validate:"required"`
|
Tags string `json:"tags" validate:"required"`
|
||||||
Tags string `json:"tags" validate:"required"`
|
StatusId *int `json:"statusId"`
|
||||||
ThumbnailPath string `json:"thumbnail_path" validate:"required"`
|
|
||||||
ThumbnailUrl string `json:"thumbnail_url" validate:"required"`
|
|
||||||
PageUrl string `json:"page_url" validate:"required"`
|
|
||||||
CreatedById int `json:"created_by_id" validate:"required"`
|
|
||||||
ShareCount int `json:"share_count" validate:"required"`
|
|
||||||
ViewCount int `json:"view_count" validate:"required"`
|
|
||||||
DownloadCount int `json:"download_count" validate:"required"`
|
|
||||||
StatusId int `json:"status_id" validate:"required"`
|
|
||||||
IsPublish bool `json:"is_publish" validate:"required"`
|
|
||||||
PublishedAt time.Time `json:"published_at" validate:"required"`
|
|
||||||
IsActive bool `json:"is_active" validate:"required"`
|
|
||||||
CreatedAt time.Time `json:"created_at"`
|
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (req ArticlesUpdateRequest) ToEntity() *entity.Articles {
|
func (req ArticlesUpdateRequest) ToEntity() *entity.Articles {
|
||||||
return &entity.Articles{
|
return &entity.Articles{
|
||||||
ID: req.ID,
|
|
||||||
Title: req.Title,
|
Title: req.Title,
|
||||||
Slug: req.Slug,
|
Slug: req.Slug,
|
||||||
Description: req.Description,
|
Description: req.Description,
|
||||||
HtmlDescription: req.HtmlDescription,
|
HtmlDescription: req.HtmlDescription,
|
||||||
TypeId: req.TypeId,
|
TypeId: req.TypeId,
|
||||||
Tags: req.Tags,
|
Tags: req.Tags,
|
||||||
ThumbnailPath: req.ThumbnailPath,
|
|
||||||
ThumbnailUrl: req.ThumbnailUrl,
|
|
||||||
PageUrl: req.PageUrl,
|
|
||||||
CreatedById: req.CreatedById,
|
|
||||||
ShareCount: req.ShareCount,
|
|
||||||
ViewCount: req.ViewCount,
|
|
||||||
DownloadCount: req.DownloadCount,
|
|
||||||
StatusId: req.StatusId,
|
StatusId: req.StatusId,
|
||||||
IsPublish: req.IsPublish,
|
UpdatedAt: time.Now(),
|
||||||
PublishedAt: req.PublishedAt,
|
|
||||||
IsActive: req.IsActive,
|
|
||||||
CreatedAt: req.CreatedAt,
|
|
||||||
UpdatedAt: req.UpdatedAt,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ArticlesQueryRequestContext struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
TypeId string `json:"typeId"`
|
||||||
|
Tags string `json:"tags"`
|
||||||
|
IsPublish string `json:"isPublish"`
|
||||||
|
StatusId string `json:"statusId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (req ArticlesQueryRequestContext) ToParamRequest() ArticlesQueryRequest {
|
||||||
|
var request ArticlesQueryRequest
|
||||||
|
|
||||||
|
if title := req.Title; title != "" {
|
||||||
|
request.Title = &title
|
||||||
|
}
|
||||||
|
if description := req.Description; description != "" {
|
||||||
|
request.Description = &description
|
||||||
|
}
|
||||||
|
if typeIdStr := req.TypeId; typeIdStr != "" {
|
||||||
|
typeId, err := strconv.Atoi(typeIdStr)
|
||||||
|
if err == nil {
|
||||||
|
request.TypeId = &typeId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if tags := req.Tags; tags != "" {
|
||||||
|
request.Tags = &tags
|
||||||
|
}
|
||||||
|
if isPublishStr := req.IsPublish; isPublishStr != "" {
|
||||||
|
isPublish, err := strconv.ParseBool(isPublishStr)
|
||||||
|
if err == nil {
|
||||||
|
request.IsPublish = &isPublish
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if statusIdStr := req.StatusId; statusIdStr != "" {
|
||||||
|
statusId, err := strconv.Atoi(statusIdStr)
|
||||||
|
if err == nil {
|
||||||
|
request.StatusId = &statusId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return request
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,24 +3,24 @@ package response
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type ArticlesResponse struct {
|
type ArticlesResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
HtmlDescription string `json:"html_description"`
|
HtmlDescription string `json:"html_description"`
|
||||||
TypeId int `json:"type_id"`
|
TypeId int `json:"type_id"`
|
||||||
Tags string `json:"tags"`
|
Tags string `json:"tags"`
|
||||||
ThumbnailPath string `json:"thumbnail_path"`
|
ThumbnailPath *string `json:"thumbnail_path"`
|
||||||
ThumbnailUrl string `json:"thumbnail_url"`
|
ThumbnailUrl *string `json:"thumbnail_url"`
|
||||||
PageUrl string `json:"page_url"`
|
PageUrl *string `json:"page_url"`
|
||||||
CreatedById int `json:"created_by_id"`
|
CreatedById *int `json:"created_by_id"`
|
||||||
ShareCount int `json:"share_count"`
|
ShareCount *int `json:"share_count"`
|
||||||
ViewCount int `json:"view_count"`
|
ViewCount *int `json:"view_count"`
|
||||||
DownloadCount int `json:"download_count"`
|
DownloadCount *int `json:"download_count"`
|
||||||
StatusId int `json:"status_id"`
|
StatusId *int `json:"status_id"`
|
||||||
IsPublish bool `json:"is_publish"`
|
IsPublish *bool `json:"is_publish"`
|
||||||
PublishedAt time.Time `json:"published_at"`
|
PublishedAt *time.Time `json:"published_at"`
|
||||||
IsActive bool `json:"is_active"`
|
IsActive *bool `json:"is_active"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
@ -68,5 +68,12 @@ func (_i *articlesService) Update(id uint, req request.ArticlesUpdateRequest) (e
|
||||||
}
|
}
|
||||||
|
|
||||||
func (_i *articlesService) Delete(id uint) error {
|
func (_i *articlesService) Delete(id uint) error {
|
||||||
return _i.Repo.Delete(id)
|
result, err := _i.Repo.FindOne(id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
isActive := false
|
||||||
|
result.IsActive = &isActive
|
||||||
|
return _i.Repo.Update(id, result)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ func (_i *userLevelsController) Delete(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"UserLevels successfully deleted"},
|
Messages: utilRes.Messages{"UserLevels successfully deleted"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package response
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
type UserLevelsResponse struct {
|
type UserLevelsResponse struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
AliasName string `json:"alias_name"`
|
AliasName string `json:"alias_name"`
|
||||||
LevelNumber int `json:"level_number"`
|
LevelNumber int `json:"level_number"`
|
||||||
ParentLevelId int `json:"parent_level_id"`
|
ParentLevelId int `json:"parent_level_id"`
|
||||||
ProvinceId int `json:"province_id"`
|
ProvinceId int `json:"province_id"`
|
||||||
IsActive bool `json:"is_active"`
|
IsActive *bool `json:"is_active"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at"`
|
||||||
UpdatedAt time.Time `json:"updated_at"`
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
@ -191,6 +191,7 @@ func (_i *usersController) Delete(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return utilRes.Resp(c, utilRes.Response{
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
Messages: utilRes.Messages{"Users successfully deleted"},
|
Messages: utilRes.Messages{"Users successfully deleted"},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -910,9 +910,41 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"description": "API for getting all Articles",
|
"description": "API for getting all Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Get all Articles",
|
"summary": "Get all Articles",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "description",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "isPublish",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "statusId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "tags",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "title",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "typeId",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
|
@ -954,9 +986,20 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"description": "API for create Articles",
|
"description": "API for create Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Create Articles",
|
"summary": "Create Articles",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.ArticlesCreateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
|
@ -1000,7 +1043,7 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"description": "API for getting one Articles",
|
"description": "API for getting one Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
|
@ -1053,10 +1096,19 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"description": "API for update Articles",
|
"description": "API for update Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "update Articles",
|
"summary": "update Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.ArticlesUpdateRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles ID",
|
"description": "Articles ID",
|
||||||
|
|
@ -1106,7 +1158,7 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"description": "API for delete Articles",
|
"description": "API for delete Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "delete Articles",
|
"summary": "delete Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
|
@ -5165,6 +5217,95 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.ArticlesCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"htmlDescription",
|
||||||
|
"slug",
|
||||||
|
"tags",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"htmlDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"is_active": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"is_publish": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"pageUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"published_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"status_id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"thumbnailPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"thumbnailUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"request.ArticlesUpdateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"htmlDescription",
|
||||||
|
"slug",
|
||||||
|
"tags",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"htmlDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"statusId": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.CitiesCreateRequest": {
|
"request.CitiesCreateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
|
|
||||||
|
|
@ -899,9 +899,41 @@
|
||||||
],
|
],
|
||||||
"description": "API for getting all Articles",
|
"description": "API for getting all Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Get all Articles",
|
"summary": "Get all Articles",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "description",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "isPublish",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "statusId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "tags",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "title",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "typeId",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
|
@ -943,9 +975,20 @@
|
||||||
],
|
],
|
||||||
"description": "API for create Articles",
|
"description": "API for create Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Create Articles",
|
"summary": "Create Articles",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.ArticlesCreateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
"200": {
|
"200": {
|
||||||
"description": "OK",
|
"description": "OK",
|
||||||
|
|
@ -989,7 +1032,7 @@
|
||||||
],
|
],
|
||||||
"description": "API for getting one Articles",
|
"description": "API for getting one Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
|
@ -1042,10 +1085,19 @@
|
||||||
],
|
],
|
||||||
"description": "API for update Articles",
|
"description": "API for update Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "update Articles",
|
"summary": "update Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.ArticlesUpdateRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles ID",
|
"description": "Articles ID",
|
||||||
|
|
@ -1095,7 +1147,7 @@
|
||||||
],
|
],
|
||||||
"description": "API for delete Articles",
|
"description": "API for delete Articles",
|
||||||
"tags": [
|
"tags": [
|
||||||
"Task"
|
"Articles"
|
||||||
],
|
],
|
||||||
"summary": "delete Articles",
|
"summary": "delete Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
|
@ -5154,6 +5206,95 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.ArticlesCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"htmlDescription",
|
||||||
|
"slug",
|
||||||
|
"tags",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"htmlDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"is_active": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"is_publish": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"pageUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"published_at": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"status_id": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"thumbnailPath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"thumbnailUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"request.ArticlesUpdateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"htmlDescription",
|
||||||
|
"slug",
|
||||||
|
"tags",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"htmlDescription": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"slug": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"statusId": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"tags": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.CitiesCreateRequest": {
|
"request.CitiesCreateRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,68 @@ definitions:
|
||||||
- thumbnail_url
|
- thumbnail_url
|
||||||
- title
|
- title
|
||||||
type: object
|
type: object
|
||||||
|
request.ArticlesCreateRequest:
|
||||||
|
properties:
|
||||||
|
createdById:
|
||||||
|
type: integer
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
htmlDescription:
|
||||||
|
type: string
|
||||||
|
is_active:
|
||||||
|
type: boolean
|
||||||
|
is_publish:
|
||||||
|
type: boolean
|
||||||
|
pageUrl:
|
||||||
|
type: string
|
||||||
|
published_at:
|
||||||
|
type: string
|
||||||
|
slug:
|
||||||
|
type: string
|
||||||
|
status_id:
|
||||||
|
type: integer
|
||||||
|
tags:
|
||||||
|
type: string
|
||||||
|
thumbnailPath:
|
||||||
|
type: string
|
||||||
|
thumbnailUrl:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
typeId:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- description
|
||||||
|
- htmlDescription
|
||||||
|
- slug
|
||||||
|
- tags
|
||||||
|
- title
|
||||||
|
- typeId
|
||||||
|
type: object
|
||||||
|
request.ArticlesUpdateRequest:
|
||||||
|
properties:
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
htmlDescription:
|
||||||
|
type: string
|
||||||
|
slug:
|
||||||
|
type: string
|
||||||
|
statusId:
|
||||||
|
type: integer
|
||||||
|
tags:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
typeId:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- description
|
||||||
|
- htmlDescription
|
||||||
|
- slug
|
||||||
|
- tags
|
||||||
|
- title
|
||||||
|
- typeId
|
||||||
|
type: object
|
||||||
request.CitiesCreateRequest:
|
request.CitiesCreateRequest:
|
||||||
properties:
|
properties:
|
||||||
city_name:
|
city_name:
|
||||||
|
|
@ -837,6 +899,25 @@ paths:
|
||||||
/articles:
|
/articles:
|
||||||
get:
|
get:
|
||||||
description: API for getting all Articles
|
description: API for getting all Articles
|
||||||
|
parameters:
|
||||||
|
- in: query
|
||||||
|
name: description
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: isPublish
|
||||||
|
type: boolean
|
||||||
|
- in: query
|
||||||
|
name: statusId
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: tags
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: title
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: typeId
|
||||||
|
type: integer
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
|
|
@ -862,9 +943,16 @@ paths:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: Get all Articles
|
summary: Get all Articles
|
||||||
tags:
|
tags:
|
||||||
- Task
|
- Articles
|
||||||
post:
|
post:
|
||||||
description: API for create Articles
|
description: API for create Articles
|
||||||
|
parameters:
|
||||||
|
- description: Required payload
|
||||||
|
in: body
|
||||||
|
name: payload
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/request.ArticlesCreateRequest'
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: OK
|
description: OK
|
||||||
|
|
@ -890,7 +978,7 @@ paths:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: Create Articles
|
summary: Create Articles
|
||||||
tags:
|
tags:
|
||||||
- Task
|
- Articles
|
||||||
/articles/{id}:
|
/articles/{id}:
|
||||||
delete:
|
delete:
|
||||||
description: API for delete Articles
|
description: API for delete Articles
|
||||||
|
|
@ -925,7 +1013,7 @@ paths:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: delete Articles
|
summary: delete Articles
|
||||||
tags:
|
tags:
|
||||||
- Task
|
- Articles
|
||||||
get:
|
get:
|
||||||
description: API for getting one Articles
|
description: API for getting one Articles
|
||||||
parameters:
|
parameters:
|
||||||
|
|
@ -959,10 +1047,16 @@ paths:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: Get one Articles
|
summary: Get one Articles
|
||||||
tags:
|
tags:
|
||||||
- Task
|
- Articles
|
||||||
put:
|
put:
|
||||||
description: API for update Articles
|
description: API for update Articles
|
||||||
parameters:
|
parameters:
|
||||||
|
- description: Required payload
|
||||||
|
in: body
|
||||||
|
name: payload
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/request.ArticlesUpdateRequest'
|
||||||
- description: Articles ID
|
- description: Articles ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
|
|
@ -993,7 +1087,7 @@ paths:
|
||||||
- Bearer: []
|
- Bearer: []
|
||||||
summary: update Articles
|
summary: update Articles
|
||||||
tags:
|
tags:
|
||||||
- Task
|
- Articles
|
||||||
/cities:
|
/cities:
|
||||||
get:
|
get:
|
||||||
description: API for getting all Cities
|
description: API for getting all Cities
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue