feat:add api comment agent,promo,galeri,product

This commit is contained in:
Anang Yusman 2026-01-26 14:57:05 +08:00
parent 5a5ca9b713
commit a2cdb34bc3
22 changed files with 1591 additions and 103 deletions

View File

@ -23,6 +23,7 @@ type GalleriesController interface {
Update(c *fiber.Ctx) error Update(c *fiber.Ctx) error
Delete(c *fiber.Ctx) error Delete(c *fiber.Ctx) error
Approve(c *fiber.Ctx) error Approve(c *fiber.Ctx) error
Comment(c *fiber.Ctx) error
Reject(c *fiber.Ctx) error Reject(c *fiber.Ctx) error
} }
@ -281,3 +282,46 @@ func (_i *galleriesController) Reject(c *fiber.Ctx) error {
Data: galleryData, Data: galleryData,
}) })
} }
// Comment Banner
// @Summary Comment Banner
// @Description API for comment Banner (only admin)
// @Tags Banners
// @Security BearerAuth
// @Param id path int true "Banner ID"
// @Param body body request.CommentRequest true "Comment payload"
// @Success 200 {object} response.Response
// @Router /galleries/{id}/comment [put]
func (_i *galleriesController) Comment(c *fiber.Ctx) error {
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
if err != nil {
return err
}
authToken := c.Get("Authorization")
if authToken == "" {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Unauthorized"},
})
}
var req request.CommentRequest
if err := c.BodyParser(&req); err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Invalid request"},
})
}
bannerData, err := _i.galleriesService.Comment(uint(id), authToken, &req.Message)
if err != nil {
return err
}
return utilRes.Resp(c, utilRes.Response{
Success: true,
Messages: utilRes.Messages{"Komentar berhasil disimpan"},
Data: bannerData,
})
}

View File

@ -51,6 +51,7 @@ func (_i *GalleriesRouter) RegisterGalleriesRoutes() {
router.Put("/:id", galleriesController.Update) router.Put("/:id", galleriesController.Update)
router.Put("/:id/approve", galleriesController.Approve) router.Put("/:id/approve", galleriesController.Approve)
router.Put("/:id/reject", galleriesController.Reject) router.Put("/:id/reject", galleriesController.Reject)
router.Put("/:id/comment", galleriesController.Comment)
router.Delete("/:id", galleriesController.Delete) router.Delete("/:id", galleriesController.Delete)
}) })
} }

View File

@ -10,10 +10,15 @@ type GalleriesQueryRequest struct {
Pagination *paginator.Pagination `json:"pagination"` Pagination *paginator.Pagination `json:"pagination"`
} }
type GalleriesQueryRequestContext struct { type GalleriesQueryRequestContext struct {
Title string `json:"title"` Title string `json:"title"`
} }
type CommentRequest struct {
Message string `json:"message"`
}
func (req GalleriesQueryRequestContext) ToParamRequest() GalleriesQueryRequest { func (req GalleriesQueryRequestContext) ToParamRequest() GalleriesQueryRequest {
var request GalleriesQueryRequest var request GalleriesQueryRequest

View File

@ -30,6 +30,7 @@ type GalleriesService interface {
Update(id uint, req request.GalleriesUpdateRequest) (gallery *response.GalleriesResponse, err error) Update(id uint, req request.GalleriesUpdateRequest) (gallery *response.GalleriesResponse, err error)
Delete(id uint) (err error) Delete(id uint) (err error)
Approve(id uint, authToken string) (gallery *response.GalleriesResponse, err error) Approve(id uint, authToken string) (gallery *response.GalleriesResponse, err error)
Comment(id uint, authToken string, message *string) (banner *response.GalleriesResponse, err error)
Reject(id uint, authToken string, message *string) (gallery *response.GalleriesResponse, err error) Reject(id uint, authToken string, message *string) (gallery *response.GalleriesResponse, err error)
} }
@ -218,3 +219,50 @@ func (_i *galleriesService) Reject(id uint, authToken string, message *string) (
gallery = mapper.GalleriesResponseMapper(galleryEntity, host) gallery = mapper.GalleriesResponseMapper(galleryEntity, host)
return return
} }
func (_i *galleriesService) Comment(
id uint,
authToken string,
message *string,
) (galleries *response.GalleriesResponse, err error) {
user := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if user == nil {
err = errors.New("unauthorized")
return
}
if user.UserRoleId != 1 {
err = errors.New("only admin can comment")
return
}
// SIMPAN COMMENT KE HISTORY (INTI FITURNYA)
userID := user.ID
err = _i.ApprovalHistoriesService.CreateHistory(
"galleries",
id,
nil, // status_id NULL
"comment",
&userID,
message,
)
if err != nil {
return
}
// Ambil terbaru
galleriesEntity, err := _i.Repo.FindOne(id)
if err != nil {
return
}
if galleriesEntity == nil {
err = errors.New("galleries not found")
return
}
host := _i.Cfg.App.Domain
galleries = mapper.GalleriesResponseMapper(galleriesEntity, host)
return
}

View File

@ -24,6 +24,7 @@ type ProductsController interface {
Delete(c *fiber.Ctx) error Delete(c *fiber.Ctx) error
Approve(c *fiber.Ctx) error Approve(c *fiber.Ctx) error
Reject(c *fiber.Ctx) error Reject(c *fiber.Ctx) error
Comment(c *fiber.Ctx) error
Viewer(c *fiber.Ctx) error Viewer(c *fiber.Ctx) error
} }
@ -142,12 +143,18 @@ func (_i *productsController) Save(c *fiber.Ctx) error {
} }
// Handle colors (JSON array string) // Handle colors (JSON array string)
if colorsStr := c.FormValue("colors"); colorsStr != "" { var colors []request.ProductColorRequest
var colors []string
if err := json.Unmarshal([]byte(colorsStr), &colors); err == nil { if colorsStr := c.FormValue("colors"); colorsStr != "" {
req.Colors = colors if err := json.Unmarshal([]byte(colorsStr), &colors); err != nil {
} return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Invalid colors format"},
})
} }
req.Colors = colors
}
// Validate required fields // Validate required fields
if req.Title == "" { if req.Title == "" {
@ -368,6 +375,49 @@ func (_i *productsController) Reject(c *fiber.Ctx) error {
}) })
} }
// Comment Banner
// @Summary Comment Banner
// @Description API for comment Banner (only admin)
// @Tags Banners
// @Security BearerAuth
// @Param id path int true "Banner ID"
// @Param body body request.CommentRequest true "Comment payload"
// @Success 200 {object} response.Response
// @Router /products/{id}/comment [put]
func (_i *productsController) Comment(c *fiber.Ctx) error {
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
if err != nil {
return err
}
authToken := c.Get("Authorization")
if authToken == "" {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Unauthorized"},
})
}
var req request.CommentRequest
if err := c.BodyParser(&req); err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Invalid request"},
})
}
bannerData, err := _i.productsService.Comment(uint(id), authToken, &req.Message)
if err != nil {
return err
}
return utilRes.Resp(c, utilRes.Response{
Success: true,
Messages: utilRes.Messages{"Komentar berhasil disimpan"},
Data: bannerData,
})
}
// Viewer Product // Viewer Product
// @Summary Viewer Product // @Summary Viewer Product
// @Description API for viewing Product file // @Description API for viewing Product file

View File

@ -52,6 +52,7 @@ func (_i *ProductsRouter) RegisterProductsRoutes() {
router.Put("/:id", productsController.Update) router.Put("/:id", productsController.Update)
router.Put("/:id/approve", productsController.Approve) router.Put("/:id/approve", productsController.Approve)
router.Put("/:id/reject", productsController.Reject) router.Put("/:id/reject", productsController.Reject)
router.Put("/:id/comment", productsController.Comment)
router.Delete("/:id", productsController.Delete) router.Delete("/:id", productsController.Delete)
}) })
} }

View File

@ -19,6 +19,10 @@ type ProductsQueryRequestContext struct {
Status string `json:"status"` Status string `json:"status"`
} }
type CommentRequest struct {
Message string `json:"message"`
}
func (req ProductsQueryRequestContext) ToParamRequest() ProductsQueryRequest { func (req ProductsQueryRequestContext) ToParamRequest() ProductsQueryRequest {
var request ProductsQueryRequest var request ProductsQueryRequest
@ -35,18 +39,46 @@ func (req ProductsQueryRequestContext) ToParamRequest() ProductsQueryRequest {
return request return request
} }
// type ProductsCreateRequest struct {
// Title string `json:"title" validate:"required"`
// Variant *string `json:"variant"`
// Price *string `json:"price"`
// ThumbnailPath *string `json:"thumbnail_path"`
// Colors []string `json:"colors"`
// Status *string `json:"status"`
// }
type ProductsCreateRequest struct { type ProductsCreateRequest struct {
Title string `json:"title" validate:"required"` Title string `json:"title" validate:"required"`
Variant *string `json:"variant"` Variant *string `json:"variant"`
Price *string `json:"price"` Price *string `json:"price"`
ThumbnailPath *string `json:"thumbnail_path"` ThumbnailPath *string `json:"thumbnail_path"`
Colors []string `json:"colors"` Colors []ProductColorRequest `json:"colors"`
Status *string `json:"status"` Status *string `json:"status"`
} }
// func (req ProductsCreateRequest) ToEntity() *entity.Products {
// colorsJSON, _ := json.Marshal(req.Colors)
// colorsStr := string(colorsJSON)
// if colorsStr == "null" {
// colorsStr = ""
// }
// return &entity.Products{
// Title: req.Title,
// Variant: req.Variant,
// Price: req.Price,
// ThumbnailPath: req.ThumbnailPath,
// Colors: &colorsStr,
// Status: req.Status,
// }
// }
func (req ProductsCreateRequest) ToEntity() *entity.Products { func (req ProductsCreateRequest) ToEntity() *entity.Products {
colorsJSON, _ := json.Marshal(req.Colors) colorsJSON, _ := json.Marshal(req.Colors)
colorsStr := string(colorsJSON) colorsStr := string(colorsJSON)
if colorsStr == "null" { if colorsStr == "null" {
colorsStr = "" colorsStr = ""
} }
@ -61,6 +93,7 @@ func (req ProductsCreateRequest) ToEntity() *entity.Products {
} }
} }
type ProductsUpdateRequest struct { type ProductsUpdateRequest struct {
Title *string `json:"title"` Title *string `json:"title"`
Variant *string `json:"variant"` Variant *string `json:"variant"`
@ -95,3 +128,9 @@ func getStringValue(s *string) string {
} }
return *s return *s
} }
type ProductColorRequest struct {
Name string `json:"name"`
ImagePath *string `json:"image_path"`
}

View File

@ -28,11 +28,11 @@ import (
) )
type productsService struct { type productsService struct {
Repo repository.ProductsRepository Repo repository.ProductsRepository
Log zerolog.Logger Log zerolog.Logger
Cfg *config.Config Cfg *config.Config
MinioStorage *minioStorage.MinioStorage MinioStorage *minioStorage.MinioStorage
UsersRepo usersRepository.UsersRepository UsersRepo usersRepository.UsersRepository
ApprovalHistoriesService approvalHistoriesService.ApprovalHistoriesService ApprovalHistoriesService approvalHistoriesService.ApprovalHistoriesService
} }
@ -44,6 +44,7 @@ type ProductsService interface {
Delete(id uint) (err error) Delete(id uint) (err error)
Approve(id uint, authToken string) (product *response.ProductsResponse, err error) Approve(id uint, authToken string) (product *response.ProductsResponse, err error)
Reject(id uint, authToken string, message *string) (product *response.ProductsResponse, err error) Reject(id uint, authToken string, message *string) (product *response.ProductsResponse, err error)
Comment(id uint, authToken string, message *string) (product *response.ProductsResponse, err error)
UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error) UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error)
Viewer(c *fiber.Ctx) (err error) Viewer(c *fiber.Ctx) (err error)
} }
@ -307,7 +308,7 @@ func (_i *productsService) Approve(id uint, authToken string) (product *response
statusApprove := 2 statusApprove := 2
err = _i.ApprovalHistoriesService.CreateHistory( err = _i.ApprovalHistoriesService.CreateHistory(
"banners", "products",
id, id,
&statusApprove, // ✅ pointer &statusApprove, // ✅ pointer
"approve", "approve",
@ -359,7 +360,7 @@ func (_i *productsService) Reject(id uint, authToken string, message *string) (p
statusReject := 3 statusReject := 3
err = _i.ApprovalHistoriesService.CreateHistory( err = _i.ApprovalHistoriesService.CreateHistory(
"banners", "productss",
id, id,
&statusReject, // ✅ pointer &statusReject, // ✅ pointer
"reject", "reject",
@ -385,3 +386,50 @@ func (_i *productsService) Reject(id uint, authToken string, message *string) (p
product = mapper.ProductsResponseMapper(productEntity, host) product = mapper.ProductsResponseMapper(productEntity, host)
return return
} }
func (_i *productsService) Comment(
id uint,
authToken string,
message *string,
) (banner *response.ProductsResponse, err error) {
user := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if user == nil {
err = errors.New("unauthorized")
return
}
if user.UserRoleId != 1 {
err = errors.New("only admin can comment")
return
}
// SIMPAN COMMENT KE HISTORY (INTI FITURNYA)
userID := user.ID
err = _i.ApprovalHistoriesService.CreateHistory(
"banners",
id,
nil, // status_id NULL
"comment",
&userID,
message,
)
if err != nil {
return
}
// Ambil banner terbaru
bannerEntity, err := _i.Repo.FindOne(id)
if err != nil {
return
}
if bannerEntity == nil {
err = errors.New("banner not found")
return
}
host := _i.Cfg.App.Domain
banner = mapper.ProductsResponseMapper(bannerEntity, host)
return
}

View File

@ -24,6 +24,7 @@ type PromotionsController interface {
Delete(c *fiber.Ctx) error Delete(c *fiber.Ctx) error
Approve(c *fiber.Ctx) error Approve(c *fiber.Ctx) error
Reject(c *fiber.Ctx) error Reject(c *fiber.Ctx) error
Comment(c *fiber.Ctx) error
Viewer(c *fiber.Ctx) error Viewer(c *fiber.Ctx) error
} }
@ -311,6 +312,49 @@ func (_i *promotionsController) Reject(c *fiber.Ctx) error {
}) })
} }
// Comment Banner
// @Summary Comment Banner
// @Description API for comment Banner (only admin)
// @Tags Banners
// @Security BearerAuth
// @Param id path int true "Banner ID"
// @Param body body request.CommentRequest true "Comment payload"
// @Success 200 {object} response.Response
// @Router /promotions/{id}/comment [put]
func (_i *promotionsController) Comment(c *fiber.Ctx) error {
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
if err != nil {
return err
}
authToken := c.Get("Authorization")
if authToken == "" {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Unauthorized"},
})
}
var req request.CommentRequest
if err := c.BodyParser(&req); err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Invalid request"},
})
}
bannerData, err := _i.promotionsService.Comment(uint(id), authToken, &req.Message)
if err != nil {
return err
}
return utilRes.Resp(c, utilRes.Response{
Success: true,
Messages: utilRes.Messages{"Komentar berhasil disimpan"},
Data: bannerData,
})
}
// Viewer Promotion // Viewer Promotion
// @Summary Viewer Promotion // @Summary Viewer Promotion
// @Description API for viewing Promotion file // @Description API for viewing Promotion file

View File

@ -52,6 +52,7 @@ func (_i *PromotionsRouter) RegisterPromotionsRoutes() {
router.Put("/:id", promotionsController.Update) router.Put("/:id", promotionsController.Update)
router.Put("/:id/approve", promotionsController.Approve) router.Put("/:id/approve", promotionsController.Approve)
router.Put("/:id/reject", promotionsController.Reject) router.Put("/:id/reject", promotionsController.Reject)
router.Put("/:id/comment", promotionsController.Comment)
router.Delete("/:id", promotionsController.Delete) router.Delete("/:id", promotionsController.Delete)
}) })
} }

View File

@ -14,6 +14,10 @@ type PromotionsQueryRequestContext struct {
Title string `json:"title"` Title string `json:"title"`
} }
type CommentRequest struct {
Message string `json:"message"`
}
func (req PromotionsQueryRequestContext) ToParamRequest() PromotionsQueryRequest { func (req PromotionsQueryRequestContext) ToParamRequest() PromotionsQueryRequest {
var request PromotionsQueryRequest var request PromotionsQueryRequest

View File

@ -44,6 +44,7 @@ type PromotionsService interface {
Delete(id uint) (err error) Delete(id uint) (err error)
Approve(id uint, authToken string) (promotion *response.PromotionsResponse, err error) Approve(id uint, authToken string) (promotion *response.PromotionsResponse, err error)
Reject(id uint, authToken string, message *string) (promotion *response.PromotionsResponse, err error) Reject(id uint, authToken string, message *string) (promotion *response.PromotionsResponse, err error)
Comment(id uint, authToken string, message *string) (product *response.PromotionsResponse, err error)
UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error) UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error)
Viewer(c *fiber.Ctx) (err error) Viewer(c *fiber.Ctx) (err error)
} }
@ -380,3 +381,50 @@ func (_i *promotionsService) Reject(id uint, authToken string, message *string)
promotion = mapper.PromotionsResponseMapper(promotionEntity, host) promotion = mapper.PromotionsResponseMapper(promotionEntity, host)
return return
} }
func (_i *promotionsService) Comment(
id uint,
authToken string,
message *string,
) (banner *response.PromotionsResponse, err error) {
user := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if user == nil {
err = errors.New("unauthorized")
return
}
if user.UserRoleId != 1 {
err = errors.New("only admin can comment")
return
}
// SIMPAN COMMENT KE HISTORY (INTI FITURNYA)
userID := user.ID
err = _i.ApprovalHistoriesService.CreateHistory(
"banners",
id,
nil, // status_id NULL
"comment",
&userID,
message,
)
if err != nil {
return
}
// Ambil banner terbaru
bannerEntity, err := _i.Repo.FindOne(id)
if err != nil {
return
}
if bannerEntity == nil {
err = errors.New("banner not found")
return
}
host := _i.Cfg.App.Domain
banner = mapper.PromotionsResponseMapper(bannerEntity, host)
return
}

View File

@ -24,6 +24,7 @@ type SalesAgentsController interface {
Delete(c *fiber.Ctx) error Delete(c *fiber.Ctx) error
Approve(c *fiber.Ctx) error Approve(c *fiber.Ctx) error
Reject(c *fiber.Ctx) error Reject(c *fiber.Ctx) error
Comment(c *fiber.Ctx) error
Viewer(c *fiber.Ctx) error Viewer(c *fiber.Ctx) error
} }
@ -369,6 +370,49 @@ func (_i *salesAgentsController) Reject(c *fiber.Ctx) error {
}) })
} }
// Comment Banner
// @Summary Comment Banner
// @Description API for comment Banner (only admin)
// @Tags Banners
// @Security BearerAuth
// @Param id path int true "Banner ID"
// @Param body body request.CommentRequest true "Comment payload"
// @Success 200 {object} response.Response
// @Router /sales-agents/{id}/comment [put]
func (_i *salesAgentsController) Comment(c *fiber.Ctx) error {
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
if err != nil {
return err
}
authToken := c.Get("Authorization")
if authToken == "" {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Unauthorized"},
})
}
var req request.CommentRequest
if err := c.BodyParser(&req); err != nil {
return utilRes.Resp(c, utilRes.Response{
Success: false,
Messages: utilRes.Messages{"Invalid request"},
})
}
bannerData, err := _i.salesAgentsService.Comment(uint(id), authToken, &req.Message)
if err != nil {
return err
}
return utilRes.Resp(c, utilRes.Response{
Success: true,
Messages: utilRes.Messages{"Komentar berhasil disimpan"},
Data: bannerData,
})
}
// Viewer SalesAgent // Viewer SalesAgent
// @Summary Viewer SalesAgent // @Summary Viewer SalesAgent
// @Description API for viewing SalesAgent profile picture file // @Description API for viewing SalesAgent profile picture file

View File

@ -19,6 +19,10 @@ type SalesAgentsQueryRequestContext struct {
AgentType string `json:"agent_type"` AgentType string `json:"agent_type"`
} }
type CommentRequest struct {
Message string `json:"message"`
}
func (req SalesAgentsQueryRequestContext) ToParamRequest() SalesAgentsQueryRequest { func (req SalesAgentsQueryRequestContext) ToParamRequest() SalesAgentsQueryRequest {
var request SalesAgentsQueryRequest var request SalesAgentsQueryRequest

View File

@ -52,6 +52,7 @@ func (_i *SalesAgentsRouter) RegisterSalesAgentsRoutes() {
router.Put("/:id", salesAgentsController.Update) router.Put("/:id", salesAgentsController.Update)
router.Put("/:id/approve", salesAgentsController.Approve) router.Put("/:id/approve", salesAgentsController.Approve)
router.Put("/:id/reject", salesAgentsController.Reject) router.Put("/:id/reject", salesAgentsController.Reject)
router.Put("/:id/comment", salesAgentsController.Comment)
router.Delete("/:id", salesAgentsController.Delete) router.Delete("/:id", salesAgentsController.Delete)
}) })
} }

View File

@ -44,6 +44,7 @@ type SalesAgentsService interface {
Delete(id uint) (err error) Delete(id uint) (err error)
Approve(id uint, authToken string) (agent *response.SalesAgentsResponse, err error) Approve(id uint, authToken string) (agent *response.SalesAgentsResponse, err error)
Reject(id uint, authToken string, message *string) (agent *response.SalesAgentsResponse, err error) Reject(id uint, authToken string, message *string) (agent *response.SalesAgentsResponse, err error)
Comment(id uint, authToken string, message *string) (product *response.SalesAgentsResponse, err error)
UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error) UploadFileToMinio(c *fiber.Ctx, fileKey string) (filePath *string, err error)
Viewer(c *fiber.Ctx) (err error) Viewer(c *fiber.Ctx) (err error)
} }
@ -385,3 +386,50 @@ func (_i *salesAgentsService) Reject(id uint, authToken string, message *string)
agent = mapper.SalesAgentsResponseMapper(agentEntity, host) agent = mapper.SalesAgentsResponseMapper(agentEntity, host)
return return
} }
func (_i *salesAgentsService) Comment(
id uint,
authToken string,
message *string,
) (banner *response.SalesAgentsResponse, err error) {
user := utilSvc.GetUserInfo(_i.Log, _i.UsersRepo, authToken)
if user == nil {
err = errors.New("unauthorized")
return
}
if user.UserRoleId != 1 {
err = errors.New("only admin can comment")
return
}
// SIMPAN COMMENT KE HISTORY (INTI FITURNYA)
userID := user.ID
err = _i.ApprovalHistoriesService.CreateHistory(
"banners",
id,
nil, // status_id NULL
"comment",
&userID,
message,
)
if err != nil {
return
}
// Ambil banner terbaru
bannerEntity, err := _i.Repo.FindOne(id)
if err != nil {
return
}
if bannerEntity == nil {
err = errors.New("banner not found")
return
}
host := _i.Cfg.App.Domain
banner = mapper.SalesAgentsResponseMapper(bannerEntity, host)
return
}

View File

@ -3937,22 +3937,15 @@ const docTemplate = `{
"put": { "put": {
"security": [ "security": [
{ {
"Bearer": [] "BearerAuth": []
} }
], ],
"description": "API for comment Banner (only for admin with roleId = 1)", "description": "API for comment Banner (only admin)",
"tags": [ "tags": [
"Banners" "Banners"
], ],
"summary": "Comment Banner", "summary": "Comment Banner",
"parameters": [ "parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{ {
"type": "integer", "type": "integer",
"description": "Banner ID", "description": "Banner ID",
@ -3961,11 +3954,12 @@ const docTemplate = `{
"required": true "required": true
}, },
{ {
"description": "Comment message", "description": "Comment payload",
"name": "message", "name": "body",
"in": "body", "in": "body",
"required": true,
"schema": { "schema": {
"type": "string" "$ref": "#/definitions/jaecoo-be_app_module_banners_request.CommentRequest"
} }
} }
], ],
@ -3975,24 +3969,6 @@ const docTemplate = `{
"schema": { "schema": {
"$ref": "#/definitions/response.Response" "$ref": "#/definitions/response.Response"
} }
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
} }
} }
} }
@ -6666,6 +6642,46 @@ const docTemplate = `{
} }
} }
}, },
"/galleries/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_galleries_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/galleries/{id}/reject": { "/galleries/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -8028,6 +8044,46 @@ const docTemplate = `{
} }
} }
}, },
"/products/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_products_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/products/{id}/reject": { "/products/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -8537,6 +8593,46 @@ const docTemplate = `{
} }
} }
}, },
"/promotions/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_promotions_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/promotions/{id}/reject": { "/promotions/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -9346,6 +9442,46 @@ const docTemplate = `{
} }
} }
}, },
"/sales-agents/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_sales_agents_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/sales-agents/{id}/reject": { "/sales-agents/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -11751,6 +11887,46 @@ const docTemplate = `{
} }
}, },
"definitions": { "definitions": {
"jaecoo-be_app_module_banners_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_galleries_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_products_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_promotions_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_sales_agents_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"paginator.Pagination": { "paginator.Pagination": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -3926,22 +3926,15 @@
"put": { "put": {
"security": [ "security": [
{ {
"Bearer": [] "BearerAuth": []
} }
], ],
"description": "API for comment Banner (only for admin with roleId = 1)", "description": "API for comment Banner (only admin)",
"tags": [ "tags": [
"Banners" "Banners"
], ],
"summary": "Comment Banner", "summary": "Comment Banner",
"parameters": [ "parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{ {
"type": "integer", "type": "integer",
"description": "Banner ID", "description": "Banner ID",
@ -3950,11 +3943,12 @@
"required": true "required": true
}, },
{ {
"description": "Comment message", "description": "Comment payload",
"name": "message", "name": "body",
"in": "body", "in": "body",
"required": true,
"schema": { "schema": {
"type": "string" "$ref": "#/definitions/jaecoo-be_app_module_banners_request.CommentRequest"
} }
} }
], ],
@ -3964,24 +3958,6 @@
"schema": { "schema": {
"$ref": "#/definitions/response.Response" "$ref": "#/definitions/response.Response"
} }
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
} }
} }
} }
@ -6655,6 +6631,46 @@
} }
} }
}, },
"/galleries/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_galleries_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/galleries/{id}/reject": { "/galleries/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -8017,6 +8033,46 @@
} }
} }
}, },
"/products/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_products_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/products/{id}/reject": { "/products/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -8526,6 +8582,46 @@
} }
} }
}, },
"/promotions/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_promotions_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/promotions/{id}/reject": { "/promotions/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -9335,6 +9431,46 @@
} }
} }
}, },
"/sales-agents/{id}/comment": {
"put": {
"security": [
{
"BearerAuth": []
}
],
"description": "API for comment Banner (only admin)",
"tags": [
"Banners"
],
"summary": "Comment Banner",
"parameters": [
{
"type": "integer",
"description": "Banner ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Comment payload",
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/jaecoo-be_app_module_sales_agents_request.CommentRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
}
}
}
},
"/sales-agents/{id}/reject": { "/sales-agents/{id}/reject": {
"put": { "put": {
"security": [ "security": [
@ -11740,6 +11876,46 @@
} }
}, },
"definitions": { "definitions": {
"jaecoo-be_app_module_banners_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_galleries_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_products_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_promotions_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"jaecoo-be_app_module_sales_agents_request.CommentRequest": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"paginator.Pagination": { "paginator.Pagination": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@ -1,4 +1,29 @@
definitions: definitions:
jaecoo-be_app_module_banners_request.CommentRequest:
properties:
message:
type: string
type: object
jaecoo-be_app_module_galleries_request.CommentRequest:
properties:
message:
type: string
type: object
jaecoo-be_app_module_products_request.CommentRequest:
properties:
message:
type: string
type: object
jaecoo-be_app_module_promotions_request.CommentRequest:
properties:
message:
type: string
type: object
jaecoo-be_app_module_sales_agents_request.CommentRequest:
properties:
message:
type: string
type: object
paginator.Pagination: paginator.Pagination:
properties: properties:
count: count:
@ -3356,42 +3381,26 @@ paths:
- Banners - Banners
/banners/{id}/comment: /banners/{id}/comment:
put: put:
description: API for comment Banner (only for admin with roleId = 1) description: API for comment Banner (only admin)
parameters: parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
required: true
type: string
- description: Banner ID - description: Banner ID
in: path in: path
name: id name: id
required: true required: true
type: integer type: integer
- description: Comment message - description: Comment payload
in: body in: body
name: message name: body
required: true
schema: schema:
type: string $ref: '#/definitions/jaecoo-be_app_module_banners_request.CommentRequest'
responses: responses:
"200": "200":
description: OK description: OK
schema: schema:
$ref: '#/definitions/response.Response' $ref: '#/definitions/response.Response'
"400":
description: Bad Request
schema:
$ref: '#/definitions/response.BadRequestError'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.UnauthorizedError'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.InternalServerError'
security: security:
- Bearer: [] - BearerAuth: []
summary: Comment Banner summary: Comment Banner
tags: tags:
- Banners - Banners
@ -5131,6 +5140,31 @@ paths:
summary: Approve Gallery summary: Approve Gallery
tags: tags:
- Galleries - Galleries
/galleries/{id}/comment:
put:
description: API for comment Banner (only admin)
parameters:
- description: Banner ID
in: path
name: id
required: true
type: integer
- description: Comment payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/jaecoo-be_app_module_galleries_request.CommentRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- BearerAuth: []
summary: Comment Banner
tags:
- Banners
/galleries/{id}/reject: /galleries/{id}/reject:
put: put:
description: API for rejecting Gallery (only for admin with roleId = 1) description: API for rejecting Gallery (only for admin with roleId = 1)
@ -5968,6 +6002,31 @@ paths:
summary: Approve Product summary: Approve Product
tags: tags:
- Products - Products
/products/{id}/comment:
put:
description: API for comment Banner (only admin)
parameters:
- description: Banner ID
in: path
name: id
required: true
type: integer
- description: Comment payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/jaecoo-be_app_module_products_request.CommentRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- BearerAuth: []
summary: Comment Banner
tags:
- Banners
/products/{id}/reject: /products/{id}/reject:
put: put:
description: API for rejecting Product (only for admin with roleId = 1) description: API for rejecting Product (only for admin with roleId = 1)
@ -6294,6 +6353,31 @@ paths:
summary: Approve Promotion summary: Approve Promotion
tags: tags:
- Promotions - Promotions
/promotions/{id}/comment:
put:
description: API for comment Banner (only admin)
parameters:
- description: Banner ID
in: path
name: id
required: true
type: integer
- description: Comment payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/jaecoo-be_app_module_promotions_request.CommentRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- BearerAuth: []
summary: Comment Banner
tags:
- Banners
/promotions/{id}/reject: /promotions/{id}/reject:
put: put:
description: API for rejecting Promotion (only for admin with roleId = 1) description: API for rejecting Promotion (only for admin with roleId = 1)
@ -6812,6 +6896,31 @@ paths:
summary: Approve SalesAgent summary: Approve SalesAgent
tags: tags:
- SalesAgents - SalesAgents
/sales-agents/{id}/comment:
put:
description: API for comment Banner (only admin)
parameters:
- description: Banner ID
in: path
name: id
required: true
type: integer
- description: Comment payload
in: body
name: body
required: true
schema:
$ref: '#/definitions/jaecoo-be_app_module_sales_agents_request.CommentRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/response.Response'
security:
- BearerAuth: []
summary: Comment Banner
tags:
- Banners
/sales-agents/{id}/reject: /sales-agents/{id}/reject:
put: put:
description: API for rejecting SalesAgent (only for admin with roleId = 1) description: API for rejecting SalesAgent (only for admin with roleId = 1)

View File

@ -6376,6 +6376,62 @@ const docTemplate = `{
} }
} }
} }
},
"/galleries/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Galleries (only for admin with roleId = 1)",
"tags": [
"Galleries"
],
"summary": "Comment Galleries",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Galleries ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
}, },
"/gallery-files": { "/gallery-files": {
"get": { "get": {
@ -7333,7 +7389,13 @@ const docTemplate = `{
"description": "Product colors (JSON array)", "description": "Product colors (JSON array)",
"name": "colors", "name": "colors",
"in": "formData" "in": "formData"
} },
{
"type": "file",
"description": "Color images (multiple files)",
"name": "color_images[]",
"in": "formData"
},
], ],
"responses": { "responses": {
"200": { "200": {
@ -7675,6 +7737,62 @@ const docTemplate = `{
} }
} }
}, },
"/products/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Product (only for admin with roleId = 1)",
"tags": [
"Products"
],
"summary": "Comment Product",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Product ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
},
"/promotions": { "/promotions": {
"get": { "get": {
"security": [ "security": [
@ -8119,6 +8237,62 @@ const docTemplate = `{
} }
} }
} }
},
"/promotions/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Promotions (only for admin with roleId = 1)",
"tags": [
"Promotions"
],
"summary": "Comment Promotions",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Promotions ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
}, },
"/provinces": { "/provinces": {
"get": { "get": {
@ -8864,6 +9038,62 @@ const docTemplate = `{
} }
} }
} }
},
"/sales-agents/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment SalesAgents (only for admin with roleId = 1)",
"tags": [
"SalesAgents"
],
"summary": "Comment SalesAgents",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "SalesAgents ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
}, },
"/user-levels": { "/user-levels": {
"get": { "get": {

View File

@ -6150,6 +6150,60 @@
} }
} }
}, },
"/galleries/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Galleries (only for admin with roleId = 1)",
"tags": ["Galleries"],
"summary": "Comment Galleries",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Galleries ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
},
"/gallery-files": { "/gallery-files": {
"get": { "get": {
"security": [ "security": [
@ -7075,9 +7129,15 @@
}, },
{ {
"type": "string", "type": "string",
"description": "Product colors (JSON array)",
"name": "colors", "name": "colors",
"in": "formData" "in": "formData",
"description": "JSON array of colors. Example: [{\"name\":\"Silver\"},{\"name\":\"#E2E2E2\"}]"
},
{
"type": "file",
"name": "color_images[]",
"in": "formData",
"description": "Color images (multiple files)"
} }
], ],
"responses": { "responses": {
@ -7410,6 +7470,60 @@
} }
} }
}, },
"/products/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Product (only for admin with roleId = 1)",
"tags": ["Products"],
"summary": "Comment Product",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Products ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
},
"/promotions": { "/promotions": {
"get": { "get": {
"security": [ "security": [
@ -7841,6 +7955,60 @@
} }
} }
}, },
"/promotions/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment Promotions (only for admin with roleId = 1)",
"tags": ["Promotions"],
"summary": "Comment Promotions",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "Promotions ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
},
"/provinces": { "/provinces": {
"get": { "get": {
"security": [ "security": [
@ -8562,6 +8730,60 @@
} }
} }
}, },
"/sales-agents/{id}/comment": {
"put": {
"security": [
{
"Bearer": []
}
],
"description": "API for comment SalesAgents (only for admin with roleId = 1)",
"tags": ["SalesAgents"],
"summary": "Comment SalesAgents",
"parameters": [
{
"type": "string",
"description": "Insert the X-Client-Key",
"name": "X-Client-Key",
"in": "header",
"required": true
},
{
"type": "integer",
"description": "SalesAgents ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/response.Response"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.BadRequestError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.UnauthorizedError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.InternalServerError"
}
}
}
}
},
"/user-levels": { "/user-levels": {
"get": { "get": {
"security": [ "security": [

View File

@ -4951,6 +4951,42 @@ paths:
summary: Approve Gallery summary: Approve Gallery
tags: tags:
- Galleries - Galleries
/galleries/{id}/comment:
put:
description: API for comment Galleries (only for admin with roleId = 1)
parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
required: true
type: string
- description: Galleries ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: "#/definitions/response.Response"
"400":
description: Bad Request
schema:
$ref: "#/definitions/response.BadRequestError"
"401":
description: Unauthorized
schema:
$ref: "#/definitions/response.UnauthorizedError"
"500":
description: Internal Server Error
schema:
$ref: "#/definitions/response.InternalServerError"
security:
- Bearer: []
summary: Comment Galleries
tags:
- Galleries
/gallery-files: /gallery-files:
get: get:
description: API for getting all GalleryFiles description: API for getting all GalleryFiles
@ -5559,6 +5595,7 @@ paths:
in: formData in: formData
name: colors name: colors
type: string type: string
responses: responses:
"200": "200":
description: OK description: OK
@ -5747,6 +5784,42 @@ paths:
summary: Approve Product summary: Approve Product
tags: tags:
- Products - Products
/products/{id}/comment:
put:
description: API for comment Product (only for admin with roleId = 1)
parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
required: true
type: string
- description: Product ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: "#/definitions/response.Response"
"400":
description: Bad Request
schema:
$ref: "#/definitions/response.BadRequestError"
"401":
description: Unauthorized
schema:
$ref: "#/definitions/response.UnauthorizedError"
"500":
description: Internal Server Error
schema:
$ref: "#/definitions/response.InternalServerError"
security:
- Bearer: []
summary: Comment Product
tags:
- Products
/products/viewer/{filename}: /products/viewer/{filename}:
get: get:
description: API for viewing Product file description: API for viewing Product file
@ -6032,6 +6105,42 @@ paths:
summary: Approve Promotion summary: Approve Promotion
tags: tags:
- Promotions - Promotions
/promotions/{id}/comment:
put:
description: API for comment Promotions (only for admin with roleId = 1)
parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
required: true
type: string
- description: Promotions ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: "#/definitions/response.Response"
"400":
description: Bad Request
schema:
$ref: "#/definitions/response.BadRequestError"
"401":
description: Unauthorized
schema:
$ref: "#/definitions/response.UnauthorizedError"
"500":
description: Internal Server Error
schema:
$ref: "#/definitions/response.InternalServerError"
security:
- Bearer: []
summary: Comment Promotions
tags:
- Promotions
/promotions/viewer/{filename}: /promotions/viewer/{filename}:
get: get:
description: API for viewing Promotion file description: API for viewing Promotion file
@ -6545,6 +6654,42 @@ paths:
summary: Viewer SalesAgent summary: Viewer SalesAgent
tags: tags:
- SalesAgents - SalesAgents
/sales-agents/{id}/comment:
put:
description: API for comment SalesAgents (only for admin with roleId = 1)
parameters:
- description: Insert the X-Client-Key
in: header
name: X-Client-Key
required: true
type: string
- description: SalesAgents ID
in: path
name: id
required: true
type: integer
responses:
"200":
description: OK
schema:
$ref: "#/definitions/response.Response"
"400":
description: Bad Request
schema:
$ref: "#/definitions/response.BadRequestError"
"401":
description: Unauthorized
schema:
$ref: "#/definitions/response.UnauthorizedError"
"500":
description: Internal Server Error
schema:
$ref: "#/definitions/response.InternalServerError"
security:
- Bearer: []
summary: Comment SalesAgents
tags:
- SalesAgents
/user-levels: /user-levels:
get: get:
description: API for getting all UserLevels description: API for getting all UserLevels