Documentation
¶
Overview ¶
Package entity provides DTOs for entity operations.
Index ¶
- type EntitiesListRequest
- type EntitiesListResponse
- type EntityCreateRequest
- type EntityCreateResponse
- type EntityDeleteRequest
- type EntityDeleteResponse
- type EntityDetailRequest
- type EntityDetailResponse
- type EntityFunction
- type EntityFunctionsRequest
- type EntityFunctionsResponse
- type EntityItem
- type EntityPreviewRequest
- type EntityPreviewResponse
- type EntityUpdateRequest
- type EntityUpdateResponse
- type EntityValidateRequest
- type EntityValidateResponse
- type Handler
- func (h *Handler) Create(c *gin.Context)
- func (h *Handler) Delete(c *gin.Context)
- func (h *Handler) Detail(c *gin.Context)
- func (h *Handler) Get(c *gin.Context)
- func (h *Handler) List(c *gin.Context)
- func (h *Handler) Preview(c *gin.Context)
- func (h *Handler) Update(c *gin.Context)
- func (h *Handler) Validate(c *gin.Context)
- type OriginalEntitiesListRequest
- type OriginalEntitiesListResponse
- type OriginalEntityCreateRequest
- type OriginalEntityCreateResponse
- type OriginalEntityDeleteRequest
- type OriginalEntityDeleteResponse
- type OriginalEntityDetailRequest
- type OriginalEntityDetailResponse
- type OriginalEntityFunction
- type OriginalEntityFunctionsRequest
- type OriginalEntityFunctionsResponse
- type OriginalEntityPreviewRequest
- type OriginalEntityPreviewResponse
- type OriginalEntityUpdateRequest
- type OriginalEntityUpdateResponse
- type OriginalEntityValidateRequest
- type OriginalEntityValidateResponse
- type Service
- func (s *Service) Create(ctx context.Context, req *EntityCreateRequest) (*EntityCreateResponse, error)
- func (s *Service) Delete(ctx context.Context, req *EntityDeleteRequest) (*EntityDeleteResponse, error)
- func (s *Service) Detail(ctx context.Context, req *EntityDetailRequest) (*EntityDetailResponse, error)
- func (s *Service) List(ctx context.Context, req *EntitiesListRequest) (*EntitiesListResponse, error)
- func (s *Service) Preview(ctx context.Context, req *EntityPreviewRequest) (*EntityPreviewResponse, error)
- func (s *Service) Update(ctx context.Context, req *EntityUpdateRequest) (*EntityUpdateResponse, error)
- func (s *Service) Validate(ctx context.Context, req *EntityValidateRequest) (*EntityValidateResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntitiesListRequest ¶
type EntitiesListRequest struct {
Page int `form:"page"`
PageSize int `form:"pageSize"`
Type string `form:"type"`
}
EntitiesListRequest represents a request to list entities
type EntitiesListResponse ¶
type EntitiesListResponse struct {
Items []EntityItem `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"size"`
}
EntitiesListResponse represents the response for listing entities
type EntityCreateRequest ¶
type EntityCreateRequest struct {
Type string `json:"type"`
Data interface{} `json:"data"`
}
EntityCreateRequest represents a request to create an entity
type EntityCreateResponse ¶
type EntityCreateResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
ProviderID string `json:"providerId,omitempty"`
Status int `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
EntityCreateResponse represents the response for creating an entity
type EntityDeleteRequest ¶
type EntityDeleteRequest struct {
ID string `uri:"id"`
}
EntityDeleteRequest represents a request to delete an entity
type EntityDeleteResponse ¶
type EntityDeleteResponse struct {
}
EntityDeleteResponse represents the response for deleting an entity
type EntityDetailRequest ¶
type EntityDetailRequest struct {
ID string `uri:"id"`
}
EntityDetailRequest represents a request to get entity details
type EntityDetailResponse ¶
type EntityDetailResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
ProviderID string `json:"providerId,omitempty"`
Status int `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
EntityDetailResponse represents the response for getting entity details
type EntityFunction ¶
type EntityFunction struct {
Id string `json:"id"`
Operation string `json:"operation"` // create/read/update/delete/custom
Name string `json:"name"`
}
EntityFunction represents a function that can be performed on an entity
type EntityFunctionsRequest ¶
type EntityFunctionsRequest struct {
ID string `uri:"id"`
}
EntityFunctionsRequest represents a request to get entity functions
type EntityFunctionsResponse ¶
type EntityFunctionsResponse struct {
Items []EntityFunction `json:"items"`
}
EntityFunctionsResponse represents the response for getting entity functions
type EntityItem ¶
type EntityItem struct {
ID string `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
ProviderID string `json:"providerId,omitempty"`
Status int `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
EntityItem represents a single entity in the list
type EntityPreviewRequest ¶
type EntityPreviewRequest struct {
ID string `uri:"id"`
}
EntityPreviewRequest represents a request to preview an entity
type EntityPreviewResponse ¶
type EntityPreviewResponse struct {
Data interface{} `json:"data"`
}
EntityPreviewResponse represents the response for previewing an entity
type EntityUpdateRequest ¶
type EntityUpdateRequest struct {
ID string `uri:"id"`
Data interface{} `json:"data"`
}
EntityUpdateRequest represents a request to update an entity
type EntityUpdateResponse ¶
type EntityUpdateResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Data interface{} `json:"data"`
ProviderID string `json:"providerId,omitempty"`
Status int `json:"status"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
EntityUpdateResponse represents the response for updating an entity
type EntityValidateRequest ¶
type EntityValidateRequest struct {
Type string `json:"type"`
Data interface{} `json:"data"`
}
EntityValidateRequest represents a request to validate entity data
type EntityValidateResponse ¶
type EntityValidateResponse struct {
Valid bool `json:"valid"`
}
EntityValidateResponse represents the response for validating entity data
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
type OriginalEntitiesListRequest ¶
type OriginalEntitiesListRequest struct {
Page int `form:"page"`
PageSize int `form:"pageSize"`
Type string `form:"type"`
}
OriginalEntitiesListRequest is the original request type from types.go
type OriginalEntitiesListResponse ¶
type OriginalEntitiesListResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntitiesListResponse is the original response type from types.go
type OriginalEntityCreateRequest ¶
type OriginalEntityCreateRequest struct {
Type string `json:"type"`
Data interface{} `json:"data"`
}
OriginalEntityCreateRequest is the original request type from types.go
type OriginalEntityCreateResponse ¶
type OriginalEntityCreateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityCreateResponse is the original response type from types.go
type OriginalEntityDeleteRequest ¶
type OriginalEntityDeleteRequest struct {
ID string `uri:"id"`
}
OriginalEntityDeleteRequest is the original request type from types.go
type OriginalEntityDeleteResponse ¶
type OriginalEntityDeleteResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityDeleteResponse is the original response type from types.go
type OriginalEntityDetailRequest ¶
type OriginalEntityDetailRequest struct {
ID string `uri:"id"`
}
OriginalEntityDetailRequest is the original request type from types.go
type OriginalEntityDetailResponse ¶
type OriginalEntityDetailResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityDetailResponse is the original response type from types.go
type OriginalEntityFunction ¶
type OriginalEntityFunction struct {
Id string `json:"id"`
Operation string `json:"operation"` // create/read/update/delete/custom
Name string `json:"name"`
}
OriginalEntityFunction is the original function type from types.go
type OriginalEntityFunctionsRequest ¶
type OriginalEntityFunctionsRequest struct {
ID string `uri:"id"`
}
OriginalEntityFunctionsRequest is the original request type from types.go
type OriginalEntityFunctionsResponse ¶
type OriginalEntityFunctionsResponse struct {
Items []OriginalEntityFunction `json:"items"`
}
OriginalEntityFunctionsResponse is the original response type from types.go
type OriginalEntityPreviewRequest ¶
type OriginalEntityPreviewRequest struct {
ID string `uri:"id"`
}
OriginalEntityPreviewRequest is the original request type from types.go
type OriginalEntityPreviewResponse ¶
type OriginalEntityPreviewResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityPreviewResponse is the original response type from types.go
type OriginalEntityUpdateRequest ¶
type OriginalEntityUpdateRequest struct {
ID string `uri:"id"`
Data interface{} `json:"data"`
}
OriginalEntityUpdateRequest is the original request type from types.go
type OriginalEntityUpdateResponse ¶
type OriginalEntityUpdateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityUpdateResponse is the original response type from types.go
type OriginalEntityValidateRequest ¶
type OriginalEntityValidateRequest struct {
Type string `json:"type"`
Data interface{} `json:"data"`
}
OriginalEntityValidateRequest is the original request type from types.go
type OriginalEntityValidateResponse ¶
type OriginalEntityValidateResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
}
OriginalEntityValidateResponse is the original response type from types.go
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, req *EntityCreateRequest) (*EntityCreateResponse, error)
Create creates a new entity
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, req *EntityDeleteRequest) (*EntityDeleteResponse, error)
Delete deletes an entity
func (*Service) Detail ¶
func (s *Service) Detail(ctx context.Context, req *EntityDetailRequest) (*EntityDetailResponse, error)
Detail returns the details of an entity
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *EntitiesListRequest) (*EntitiesListResponse, error)
List returns the list of entities
func (*Service) Preview ¶
func (s *Service) Preview(ctx context.Context, req *EntityPreviewRequest) (*EntityPreviewResponse, error)
Preview returns a preview of an entity
func (*Service) Update ¶
func (s *Service) Update(ctx context.Context, req *EntityUpdateRequest) (*EntityUpdateResponse, error)
Update updates an entity
func (*Service) Validate ¶
func (s *Service) Validate(ctx context.Context, req *EntityValidateRequest) (*EntityValidateResponse, error)
Validate validates entity data