add category lang,include query params
This commit is contained in:
@@ -23,7 +23,9 @@ type DummyController struct{}
|
||||
// @Tags category
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {array} models.Category
|
||||
// @Param lang query string false "Language code of language that should be returned. Defaults to 'en'"
|
||||
// @Param include query string false "Comma-separated related resources to include"
|
||||
// @Success 200 {array} models.CategoryLocalizedResponse
|
||||
// @Failure 400 {object} httputil.HTTPError
|
||||
// @Router /category/ [get]
|
||||
func (dc *DummyController) ListCategories(c *gin.Context) {}
|
||||
@@ -44,8 +46,10 @@ func (dc *DummyController) CreateCategory(c *gin.Context) {}
|
||||
// @Tags category
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param lang query string false "Language code of language that should be returned. Defaults to 'en'"
|
||||
// @Param include query string false "Comma-separated related resources to include"
|
||||
// @Param id path int true "A unique integer value identifying this category."
|
||||
// @Success 200 {object} models.Category
|
||||
// @Success 200 {object} models.CategoryLocalizedResponse
|
||||
// @Failure 400 {object} httputil.HTTPError
|
||||
// @Router /category/{id} [get]
|
||||
func (dc *DummyController) RetreiveCategory(c *gin.Context) {}
|
||||
|
||||
@@ -20,6 +20,13 @@ type CategoryRequest struct {
|
||||
Translations []CategoryTranslationRequest `json:"translations" binding:"required"`
|
||||
}
|
||||
|
||||
type CategoryLocalizedResponse struct {
|
||||
ID uint `json:"id" binding:"required"`
|
||||
Language string `json:"language" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
Translations []CategoryTranslation `json:"translation"`
|
||||
}
|
||||
|
||||
type CategoryTranslationRequest struct {
|
||||
LanguageID uint `json:"languageId" binding:"required"`
|
||||
Name string `json:"name" binding:"required"`
|
||||
|
||||
Reference in New Issue
Block a user