Documentation ¶
Index ¶
- func NewCreateCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewDeleteCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewFindCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewListCoursesHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- func NewUpdateCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
- type CourseResponse
- type CreateCourseRequest
- type CreateCourseResponse
- type DeleteCourseRequest
- type DeleteCourseResponse
- type DeletedCourseResponse
- type FindCourseRequest
- type FindCourseResponse
- type ListCoursesResponse
- type UpdateCourseRequest
- type UpdateCourseResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateCourseHandler ¶
func NewCreateCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewCreateCourseHandler creates new course handler @Summary Create course @Description Create a new course @Tags courses @Accept json @Produce json @Param course body CreateCourseRequest true "Add Course" @Success 200 {object} CreateCourseResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /courses [post].
func NewDeleteCourseHandler ¶
func NewDeleteCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewDeleteCourseHandler deletes course handler @Summary Delete course @Description Delete a new course @Tags courses @Produce json @Param uuid path string true "Course UUID" Format(uuid) @Success 200 {object} DeleteCourseResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /courses/{uuid} [delete].
func NewFindCourseHandler ¶
func NewFindCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewFindCourseHandler find course handler @Summary Find course @Description Find a new course @Tags courses @Produce json @Param uuid path string true "Course UUID" Format(uuid) @Success 200 {object} FindCourseResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /courses/{uuid} [get].
func NewListCoursesHandler ¶
func NewListCoursesHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewListCoursesHandler list courses handler @Summary List courses @Description List a new courses @Tags courses @Produce json @Success 200 {object} ListCoursesResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /courses [get].
func NewUpdateCourseHandler ¶
func NewUpdateCourseHandler(s domain.ServiceInterface, opts ...kithttp.ServerOption) *kithttp.Server
NewUpdateCourseHandler updates new course handler @Summary Update course @Description Update a course @Tags courses @Accept json @Produce json @Param uuid path string true "Course UUID" Format(uuid) @Param course body UpdateCourseRequest true "Update Course" @Success 200 {object} UpdateCourseResponse @Failure 400 {object} error @Failure 404 {object} error @Failure 500 {object} error @Router /courses/{uuid} [put].
Types ¶
type CourseResponse ¶
type CourseResponse struct { UUID uuid.UUID `json:"uuid"` Code string `json:"code"` Name string `json:"name"` Underline string `json:"underline"` Image string `json:"image,omitempty"` ImageCover string `json:"image_cover,omitempty"` Excerpt string `json:"excerpt"` Description string `json:"description,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type CreateCourseRequest ¶
type CreateCourseRequest struct { Code string `json:"code" validate:"required,max=15"` Name string `json:"name" validate:"required,max=100"` Underline string `json:"underline" validate:"required,max=100"` Image string `json:"image"` ImageCover string `json:"image_cover"` Excerpt string `json:"excerpt" validate:"required,max=140"` Description string `json:"description" validate:"required,max=255"` }
type CreateCourseResponse ¶
type CreateCourseResponse struct {
Course *CourseResponse `json:"course"`
}
type DeleteCourseRequest ¶
type DeleteCourseResponse ¶
type DeleteCourseResponse struct {
Course *DeletedCourseResponse `json:"course"`
}
type DeletedCourseResponse ¶
type FindCourseRequest ¶
type FindCourseResponse ¶
type FindCourseResponse struct {
Course *CourseResponse `json:"course"`
}
type ListCoursesResponse ¶
type ListCoursesResponse struct {
Courses []CourseResponse `json:"courses"`
}
type UpdateCourseRequest ¶
type UpdateCourseRequest struct { UUID uuid.UUID `json:"uuid" validate:"required"` Code string `json:"code" validate:"required,max=100"` Name string `json:"name" validate:"required,max=100"` Underline string `json:"underline" validate:"required,max=100"` Image string `json:"image"` ImageCover string `json:"image_cover"` Excerpt string `json:"excerpt" validate:"required,max=140"` Description string `json:"description" validate:"required,max=255"` }
type UpdateCourseResponse ¶
type UpdateCourseResponse struct {
Course *CourseResponse `json:"course"`
}