feat: update article and add schedule
This commit is contained in:
parent
64ec492df4
commit
37e9622757
|
|
@ -0,0 +1,29 @@
|
||||||
|
package entity
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Schedules struct {
|
||||||
|
ID uint `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
|
||||||
|
Title string `json:"title" gorm:"type:varchar"`
|
||||||
|
Description string `json:"description" gorm:"type:varchar"`
|
||||||
|
Location string `json:"location" gorm:"type:varchar"`
|
||||||
|
IsLiveStreaming *bool `json:"is_live_streaming" gorm:"type:bool;default:false"`
|
||||||
|
LiveStreamingUrl *string `json:"live_streaming_url" gorm:"type:varchar"`
|
||||||
|
TypeId int `json:"type_id" gorm:"type:int4"`
|
||||||
|
StartDate *time.Time `json:"start_date" gorm:"type:date"`
|
||||||
|
EndDate *time.Time `json:"end_date" gorm:"type:date"`
|
||||||
|
StartTime *string `json:"start_time" gorm:"type:varchar"`
|
||||||
|
EndTime *string `json:"end_time" gorm:"type:varchar"`
|
||||||
|
Speakers string `json:"speakers" gorm:"type:varchar"`
|
||||||
|
PosterImagePath *string `json:"poster_image_path" gorm:"type:varchar"`
|
||||||
|
CreatedById *uint `json:"created_by_id" gorm:"type:int4"`
|
||||||
|
StatusId *int `json:"status_id" gorm:"type:int4"`
|
||||||
|
ClientId *uuid.UUID `json:"client_id" gorm:"type:UUID"`
|
||||||
|
IsActive *bool `json:"is_active" gorm:"type:bool;default:true"`
|
||||||
|
CreatedAt time.Time `json:"created_at" gorm:"default:now()"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at" gorm:"default:now()"`
|
||||||
|
}
|
||||||
|
|
@ -116,6 +116,7 @@ func Models() []interface{} {
|
||||||
entity.Provinces{},
|
entity.Provinces{},
|
||||||
entity.OneTimePasswords{},
|
entity.OneTimePasswords{},
|
||||||
entity.Subscription{},
|
entity.Subscription{},
|
||||||
|
entity.Schedules{},
|
||||||
entity.UserLevels{},
|
entity.UserLevels{},
|
||||||
entity.UserRoles{},
|
entity.UserRoles{},
|
||||||
entity.UserRoleAccesses{},
|
entity.UserRoleAccesses{},
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ func (_i *articlesController) All(c *fiber.Ctx) error {
|
||||||
// @Description API for getting one Articles
|
// @Description API for getting one Articles
|
||||||
// @Tags Articles
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string true "Insert the X-Client-Key"
|
||||||
// @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 400 {object} response.BadRequestError
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
|
@ -141,6 +142,7 @@ func (_i *articlesController) Show(c *fiber.Ctx) error {
|
||||||
// @Description API for getting one Articles
|
// @Description API for getting one Articles
|
||||||
// @Tags Articles
|
// @Tags Articles
|
||||||
// @Security Bearer
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string true "Insert the X-Client-Key"
|
||||||
// @Param id path int true "Articles Old ID"
|
// @Param id path int true "Articles Old ID"
|
||||||
// @Success 200 {object} response.Response
|
// @Success 200 {object} response.Response
|
||||||
// @Failure 400 {object} response.BadRequestError
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,235 @@
|
||||||
|
package controller
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"web-medols-be/app/middleware"
|
||||||
|
"web-medols-be/app/module/schedules/request"
|
||||||
|
"web-medols-be/app/module/schedules/service"
|
||||||
|
"web-medols-be/utils/paginator"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"github.com/rs/zerolog"
|
||||||
|
|
||||||
|
utilRes "web-medols-be/utils/response"
|
||||||
|
utilVal "web-medols-be/utils/validator"
|
||||||
|
)
|
||||||
|
|
||||||
|
type schedulesController struct {
|
||||||
|
schedulesService service.SchedulesService
|
||||||
|
Log zerolog.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesController interface {
|
||||||
|
All(c *fiber.Ctx) error
|
||||||
|
Show(c *fiber.Ctx) error
|
||||||
|
Save(c *fiber.Ctx) error
|
||||||
|
Update(c *fiber.Ctx) error
|
||||||
|
Delete(c *fiber.Ctx) error
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSchedulesController(schedulesService service.SchedulesService, log zerolog.Logger) SchedulesController {
|
||||||
|
return &schedulesController{
|
||||||
|
schedulesService: schedulesService,
|
||||||
|
Log: log,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// All Schedules
|
||||||
|
// @Summary Get all Schedules
|
||||||
|
// @Description API for getting all Schedules
|
||||||
|
// @Tags Schedules
|
||||||
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string true "Insert the X-Client-Key"
|
||||||
|
// @Param Authorization header string false "Insert your access token" default(Bearer <Add access token here>)
|
||||||
|
// @Param req query request.SchedulesQueryRequest false "query parameters"
|
||||||
|
// @Param req query paginator.Pagination false "pagination parameters"
|
||||||
|
// @Success 200 {object} response.Response
|
||||||
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
// @Failure 401 {object} response.UnauthorizedError
|
||||||
|
// @Failure 500 {object} response.InternalServerError
|
||||||
|
// @Router /schedules [get]
|
||||||
|
func (_i *schedulesController) All(c *fiber.Ctx) error {
|
||||||
|
paginate, err := paginator.Paginate(c)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
reqContext := request.SchedulesQueryRequestContext{
|
||||||
|
Title: c.Query("title"),
|
||||||
|
Description: c.Query("description"),
|
||||||
|
Location: c.Query("location"),
|
||||||
|
TypeId: c.Query("typeId"),
|
||||||
|
StartDate: c.Query("startDate"),
|
||||||
|
EndDate: c.Query("endDate"),
|
||||||
|
IsLiveStreaming: c.Query("isLiveStreaming"),
|
||||||
|
Speakers: c.Query("speakers"),
|
||||||
|
StatusId: c.Query("statusId"),
|
||||||
|
CreatedById: c.Query("createdById"),
|
||||||
|
}
|
||||||
|
req := reqContext.ToParamRequest()
|
||||||
|
req.Pagination = paginate
|
||||||
|
|
||||||
|
// Get ClientId from context
|
||||||
|
clientId := middleware.GetClientID(c)
|
||||||
|
|
||||||
|
// Get Authorization token from header
|
||||||
|
authToken := c.Get("Authorization")
|
||||||
|
_i.Log.Info().Interface("clientId", clientId).Msg("")
|
||||||
|
_i.Log.Info().Str("authToken", authToken).Msg("")
|
||||||
|
|
||||||
|
schedulesData, paging, err := _i.schedulesService.All(clientId, req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
|
Messages: utilRes.Messages{"Schedules list successfully retrieved"},
|
||||||
|
Data: schedulesData,
|
||||||
|
Meta: paging,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show Schedule
|
||||||
|
// @Summary Get one Schedule
|
||||||
|
// @Description API for getting one Schedule
|
||||||
|
// @Tags Schedules
|
||||||
|
// @Security Bearer
|
||||||
|
// @Param id path int true "Schedule ID"
|
||||||
|
// @Success 200 {object} response.Response
|
||||||
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
// @Failure 401 {object} response.UnauthorizedError
|
||||||
|
// @Failure 500 {object} response.InternalServerError
|
||||||
|
// @Router /schedules/{id} [get]
|
||||||
|
func (_i *schedulesController) Show(c *fiber.Ctx) error {
|
||||||
|
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get ClientId from context
|
||||||
|
clientId := middleware.GetClientID(c)
|
||||||
|
|
||||||
|
scheduleData, err := _i.schedulesService.Show(clientId, uint(id))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
|
Messages: utilRes.Messages{"Schedule successfully retrieved"},
|
||||||
|
Data: scheduleData,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save Schedule
|
||||||
|
// @Summary Create Schedule
|
||||||
|
// @Description API for create Schedule
|
||||||
|
// @Tags Schedules
|
||||||
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string false "Insert the X-Client-Key"
|
||||||
|
// @Param X-Csrf-Token header string false "Insert the X-Csrf-Token"
|
||||||
|
// @Param Authorization header string false "Insert your access token" default(Bearer <Add access token here>)
|
||||||
|
// @Param payload body request.SchedulesCreateRequest true "Required payload"
|
||||||
|
// @Success 200 {object} response.Response
|
||||||
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
// @Failure 401 {object} response.UnauthorizedError
|
||||||
|
// @Failure 500 {object} response.InternalServerError
|
||||||
|
// @Router /schedules [post]
|
||||||
|
func (_i *schedulesController) Save(c *fiber.Ctx) error {
|
||||||
|
req := new(request.SchedulesCreateRequest)
|
||||||
|
if err := utilVal.ParseAndValidate(c, req); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
authToken := c.Get("Authorization")
|
||||||
|
|
||||||
|
// Get ClientId from context
|
||||||
|
clientId := middleware.GetClientID(c)
|
||||||
|
|
||||||
|
_i.Log.Info().Interface("clientId", clientId).Msg("")
|
||||||
|
_i.Log.Info().Interface("authToken", authToken).Msg("")
|
||||||
|
|
||||||
|
dataResult, err := _i.schedulesService.Save(clientId, *req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
|
Messages: utilRes.Messages{"Schedule successfully created"},
|
||||||
|
Data: dataResult,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update Schedule
|
||||||
|
// @Summary Update Schedule
|
||||||
|
// @Description API for update Schedule
|
||||||
|
// @Tags Schedules
|
||||||
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string false "Insert the X-Client-Key"
|
||||||
|
// @Param X-Csrf-Token header string false "Insert the X-Csrf-Token"
|
||||||
|
// @Param payload body request.SchedulesUpdateRequest true "Required payload"
|
||||||
|
// @Param id path int true "Schedule ID"
|
||||||
|
// @Success 200 {object} response.Response
|
||||||
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
// @Failure 401 {object} response.UnauthorizedError
|
||||||
|
// @Failure 500 {object} response.InternalServerError
|
||||||
|
// @Router /schedules/{id} [put]
|
||||||
|
func (_i *schedulesController) Update(c *fiber.Ctx) error {
|
||||||
|
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
req := new(request.SchedulesUpdateRequest)
|
||||||
|
if err := utilVal.ParseAndValidate(c, req); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get ClientId from context
|
||||||
|
clientId := middleware.GetClientID(c)
|
||||||
|
|
||||||
|
err = _i.schedulesService.Update(clientId, uint(id), *req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
|
Messages: utilRes.Messages{"Schedule successfully updated"},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete Schedule
|
||||||
|
// @Summary Delete Schedule
|
||||||
|
// @Description API for delete Schedule
|
||||||
|
// @Tags Schedules
|
||||||
|
// @Security Bearer
|
||||||
|
// @Param X-Client-Key header string false "Insert the X-Client-Key"
|
||||||
|
// @Param X-Csrf-Token header string false "Insert the X-Csrf-Token"
|
||||||
|
// @Param id path int true "Schedule ID"
|
||||||
|
// @Success 200 {object} response.Response
|
||||||
|
// @Failure 400 {object} response.BadRequestError
|
||||||
|
// @Failure 401 {object} response.UnauthorizedError
|
||||||
|
// @Failure 500 {object} response.InternalServerError
|
||||||
|
// @Router /schedules/{id} [delete]
|
||||||
|
func (_i *schedulesController) Delete(c *fiber.Ctx) error {
|
||||||
|
id, err := strconv.ParseUint(c.Params("id"), 10, 0)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get ClientId from context
|
||||||
|
clientId := middleware.GetClientID(c)
|
||||||
|
|
||||||
|
err = _i.schedulesService.Delete(clientId, uint(id))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return utilRes.Resp(c, utilRes.Response{
|
||||||
|
Success: true,
|
||||||
|
Messages: utilRes.Messages{"Schedule successfully deleted"},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package mapper
|
||||||
|
|
||||||
|
import (
|
||||||
|
"web-medols-be/app/database/entity"
|
||||||
|
schedulesResponse "web-medols-be/app/module/schedules/response"
|
||||||
|
)
|
||||||
|
|
||||||
|
func ToSchedulesResponse(schedule *entity.Schedules) *schedulesResponse.SchedulesResponse {
|
||||||
|
return &schedulesResponse.SchedulesResponse{
|
||||||
|
ID: schedule.ID,
|
||||||
|
Title: schedule.Title,
|
||||||
|
Description: schedule.Description,
|
||||||
|
Location: schedule.Location,
|
||||||
|
IsLiveStreaming: schedule.IsLiveStreaming,
|
||||||
|
LiveStreamingUrl: schedule.LiveStreamingUrl,
|
||||||
|
TypeId: schedule.TypeId,
|
||||||
|
StartDate: schedule.StartDate,
|
||||||
|
EndDate: schedule.EndDate,
|
||||||
|
StartTime: schedule.StartTime,
|
||||||
|
EndTime: schedule.EndTime,
|
||||||
|
Speakers: schedule.Speakers,
|
||||||
|
PosterImagePath: schedule.PosterImagePath,
|
||||||
|
CreatedById: schedule.CreatedById,
|
||||||
|
StatusId: schedule.StatusId,
|
||||||
|
IsActive: schedule.IsActive,
|
||||||
|
CreatedAt: schedule.CreatedAt,
|
||||||
|
UpdatedAt: schedule.UpdatedAt,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func ToSchedulesResponseList(schedules []*entity.Schedules) []*schedulesResponse.SchedulesResponse {
|
||||||
|
var responses []*schedulesResponse.SchedulesResponse
|
||||||
|
for _, schedule := range schedules {
|
||||||
|
responses = append(responses, ToSchedulesResponse(schedule))
|
||||||
|
}
|
||||||
|
return responses
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
package repository
|
||||||
|
|
||||||
|
import (
|
||||||
|
"web-medols-be/app/database"
|
||||||
|
"web-medols-be/app/database/entity"
|
||||||
|
"web-medols-be/app/module/schedules/request"
|
||||||
|
"web-medols-be/utils/paginator"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SchedulesRepository interface {
|
||||||
|
All(clientId *uuid.UUID, req request.SchedulesQueryRequest) ([]*entity.Schedules, *paginator.Pagination, error)
|
||||||
|
Show(clientId *uuid.UUID, id uint) (*entity.Schedules, error)
|
||||||
|
Save(clientId *uuid.UUID, schedule *entity.Schedules) (*entity.Schedules, error)
|
||||||
|
Update(clientId *uuid.UUID, id uint, schedule *entity.Schedules) error
|
||||||
|
Delete(clientId *uuid.UUID, id uint) error
|
||||||
|
Count(clientId *uuid.UUID, req request.SchedulesQueryRequest) (int64, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type schedulesRepository struct {
|
||||||
|
db *database.Database
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSchedulesRepository(db *database.Database) SchedulesRepository {
|
||||||
|
return &schedulesRepository{
|
||||||
|
db: db,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) All(clientId *uuid.UUID, req request.SchedulesQueryRequest) ([]*entity.Schedules, *paginator.Pagination, error) {
|
||||||
|
var schedules []*entity.Schedules
|
||||||
|
var total int64
|
||||||
|
|
||||||
|
query := _i.db.DB.Model(&entity.Schedules{})
|
||||||
|
|
||||||
|
// Apply client filter
|
||||||
|
if clientId != nil {
|
||||||
|
query = query.Where("client_id = ?", *clientId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply filters
|
||||||
|
if req.Title != nil {
|
||||||
|
query = query.Where("title ILIKE ?", "%"+*req.Title+"%")
|
||||||
|
}
|
||||||
|
if req.Description != nil {
|
||||||
|
query = query.Where("description ILIKE ?", "%"+*req.Description+"%")
|
||||||
|
}
|
||||||
|
if req.Location != nil {
|
||||||
|
query = query.Where("location ILIKE ?", "%"+*req.Location+"%")
|
||||||
|
}
|
||||||
|
if req.TypeId != nil {
|
||||||
|
query = query.Where("type_id = ?", *req.TypeId)
|
||||||
|
}
|
||||||
|
if req.StartDate != nil {
|
||||||
|
query = query.Where("start_date >= ?", *req.StartDate)
|
||||||
|
}
|
||||||
|
if req.EndDate != nil {
|
||||||
|
query = query.Where("end_date <= ?", *req.EndDate)
|
||||||
|
}
|
||||||
|
if req.IsLiveStreaming != nil {
|
||||||
|
query = query.Where("is_live_streaming = ?", *req.IsLiveStreaming)
|
||||||
|
}
|
||||||
|
if req.Speakers != nil {
|
||||||
|
query = query.Where("speakers ILIKE ?", "%"+*req.Speakers+"%")
|
||||||
|
}
|
||||||
|
if req.StatusId != nil {
|
||||||
|
query = query.Where("status_id = ?", *req.StatusId)
|
||||||
|
}
|
||||||
|
if req.CreatedById != nil {
|
||||||
|
query = query.Where("created_by_id = ?", *req.CreatedById)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count total records
|
||||||
|
if err := query.Count(&total).Error; err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply pagination
|
||||||
|
if req.Pagination != nil {
|
||||||
|
offset := (req.Pagination.Page - 1) * req.Pagination.Limit
|
||||||
|
query = query.Offset(offset).Limit(req.Pagination.Limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Order by created_at desc
|
||||||
|
query = query.Order("created_at DESC")
|
||||||
|
|
||||||
|
// Execute query
|
||||||
|
if err := query.Find(&schedules).Error; err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create pagination response
|
||||||
|
pagination := &paginator.Pagination{
|
||||||
|
Page: req.Pagination.Page,
|
||||||
|
Limit: req.Pagination.Limit,
|
||||||
|
Count: total,
|
||||||
|
TotalPage: int((total + int64(req.Pagination.Limit) - 1) / int64(req.Pagination.Limit)),
|
||||||
|
}
|
||||||
|
|
||||||
|
return schedules, pagination, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) Show(clientId *uuid.UUID, id uint) (*entity.Schedules, error) {
|
||||||
|
var schedule entity.Schedules
|
||||||
|
|
||||||
|
query := _i.db.DB.Model(&entity.Schedules{})
|
||||||
|
|
||||||
|
// Apply client filter
|
||||||
|
if clientId != nil {
|
||||||
|
query = query.Where("client_id = ?", *clientId)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := query.Where("id = ?", id).First(&schedule).Error; err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return &schedule, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) Save(clientId *uuid.UUID, schedule *entity.Schedules) (*entity.Schedules, error) {
|
||||||
|
schedule.ClientId = clientId
|
||||||
|
|
||||||
|
if err := _i.db.DB.Create(schedule).Error; err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return schedule, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) Update(clientId *uuid.UUID, id uint, schedule *entity.Schedules) error {
|
||||||
|
query := _i.db.DB.Model(&entity.Schedules{})
|
||||||
|
|
||||||
|
// Apply client filter
|
||||||
|
if clientId != nil {
|
||||||
|
query = query.Where("client_id = ?", *clientId)
|
||||||
|
}
|
||||||
|
|
||||||
|
return query.Where("id = ?", id).Updates(schedule).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) Delete(clientId *uuid.UUID, id uint) error {
|
||||||
|
query := _i.db.DB.Model(&entity.Schedules{})
|
||||||
|
|
||||||
|
// Apply client filter
|
||||||
|
if clientId != nil {
|
||||||
|
query = query.Where("client_id = ?", *clientId)
|
||||||
|
}
|
||||||
|
|
||||||
|
return query.Where("id = ?", id).Delete(&entity.Schedules{}).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesRepository) Count(clientId *uuid.UUID, req request.SchedulesQueryRequest) (int64, error) {
|
||||||
|
var total int64
|
||||||
|
|
||||||
|
query := _i.db.DB.Model(&entity.Schedules{})
|
||||||
|
|
||||||
|
// Apply client filter
|
||||||
|
if clientId != nil {
|
||||||
|
query = query.Where("client_id = ?", *clientId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply filters
|
||||||
|
if req.Title != nil {
|
||||||
|
query = query.Where("title ILIKE ?", "%"+*req.Title+"%")
|
||||||
|
}
|
||||||
|
if req.Description != nil {
|
||||||
|
query = query.Where("description ILIKE ?", "%"+*req.Description+"%")
|
||||||
|
}
|
||||||
|
if req.Location != nil {
|
||||||
|
query = query.Where("location ILIKE ?", "%"+*req.Location+"%")
|
||||||
|
}
|
||||||
|
if req.TypeId != nil {
|
||||||
|
query = query.Where("type_id = ?", *req.TypeId)
|
||||||
|
}
|
||||||
|
if req.StartDate != nil {
|
||||||
|
query = query.Where("start_date >= ?", *req.StartDate)
|
||||||
|
}
|
||||||
|
if req.EndDate != nil {
|
||||||
|
query = query.Where("end_date <= ?", *req.EndDate)
|
||||||
|
}
|
||||||
|
if req.IsLiveStreaming != nil {
|
||||||
|
query = query.Where("is_live_streaming = ?", *req.IsLiveStreaming)
|
||||||
|
}
|
||||||
|
if req.Speakers != nil {
|
||||||
|
query = query.Where("speakers ILIKE ?", "%"+*req.Speakers+"%")
|
||||||
|
}
|
||||||
|
if req.StatusId != nil {
|
||||||
|
query = query.Where("status_id = ?", *req.StatusId)
|
||||||
|
}
|
||||||
|
if req.CreatedById != nil {
|
||||||
|
query = query.Where("created_by_id = ?", *req.CreatedById)
|
||||||
|
}
|
||||||
|
|
||||||
|
return total, query.Count(&total).Error
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,162 @@
|
||||||
|
package request
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
"web-medols-be/app/database/entity"
|
||||||
|
"web-medols-be/utils/paginator"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SchedulesGeneric interface {
|
||||||
|
ToEntity()
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesQueryRequest struct {
|
||||||
|
Title *string `json:"title"`
|
||||||
|
Description *string `json:"description"`
|
||||||
|
Location *string `json:"location"`
|
||||||
|
TypeId *int `json:"typeId"`
|
||||||
|
StartDate *time.Time `json:"startDate"`
|
||||||
|
EndDate *time.Time `json:"endDate"`
|
||||||
|
IsLiveStreaming *bool `json:"isLiveStreaming"`
|
||||||
|
Speakers *string `json:"speakers"`
|
||||||
|
StatusId *int `json:"statusId"`
|
||||||
|
CreatedById *uint `json:"createdById"`
|
||||||
|
Pagination *paginator.Pagination `json:"pagination"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesCreateRequest struct {
|
||||||
|
Title string `json:"title" validate:"required"`
|
||||||
|
Description string `json:"description" validate:"required"`
|
||||||
|
Location string `json:"location" validate:"required"`
|
||||||
|
IsLiveStreaming *bool `json:"isLiveStreaming"`
|
||||||
|
LiveStreamingUrl *string `json:"liveStreamingUrl"`
|
||||||
|
TypeId int `json:"typeId" validate:"required"`
|
||||||
|
StartDate *time.Time `json:"startDate"`
|
||||||
|
EndDate *time.Time `json:"endDate"`
|
||||||
|
StartTime *string `json:"startTime"`
|
||||||
|
EndTime *string `json:"endTime"`
|
||||||
|
Speakers string `json:"speakers" validate:"required"`
|
||||||
|
PosterImagePath *string `json:"posterImagePath"`
|
||||||
|
CreatedById *uint `json:"createdById"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (req SchedulesCreateRequest) ToEntity() *entity.Schedules {
|
||||||
|
return &entity.Schedules{
|
||||||
|
Title: req.Title,
|
||||||
|
Description: req.Description,
|
||||||
|
Location: req.Location,
|
||||||
|
IsLiveStreaming: req.IsLiveStreaming,
|
||||||
|
LiveStreamingUrl: req.LiveStreamingUrl,
|
||||||
|
TypeId: req.TypeId,
|
||||||
|
StartDate: req.StartDate,
|
||||||
|
EndDate: req.EndDate,
|
||||||
|
StartTime: req.StartTime,
|
||||||
|
EndTime: req.EndTime,
|
||||||
|
Speakers: req.Speakers,
|
||||||
|
PosterImagePath: req.PosterImagePath,
|
||||||
|
CreatedById: req.CreatedById,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesUpdateRequest struct {
|
||||||
|
Title string `json:"title" validate:"required"`
|
||||||
|
Description string `json:"description" validate:"required"`
|
||||||
|
Location string `json:"location" validate:"required"`
|
||||||
|
IsLiveStreaming *bool `json:"isLiveStreaming"`
|
||||||
|
LiveStreamingUrl *string `json:"liveStreamingUrl"`
|
||||||
|
TypeId int `json:"typeId" validate:"required"`
|
||||||
|
StartDate *time.Time `json:"startDate"`
|
||||||
|
EndDate *time.Time `json:"endDate"`
|
||||||
|
StartTime *string `json:"startTime"`
|
||||||
|
EndTime *string `json:"endTime"`
|
||||||
|
Speakers string `json:"speakers" validate:"required"`
|
||||||
|
PosterImagePath *string `json:"posterImagePath"`
|
||||||
|
StatusId *int `json:"statusId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (req SchedulesUpdateRequest) ToEntity() *entity.Schedules {
|
||||||
|
return &entity.Schedules{
|
||||||
|
Title: req.Title,
|
||||||
|
Description: req.Description,
|
||||||
|
Location: req.Location,
|
||||||
|
IsLiveStreaming: req.IsLiveStreaming,
|
||||||
|
LiveStreamingUrl: req.LiveStreamingUrl,
|
||||||
|
TypeId: req.TypeId,
|
||||||
|
StartDate: req.StartDate,
|
||||||
|
EndDate: req.EndDate,
|
||||||
|
StartTime: req.StartTime,
|
||||||
|
EndTime: req.EndTime,
|
||||||
|
Speakers: req.Speakers,
|
||||||
|
PosterImagePath: req.PosterImagePath,
|
||||||
|
StatusId: req.StatusId,
|
||||||
|
UpdatedAt: time.Now(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesQueryRequestContext struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Location string `json:"location"`
|
||||||
|
TypeId string `json:"typeId"`
|
||||||
|
StartDate string `json:"startDate"`
|
||||||
|
EndDate string `json:"endDate"`
|
||||||
|
IsLiveStreaming string `json:"isLiveStreaming"`
|
||||||
|
Speakers string `json:"speakers"`
|
||||||
|
StatusId string `json:"statusId"`
|
||||||
|
CreatedById string `json:"createdById"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (req SchedulesQueryRequestContext) ToParamRequest() SchedulesQueryRequest {
|
||||||
|
var request SchedulesQueryRequest
|
||||||
|
|
||||||
|
if title := req.Title; title != "" {
|
||||||
|
request.Title = &title
|
||||||
|
}
|
||||||
|
if description := req.Description; description != "" {
|
||||||
|
request.Description = &description
|
||||||
|
}
|
||||||
|
if location := req.Location; location != "" {
|
||||||
|
request.Location = &location
|
||||||
|
}
|
||||||
|
if typeIdStr := req.TypeId; typeIdStr != "" {
|
||||||
|
typeId, err := strconv.Atoi(typeIdStr)
|
||||||
|
if err == nil {
|
||||||
|
request.TypeId = &typeId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if startDateStr := req.StartDate; startDateStr != "" {
|
||||||
|
if startDate, err := time.Parse("2006-01-02", startDateStr); err == nil {
|
||||||
|
request.StartDate = &startDate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if endDateStr := req.EndDate; endDateStr != "" {
|
||||||
|
if endDate, err := time.Parse("2006-01-02", endDateStr); err == nil {
|
||||||
|
request.EndDate = &endDate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if isLiveStreamingStr := req.IsLiveStreaming; isLiveStreamingStr != "" {
|
||||||
|
isLiveStreaming, err := strconv.ParseBool(isLiveStreamingStr)
|
||||||
|
if err == nil {
|
||||||
|
request.IsLiveStreaming = &isLiveStreaming
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if speakers := req.Speakers; speakers != "" {
|
||||||
|
request.Speakers = &speakers
|
||||||
|
}
|
||||||
|
if statusIdStr := req.StatusId; statusIdStr != "" {
|
||||||
|
statusId, err := strconv.Atoi(statusIdStr)
|
||||||
|
if err == nil {
|
||||||
|
request.StatusId = &statusId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if createdByIdStr := req.CreatedById; createdByIdStr != "" {
|
||||||
|
createdById, err := strconv.Atoi(createdByIdStr)
|
||||||
|
if err == nil {
|
||||||
|
createdByIdUint := uint(createdById)
|
||||||
|
request.CreatedById = &createdByIdUint
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return request
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package response
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SchedulesResponse struct {
|
||||||
|
ID uint `json:"id"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Location string `json:"location"`
|
||||||
|
IsLiveStreaming *bool `json:"isLiveStreaming"`
|
||||||
|
LiveStreamingUrl *string `json:"liveStreamingUrl"`
|
||||||
|
TypeId int `json:"typeId"`
|
||||||
|
TypeName string `json:"typeName"`
|
||||||
|
StartDate *time.Time `json:"startDate"`
|
||||||
|
EndDate *time.Time `json:"endDate"`
|
||||||
|
StartTime *string `json:"startTime"`
|
||||||
|
EndTime *string `json:"endTime"`
|
||||||
|
Speakers string `json:"speakers"`
|
||||||
|
PosterImagePath *string `json:"posterImagePath"`
|
||||||
|
CreatedById *uint `json:"createdById"`
|
||||||
|
CreatedByName *string `json:"createdByName"`
|
||||||
|
StatusId *int `json:"statusId"`
|
||||||
|
StatusName *string `json:"statusName"`
|
||||||
|
IsActive *bool `json:"isActive"`
|
||||||
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SchedulesSummaryStats struct {
|
||||||
|
TotalToday int `json:"totalToday"`
|
||||||
|
TotalThisWeek int `json:"totalThisWeek"`
|
||||||
|
TotalAll int `json:"totalAll"`
|
||||||
|
TotalLive int `json:"totalLive"`
|
||||||
|
TotalUpcoming int `json:"totalUpcoming"`
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
package schedules
|
||||||
|
|
||||||
|
import (
|
||||||
|
"web-medols-be/app/middleware"
|
||||||
|
"web-medols-be/app/module/schedules/controller"
|
||||||
|
"web-medols-be/app/module/schedules/repository"
|
||||||
|
"web-medols-be/app/module/schedules/service"
|
||||||
|
usersRepo "web-medols-be/app/module/users/repository"
|
||||||
|
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
"go.uber.org/fx"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SchedulesRouter struct of SchedulesRouter
|
||||||
|
type SchedulesRouter struct {
|
||||||
|
App fiber.Router
|
||||||
|
Controller controller.SchedulesController
|
||||||
|
UsersRepo usersRepo.UsersRepository
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewSchedulesModule register bulky of Schedules module
|
||||||
|
var NewSchedulesModule = fx.Options(
|
||||||
|
// register repository of Schedules module
|
||||||
|
fx.Provide(repository.NewSchedulesRepository),
|
||||||
|
|
||||||
|
// register service of Schedules module
|
||||||
|
fx.Provide(service.NewSchedulesService),
|
||||||
|
|
||||||
|
// register controller of Schedules module
|
||||||
|
fx.Provide(controller.NewSchedulesController),
|
||||||
|
|
||||||
|
// register router of Schedules module
|
||||||
|
fx.Provide(NewSchedulesRouter),
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewSchedulesRouter init SchedulesRouter
|
||||||
|
func NewSchedulesRouter(fiber *fiber.App, controller controller.SchedulesController, usersRepo usersRepo.UsersRepository) *SchedulesRouter {
|
||||||
|
return &SchedulesRouter{
|
||||||
|
App: fiber,
|
||||||
|
Controller: controller,
|
||||||
|
UsersRepo: usersRepo,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterSchedulesRoutes register routes of Schedules module
|
||||||
|
func (_i *SchedulesRouter) RegisterSchedulesRoutes() {
|
||||||
|
// define controllers
|
||||||
|
schedulesController := _i.Controller
|
||||||
|
|
||||||
|
// define routes
|
||||||
|
_i.App.Route("/schedules", func(router fiber.Router) {
|
||||||
|
// Add user middleware to extract user level from JWT token
|
||||||
|
router.Use(middleware.UserMiddleware(_i.UsersRepo))
|
||||||
|
router.Get("/", schedulesController.All)
|
||||||
|
router.Get("/:id", schedulesController.Show)
|
||||||
|
router.Post("/", schedulesController.Save)
|
||||||
|
router.Put("/:id", schedulesController.Update)
|
||||||
|
router.Delete("/:id", schedulesController.Delete)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,131 @@
|
||||||
|
package service
|
||||||
|
|
||||||
|
import (
|
||||||
|
"web-medols-be/app/module/schedules/mapper"
|
||||||
|
"web-medols-be/app/module/schedules/repository"
|
||||||
|
"web-medols-be/app/module/schedules/request"
|
||||||
|
schedulesResponse "web-medols-be/app/module/schedules/response"
|
||||||
|
"web-medols-be/utils/paginator"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SchedulesService interface {
|
||||||
|
All(clientId *uuid.UUID, req request.SchedulesQueryRequest) ([]*schedulesResponse.SchedulesResponse, *paginator.Pagination, error)
|
||||||
|
Show(clientId *uuid.UUID, id uint) (*schedulesResponse.SchedulesResponse, error)
|
||||||
|
Save(clientId *uuid.UUID, req request.SchedulesCreateRequest) (*schedulesResponse.SchedulesResponse, error)
|
||||||
|
Update(clientId *uuid.UUID, id uint, req request.SchedulesUpdateRequest) error
|
||||||
|
Delete(clientId *uuid.UUID, id uint) error
|
||||||
|
SummaryStats(clientId *uuid.UUID) (*schedulesResponse.SchedulesSummaryStats, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type schedulesService struct {
|
||||||
|
schedulesRepository repository.SchedulesRepository
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewSchedulesService(schedulesRepository repository.SchedulesRepository) SchedulesService {
|
||||||
|
return &schedulesService{
|
||||||
|
schedulesRepository: schedulesRepository,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) All(clientId *uuid.UUID, req request.SchedulesQueryRequest) ([]*schedulesResponse.SchedulesResponse, *paginator.Pagination, error) {
|
||||||
|
schedules, pagination, err := _i.schedulesRepository.All(clientId, req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
responses := mapper.ToSchedulesResponseList(schedules)
|
||||||
|
return responses, pagination, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) Show(clientId *uuid.UUID, id uint) (*schedulesResponse.SchedulesResponse, error) {
|
||||||
|
schedule, err := _i.schedulesRepository.Show(clientId, id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
response := mapper.ToSchedulesResponse(schedule)
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) Save(clientId *uuid.UUID, req request.SchedulesCreateRequest) (*schedulesResponse.SchedulesResponse, error) {
|
||||||
|
schedule := req.ToEntity()
|
||||||
|
|
||||||
|
savedSchedule, err := _i.schedulesRepository.Save(clientId, schedule)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
response := mapper.ToSchedulesResponse(savedSchedule)
|
||||||
|
return response, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) Update(clientId *uuid.UUID, id uint, req request.SchedulesUpdateRequest) error {
|
||||||
|
schedule := req.ToEntity()
|
||||||
|
|
||||||
|
err := _i.schedulesRepository.Update(clientId, id, schedule)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) Delete(clientId *uuid.UUID, id uint) error {
|
||||||
|
err := _i.schedulesRepository.Delete(clientId, id)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (_i *schedulesService) SummaryStats(clientId *uuid.UUID) (*schedulesResponse.SchedulesSummaryStats, error) {
|
||||||
|
// Get today's count
|
||||||
|
todayReq := request.SchedulesQueryRequest{}
|
||||||
|
todayCount, err := _i.schedulesRepository.Count(clientId, todayReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get this week's count
|
||||||
|
weekReq := request.SchedulesQueryRequest{}
|
||||||
|
weekCount, err := _i.schedulesRepository.Count(clientId, weekReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get total count
|
||||||
|
totalReq := request.SchedulesQueryRequest{}
|
||||||
|
totalCount, err := _i.schedulesRepository.Count(clientId, totalReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get live streaming count
|
||||||
|
liveReq := request.SchedulesQueryRequest{
|
||||||
|
IsLiveStreaming: &[]bool{true}[0],
|
||||||
|
}
|
||||||
|
liveCount, err := _i.schedulesRepository.Count(clientId, liveReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get upcoming count (start_date > today)
|
||||||
|
upcomingReq := request.SchedulesQueryRequest{}
|
||||||
|
upcomingCount, err := _i.schedulesRepository.Count(clientId, upcomingReq)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
stats := &schedulesResponse.SchedulesSummaryStats{
|
||||||
|
TotalToday: int(todayCount),
|
||||||
|
TotalThisWeek: int(weekCount),
|
||||||
|
TotalAll: int(totalCount),
|
||||||
|
TotalLive: int(liveCount),
|
||||||
|
TotalUpcoming: int(upcomingCount),
|
||||||
|
}
|
||||||
|
|
||||||
|
return stats, nil
|
||||||
|
}
|
||||||
|
|
@ -26,6 +26,7 @@ import (
|
||||||
"web-medols-be/app/module/master_menus"
|
"web-medols-be/app/module/master_menus"
|
||||||
"web-medols-be/app/module/master_modules"
|
"web-medols-be/app/module/master_modules"
|
||||||
"web-medols-be/app/module/provinces"
|
"web-medols-be/app/module/provinces"
|
||||||
|
"web-medols-be/app/module/schedules"
|
||||||
"web-medols-be/app/module/subscription"
|
"web-medols-be/app/module/subscription"
|
||||||
"web-medols-be/app/module/user_levels"
|
"web-medols-be/app/module/user_levels"
|
||||||
"web-medols-be/app/module/user_role_accesses"
|
"web-medols-be/app/module/user_role_accesses"
|
||||||
|
|
@ -67,6 +68,7 @@ type Router struct {
|
||||||
MasterMenusRouter *master_menus.MasterMenusRouter
|
MasterMenusRouter *master_menus.MasterMenusRouter
|
||||||
MasterModulesRouter *master_modules.MasterModulesRouter
|
MasterModulesRouter *master_modules.MasterModulesRouter
|
||||||
ProvincesRouter *provinces.ProvincesRouter
|
ProvincesRouter *provinces.ProvincesRouter
|
||||||
|
SchedulesRouter *schedules.SchedulesRouter
|
||||||
SubscriptionRouter *subscription.SubscriptionRouter
|
SubscriptionRouter *subscription.SubscriptionRouter
|
||||||
UserLevelsRouter *user_levels.UserLevelsRouter
|
UserLevelsRouter *user_levels.UserLevelsRouter
|
||||||
UserRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter
|
UserRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter
|
||||||
|
|
@ -103,6 +105,7 @@ func NewRouter(
|
||||||
masterMenuRouter *master_menus.MasterMenusRouter,
|
masterMenuRouter *master_menus.MasterMenusRouter,
|
||||||
masterModuleRouter *master_modules.MasterModulesRouter,
|
masterModuleRouter *master_modules.MasterModulesRouter,
|
||||||
provincesRouter *provinces.ProvincesRouter,
|
provincesRouter *provinces.ProvincesRouter,
|
||||||
|
schedulesRouter *schedules.SchedulesRouter,
|
||||||
subscriptionRouter *subscription.SubscriptionRouter,
|
subscriptionRouter *subscription.SubscriptionRouter,
|
||||||
userLevelsRouter *user_levels.UserLevelsRouter,
|
userLevelsRouter *user_levels.UserLevelsRouter,
|
||||||
userRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter,
|
userRoleAccessesRouter *user_role_accesses.UserRoleAccessesRouter,
|
||||||
|
|
@ -137,6 +140,7 @@ func NewRouter(
|
||||||
MasterMenusRouter: masterMenuRouter,
|
MasterMenusRouter: masterMenuRouter,
|
||||||
MasterModulesRouter: masterModuleRouter,
|
MasterModulesRouter: masterModuleRouter,
|
||||||
ProvincesRouter: provincesRouter,
|
ProvincesRouter: provincesRouter,
|
||||||
|
SchedulesRouter: schedulesRouter,
|
||||||
SubscriptionRouter: subscriptionRouter,
|
SubscriptionRouter: subscriptionRouter,
|
||||||
UserLevelsRouter: userLevelsRouter,
|
UserLevelsRouter: userLevelsRouter,
|
||||||
UserRoleAccessesRouter: userRoleAccessesRouter,
|
UserRoleAccessesRouter: userRoleAccessesRouter,
|
||||||
|
|
@ -181,6 +185,7 @@ func (r *Router) Register() {
|
||||||
r.MasterMenusRouter.RegisterMasterMenusRoutes()
|
r.MasterMenusRouter.RegisterMasterMenusRoutes()
|
||||||
r.MasterModulesRouter.RegisterMasterModulesRoutes()
|
r.MasterModulesRouter.RegisterMasterModulesRoutes()
|
||||||
r.ProvincesRouter.RegisterProvincesRoutes()
|
r.ProvincesRouter.RegisterProvincesRoutes()
|
||||||
|
r.SchedulesRouter.RegisterSchedulesRoutes()
|
||||||
r.SubscriptionRouter.RegisterSubscriptionRoutes()
|
r.SubscriptionRouter.RegisterSubscriptionRoutes()
|
||||||
r.UserLevelsRouter.RegisterUserLevelsRoutes()
|
r.UserLevelsRouter.RegisterUserLevelsRoutes()
|
||||||
r.UserRoleAccessesRouter.RegisterUserRoleAccessesRoutes()
|
r.UserRoleAccessesRouter.RegisterUserRoleAccessesRoutes()
|
||||||
|
|
|
||||||
|
|
@ -7097,6 +7097,13 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles Old ID",
|
"description": "Articles Old ID",
|
||||||
|
|
@ -7641,6 +7648,13 @@ const docTemplate = `{
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles ID",
|
"description": "Articles ID",
|
||||||
|
|
@ -12718,6 +12732,396 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/schedules": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for getting all Schedules",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Get all Schedules",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
|
"description": "Insert your access token",
|
||||||
|
"name": "Authorization",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "createdById",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "description",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "endDate",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "isLiveStreaming",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "location",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "speakers",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "startDate",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "statusId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "title",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "typeId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "count",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "nextPage",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "page",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "previousPage",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "sort",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "sortBy",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "totalPage",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for create Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Create Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
|
"description": "Insert your access token",
|
||||||
|
"name": "Authorization",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.SchedulesCreateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/schedules/{id}": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for getting one Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Get one Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for update Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Update Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.SchedulesUpdateRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for delete Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Delete Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/subscription": {
|
"/subscription": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
|
@ -16855,6 +17259,108 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.SchedulesCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"location",
|
||||||
|
"speakers",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isLiveStreaming": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"liveStreamingUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"posterImagePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"speakers": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"request.SchedulesUpdateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"location",
|
||||||
|
"speakers",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isLiveStreaming": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"liveStreamingUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"posterImagePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"speakers": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"statusId": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.SetDefaultWorkflowRequest": {
|
"request.SetDefaultWorkflowRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
|
|
@ -7086,6 +7086,13 @@
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles Old ID",
|
"description": "Articles Old ID",
|
||||||
|
|
@ -7630,6 +7637,13 @@
|
||||||
],
|
],
|
||||||
"summary": "Get one Articles",
|
"summary": "Get one Articles",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"description": "Articles ID",
|
"description": "Articles ID",
|
||||||
|
|
@ -12707,6 +12721,396 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/schedules": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for getting all Schedules",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Get all Schedules",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header",
|
||||||
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
|
"description": "Insert your access token",
|
||||||
|
"name": "Authorization",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "createdById",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "description",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "endDate",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"name": "isLiveStreaming",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "location",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "speakers",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "startDate",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "statusId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "title",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "typeId",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "count",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "nextPage",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "page",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "previousPage",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "sort",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"name": "sortBy",
|
||||||
|
"in": "query"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"name": "totalPage",
|
||||||
|
"in": "query"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"post": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for create Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Create Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"default": "Bearer \u003cAdd access token here\u003e",
|
||||||
|
"description": "Insert your access token",
|
||||||
|
"name": "Authorization",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.SchedulesCreateRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/schedules/{id}": {
|
||||||
|
"get": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for getting one Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Get one Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"put": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for update Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Update Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Required payload",
|
||||||
|
"name": "payload",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/request.SchedulesUpdateRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delete": {
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"Bearer": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "API for delete Schedule",
|
||||||
|
"tags": [
|
||||||
|
"Schedules"
|
||||||
|
],
|
||||||
|
"summary": "Delete Schedule",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Client-Key",
|
||||||
|
"name": "X-Client-Key",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"description": "Insert the X-Csrf-Token",
|
||||||
|
"name": "X-Csrf-Token",
|
||||||
|
"in": "header"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Schedule 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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/subscription": {
|
"/subscription": {
|
||||||
"get": {
|
"get": {
|
||||||
"security": [
|
"security": [
|
||||||
|
|
@ -16844,6 +17248,108 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"request.SchedulesCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"location",
|
||||||
|
"speakers",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"createdById": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isLiveStreaming": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"liveStreamingUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"posterImagePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"speakers": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"request.SchedulesUpdateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"description",
|
||||||
|
"location",
|
||||||
|
"speakers",
|
||||||
|
"title",
|
||||||
|
"typeId"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"description": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"endTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"isLiveStreaming": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
"liveStreamingUrl": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"location": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"posterImagePath": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"speakers": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startDate": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"startTime": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"statusId": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"typeId": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"request.SetDefaultWorkflowRequest": {
|
"request.SetDefaultWorkflowRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
||||||
|
|
@ -941,6 +941,76 @@ definitions:
|
||||||
required:
|
required:
|
||||||
- message
|
- message
|
||||||
type: object
|
type: object
|
||||||
|
request.SchedulesCreateRequest:
|
||||||
|
properties:
|
||||||
|
createdById:
|
||||||
|
type: integer
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
endDate:
|
||||||
|
type: string
|
||||||
|
endTime:
|
||||||
|
type: string
|
||||||
|
isLiveStreaming:
|
||||||
|
type: boolean
|
||||||
|
liveStreamingUrl:
|
||||||
|
type: string
|
||||||
|
location:
|
||||||
|
type: string
|
||||||
|
posterImagePath:
|
||||||
|
type: string
|
||||||
|
speakers:
|
||||||
|
type: string
|
||||||
|
startDate:
|
||||||
|
type: string
|
||||||
|
startTime:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
typeId:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- description
|
||||||
|
- location
|
||||||
|
- speakers
|
||||||
|
- title
|
||||||
|
- typeId
|
||||||
|
type: object
|
||||||
|
request.SchedulesUpdateRequest:
|
||||||
|
properties:
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
endDate:
|
||||||
|
type: string
|
||||||
|
endTime:
|
||||||
|
type: string
|
||||||
|
isLiveStreaming:
|
||||||
|
type: boolean
|
||||||
|
liveStreamingUrl:
|
||||||
|
type: string
|
||||||
|
location:
|
||||||
|
type: string
|
||||||
|
posterImagePath:
|
||||||
|
type: string
|
||||||
|
speakers:
|
||||||
|
type: string
|
||||||
|
startDate:
|
||||||
|
type: string
|
||||||
|
startTime:
|
||||||
|
type: string
|
||||||
|
statusId:
|
||||||
|
type: integer
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
typeId:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- description
|
||||||
|
- location
|
||||||
|
- speakers
|
||||||
|
- title
|
||||||
|
- typeId
|
||||||
|
type: object
|
||||||
request.SetDefaultWorkflowRequest:
|
request.SetDefaultWorkflowRequest:
|
||||||
properties:
|
properties:
|
||||||
workflow_id:
|
workflow_id:
|
||||||
|
|
@ -5904,6 +5974,11 @@ paths:
|
||||||
get:
|
get:
|
||||||
description: API for getting one Articles
|
description: API for getting one Articles
|
||||||
parameters:
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
- description: Articles ID
|
- description: Articles ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
|
|
@ -6113,6 +6188,11 @@ paths:
|
||||||
get:
|
get:
|
||||||
description: API for getting one Articles
|
description: API for getting one Articles
|
||||||
parameters:
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
- description: Articles Old ID
|
- description: Articles Old ID
|
||||||
in: path
|
in: path
|
||||||
name: id
|
name: id
|
||||||
|
|
@ -9497,6 +9577,253 @@ paths:
|
||||||
summary: Update Provinces
|
summary: Update Provinces
|
||||||
tags:
|
tags:
|
||||||
- Untags
|
- Untags
|
||||||
|
/schedules:
|
||||||
|
get:
|
||||||
|
description: API for getting all Schedules
|
||||||
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
- default: Bearer <Add access token here>
|
||||||
|
description: Insert your access token
|
||||||
|
in: header
|
||||||
|
name: Authorization
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: createdById
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: description
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: endDate
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: isLiveStreaming
|
||||||
|
type: boolean
|
||||||
|
- in: query
|
||||||
|
name: location
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: speakers
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: startDate
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: statusId
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: title
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: typeId
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: count
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: limit
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: nextPage
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: page
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: previousPage
|
||||||
|
type: integer
|
||||||
|
- in: query
|
||||||
|
name: sort
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: sortBy
|
||||||
|
type: string
|
||||||
|
- in: query
|
||||||
|
name: totalPage
|
||||||
|
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: Get all Schedules
|
||||||
|
tags:
|
||||||
|
- Schedules
|
||||||
|
post:
|
||||||
|
description: API for create Schedule
|
||||||
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
type: string
|
||||||
|
- description: Insert the X-Csrf-Token
|
||||||
|
in: header
|
||||||
|
name: X-Csrf-Token
|
||||||
|
type: string
|
||||||
|
- default: Bearer <Add access token here>
|
||||||
|
description: Insert your access token
|
||||||
|
in: header
|
||||||
|
name: Authorization
|
||||||
|
type: string
|
||||||
|
- description: Required payload
|
||||||
|
in: body
|
||||||
|
name: payload
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/request.SchedulesCreateRequest'
|
||||||
|
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: Create Schedule
|
||||||
|
tags:
|
||||||
|
- Schedules
|
||||||
|
/schedules/{id}:
|
||||||
|
delete:
|
||||||
|
description: API for delete Schedule
|
||||||
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
type: string
|
||||||
|
- description: Insert the X-Csrf-Token
|
||||||
|
in: header
|
||||||
|
name: X-Csrf-Token
|
||||||
|
type: string
|
||||||
|
- description: Schedule 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: Delete Schedule
|
||||||
|
tags:
|
||||||
|
- Schedules
|
||||||
|
get:
|
||||||
|
description: API for getting one Schedule
|
||||||
|
parameters:
|
||||||
|
- description: Schedule 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: Get one Schedule
|
||||||
|
tags:
|
||||||
|
- Schedules
|
||||||
|
put:
|
||||||
|
description: API for update Schedule
|
||||||
|
parameters:
|
||||||
|
- description: Insert the X-Client-Key
|
||||||
|
in: header
|
||||||
|
name: X-Client-Key
|
||||||
|
type: string
|
||||||
|
- description: Insert the X-Csrf-Token
|
||||||
|
in: header
|
||||||
|
name: X-Csrf-Token
|
||||||
|
type: string
|
||||||
|
- description: Required payload
|
||||||
|
in: body
|
||||||
|
name: payload
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/request.SchedulesUpdateRequest'
|
||||||
|
- description: Schedule 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: Update Schedule
|
||||||
|
tags:
|
||||||
|
- Schedules
|
||||||
/subscription:
|
/subscription:
|
||||||
get:
|
get:
|
||||||
description: API for getting all Subscription
|
description: API for getting all Subscription
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -29,6 +29,7 @@ import (
|
||||||
"web-medols-be/app/module/master_menus"
|
"web-medols-be/app/module/master_menus"
|
||||||
"web-medols-be/app/module/master_modules"
|
"web-medols-be/app/module/master_modules"
|
||||||
"web-medols-be/app/module/provinces"
|
"web-medols-be/app/module/provinces"
|
||||||
|
"web-medols-be/app/module/schedules"
|
||||||
"web-medols-be/app/module/subscription"
|
"web-medols-be/app/module/subscription"
|
||||||
"web-medols-be/app/module/user_levels"
|
"web-medols-be/app/module/user_levels"
|
||||||
"web-medols-be/app/module/user_role_accesses"
|
"web-medols-be/app/module/user_role_accesses"
|
||||||
|
|
@ -93,6 +94,7 @@ func main() {
|
||||||
master_menus.NewMasterMenusModule,
|
master_menus.NewMasterMenusModule,
|
||||||
master_modules.NewMasterModulesModule,
|
master_modules.NewMasterModulesModule,
|
||||||
provinces.NewProvincesModule,
|
provinces.NewProvincesModule,
|
||||||
|
schedules.NewSchedulesModule,
|
||||||
subscription.NewSubscriptionModule,
|
subscription.NewSubscriptionModule,
|
||||||
user_levels.NewUserLevelsModule,
|
user_levels.NewUserLevelsModule,
|
||||||
user_roles.NewUserRolesModule,
|
user_roles.NewUserRolesModule,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue