Documentation
¶
Index ¶
- type FAQ
- type FAQCategoriesRequest
- type FAQCategoriesResponse
- type FAQCategory
- type FAQCreateRequest
- type FAQCreateResponse
- type FAQDeleteRequest
- type FAQDetailResponse
- type FAQListRequest
- type FAQListResponse
- type FAQUpdateRequest
- type FAQUpdateResponse
- type Handler
- type Service
- func (s *Service) Categories(ctx context.Context, req *FAQCategoriesRequest) (*FAQCategoriesResponse, error)
- func (s *Service) Create(ctx context.Context, req *FAQCreateRequest) (*FAQCreateResponse, error)
- func (s *Service) Delete(ctx context.Context, req *FAQDeleteRequest) error
- func (s *Service) List(ctx context.Context, req *FAQListRequest) (*FAQListResponse, error)
- func (s *Service) Update(ctx context.Context, req *FAQUpdateRequest) (*FAQUpdateResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FAQ ¶
type FAQ struct {
Id int64 `json:"id"`
Question string `json:"question"`
Answer string `json:"answer"`
Category string `json:"category"`
Tags []string `json:"tags"`
Visible bool `json:"visible"`
Sort int `json:"sort"`
Views int `json:"views"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
FAQ represents a frequently asked question
type FAQCategoriesRequest ¶
type FAQCategoriesRequest struct{}
FAQCategoriesRequest represents the request to get FAQ categories
type FAQCategoriesResponse ¶
type FAQCategoriesResponse struct {
Items []FAQCategory `json:"items"`
}
FAQCategoriesResponse represents the response with FAQ categories
type FAQCategory ¶
FAQCategory represents a FAQ category
type FAQCreateRequest ¶
type FAQCreateRequest struct {
Question string `json:"question"`
Answer string `json:"answer"`
Category string `json:"category"`
Tags []string `json:"tags"`
Visible bool `json:"visible,optional,default=true"`
Sort int `json:"sort,optional,default=0"`
}
FAQCreateRequest represents the request to create an FAQ
type FAQCreateResponse ¶
type FAQCreateResponse struct {
FAQ
}
FAQCreateResponse represents the response after creating an FAQ
type FAQDeleteRequest ¶
type FAQDeleteRequest struct {
ID string `uri:"id"`
}
FAQDeleteRequest represents the request to delete an FAQ
type FAQDetailResponse ¶
type FAQDetailResponse struct {
FAQ
}
FAQDetailResponse represents the response with FAQ details
type FAQListRequest ¶
type FAQListRequest struct {
Page int `form:"page,optional,default=1"`
PageSize int `form:"pageSize,optional,default=20"`
Category string `form:"category"`
Keyword string `form:"keyword"`
Visible *bool `form:"visible"`
}
FAQListRequest represents the request to list FAQs
type FAQListResponse ¶
type FAQListResponse struct {
Items []FAQ `json:"items"`
Total int64 `json:"total"`
Page int `json:"page"`
Size int `json:"pageSize"`
}
FAQListResponse represents the response with a list of FAQs
type FAQUpdateRequest ¶
type FAQUpdateRequest struct {
ID string `uri:"id"`
Question string `json:"question"`
Answer string `json:"answer"`
Category string `json:"category"`
Tags []string `json:"tags"`
Visible *bool `json:"visible"`
Sort *int `json:"sort"`
}
FAQUpdateRequest represents the request to update an FAQ
type FAQUpdateResponse ¶
type FAQUpdateResponse struct {
FAQ
}
FAQUpdateResponse represents the response after updating an FAQ
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) Categories ¶
Categories handles the request to get FAQ categories
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Categories ¶
func (s *Service) Categories(ctx context.Context, req *FAQCategoriesRequest) (*FAQCategoriesResponse, error)
Categories retrieves FAQ categories
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, req *FAQCreateRequest) (*FAQCreateResponse, error)
Create creates a new FAQ
func (*Service) Delete ¶
func (s *Service) Delete(ctx context.Context, req *FAQDeleteRequest) error
Delete deletes an FAQ
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *FAQListRequest) (*FAQListResponse, error)
List retrieves a paginated list of FAQs
func (*Service) Update ¶
func (s *Service) Update(ctx context.Context, req *FAQUpdateRequest) (*FAQUpdateResponse, error)
Update updates an existing FAQ