Documentation ¶
Index ¶
- type CountSystemConfigResponse
- type CreateSystemConfigRequest
- type Handler
- func (h *Handler) CountSystemConfigs(c *gin.Context, log logrus.FieldLogger) (any, error)
- func (h *Handler) CreateSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)
- func (h *Handler) DeleteSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)
- func (h *Handler) FindSystemConfigs(c *gin.Context, log logrus.FieldLogger) (any, error)
- func (h *Handler) GetSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)
- func (h *Handler) UpdateSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)
- type QuerySystemConfigRequest
- type UpdateSystemConfigRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountSystemConfigResponse ¶
type CountSystemConfigResponse struct {
Total int `json:"total"`
}
CountSystemConfigResponse represents the count response structure for configuration of a system.
type CreateSystemConfigRequest ¶
type CreateSystemConfigRequest struct { // Tenant or organization that the system belongs to Tenant string `json:"tenant" binding:"required"` // Environment where the system is deployed (e.g. prod, gray) Env string `json:"env" binding:"required"` // Type or category of the system (e.g. cache, message queue) Type string `json:"type" binding:"required"` // Configuration data in JSON or YAML format Config string `json:"config" binding:"required"` // Description or purpose of the system Description string `json:"description"` // Username or ID of the user who created the system Creator string `json:"creator" binding:"required"` // Username or ID of the user who last modified the system Modifier string `json:"modifier"` }
CreateSystemConfigRequest represents the create request structure for configuration of a system.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(repo repository.SystemConfigRepository) *Handler
func (*Handler) CountSystemConfigs ¶
@Summary Count system configs @Description Count the total number of system configs @Produce json @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/count [get]
func (*Handler) CreateSystemConfig ¶
@Summary Create system config @Description Create a new system config instance @Accept json @Produce json @Param system config body CreateSystemConfigRequest true "Created system config" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig [post]
func (*Handler) DeleteSystemConfig ¶
@Summary Delete system config @Description Delete specified system config by ID @Produce json @Param id path int true "SystemConfig ID" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/{id} [delete]
func (*Handler) FindSystemConfigs ¶
@Summary Find system configs @Description Find system configs with query @Accept json @Produce json @Param query body QuerySystemConfigRequest true "query body" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfigs [get]
func (*Handler) GetSystemConfig ¶
@Summary Get system config @Description Get system config information by system config ID @Produce json @Param id path int true "SystemConfig ID" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/{id} [get]
func (*Handler) UpdateSystemConfig ¶
@Summary Update system config @Description Update the specified system config @Accept json @Produce json @Param system config body UpdateSystemConfigRequest true "Updated system config" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig [put]
type QuerySystemConfigRequest ¶
type QuerySystemConfigRequest struct { handler.Pagination handler.Search }
QuerySystemConfigRequest represents the query request structure for configuration of a system.
type UpdateSystemConfigRequest ¶
type UpdateSystemConfigRequest struct { // Unique ID of the system ID uint `json:"id" binding:"required"` // Tenant or organization that the system belongs to Tenant string `json:"tenant"` // Environment where the system is deployed (e.g. prod, gray) Env string `json:"env"` // Type or category of the system (e.g. cache, message queue) Type string `json:"type"` // Configuration data in JSON or YAML format Config string `json:"config"` // Description or purpose of the system Description string `json:"description"` // Username or ID of the user who created the system Creator string `json:"creator"` // Username or ID of the user who last modified the system Modifier string `json:"modifier"` }
UpdateSystemConfigRequest represents the update request structure for configuration of a system.