53 lines
1.8 KiB
Go
53 lines
1.8 KiB
Go
package dto
|
|
|
|
import (
|
|
"errors"
|
|
|
|
// staticDto "github.com/Caknoooo/go-gin-clean-starter/modules/static/dto"
|
|
"github.com/Caknoooo/go-gin-clean-starter/pkg/dto"
|
|
)
|
|
|
|
const (
|
|
MESSAGE_FAILED_CREATE_CATEGORY = "failed create category"
|
|
MESSAGE_SUCCESS_CREATE_CATEGORY = "success create category"
|
|
MESSAGE_FAILED_GET_CATEGORY = "failed get category"
|
|
MESSAGE_SUCCESS_GET_CATEGORY = "success get category"
|
|
MESSAGE_FAILED_UPDATE_CATEGORY = "failed update category"
|
|
MESSAGE_SUCCESS_UPDATE_CATEGORY = "success update category"
|
|
MESSAGE_FAILED_DELETE_CATEGORY = "failed delete category"
|
|
MESSAGE_SUCCESS_DELETE_CATEGORY = "success delete category"
|
|
MESSAGE_FAILED_GET_DATA_FROM_BODY = "failed get data from body"
|
|
)
|
|
|
|
var (
|
|
ErrCreateCategory = errors.New("failed to create category")
|
|
ErrGetCategoryById = errors.New("failed to get category by id")
|
|
ErrUpdateCategory = errors.New("failed to update category")
|
|
ErrDeleteCategory = errors.New("failed to delete category")
|
|
)
|
|
|
|
type CategoryCreateRequest struct {
|
|
Name string `json:"name" binding:"required"`
|
|
SearchKey string `json:"search_key" binding:"required"`
|
|
Description string `json:"description"`
|
|
IsActive bool `json:"is_active"`
|
|
ClientID string `json:"client_id" binding:"required"`
|
|
}
|
|
|
|
type CategoryUpdateRequest struct {
|
|
Name string `json:"name"`
|
|
SearchKey string `json:"search_key"`
|
|
Description string `json:"description"`
|
|
IsActive bool `json:"is_active"`
|
|
ClientID string `json:"client_id"`
|
|
}
|
|
|
|
type CategoryResponse struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
SearchKey string `json:"search_key"`
|
|
Description string `json:"description"`
|
|
IsActive bool `json:"is_active"`
|
|
Client dto.ClientResponse `json:"client"`
|
|
}
|