faq

package
v0.1.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

type FAQCategory struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

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 NewHandler(service *Service) *Handler

func (*Handler) Categories

func (h *Handler) Categories(c *gin.Context)

Categories handles the request to get FAQ categories

func (*Handler) Create

func (h *Handler) Create(c *gin.Context)

Create handles the request to create an FAQ

func (*Handler) Delete

func (h *Handler) Delete(c *gin.Context)

Delete handles the request to delete an FAQ

func (*Handler) List

func (h *Handler) List(c *gin.Context)

List handles the request to list FAQs

func (*Handler) Update

func (h *Handler) Update(c *gin.Context)

Update handles the request to update an FAQ

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) Categories

Categories retrieves FAQ categories

func (*Service) Create

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

Update updates an existing FAQ

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL