ticket

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	Id        int64  `json:"id"`
	Content   string `json:"content"`
	Author    string `json:"author"`
	CreatedAt string `json:"createdAt"`
}

type CreateCommentRequest

type CreateCommentRequest = TicketCommentCreateRequest

type CreateCommentResponse

type CreateCommentResponse = TicketCommentsResponse

type CreateRequest

type CreateRequest = TicketCreateRequest

type CreateResponse

type CreateResponse = TicketDetailResponse

type DeleteRequest

type DeleteRequest = TicketDeleteRequest

type DeleteResponse

type DeleteResponse = TicketDetailResponse

type GetCommentsRequest

type GetCommentsRequest = TicketCommentsRequest

type GetCommentsResponse

type GetCommentsResponse = TicketCommentsResponse

type GetRequest

type GetRequest = TicketDetailRequest

type GetResponse

type GetResponse = TicketDetailResponse

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) Create

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

Create handles the request to create a ticket

func (*Handler) CreateComment

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

CreateComment handles the request to create a comment

func (*Handler) Delete

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

Delete handles the request to delete a ticket

func (*Handler) Get

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

Get handles the request to get ticket details

func (*Handler) GetComments

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

GetComments handles the request to get ticket comments

func (*Handler) List

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

List handles the request to list tickets

func (*Handler) Transition

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

Transition handles the request to transition ticket status

func (*Handler) Update

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

Update handles the request to update a ticket

type ListRequest

type ListRequest = TicketsListRequest

Type aliases for service layer compatibility

type ListResponse

type ListResponse = TicketsListResponse

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 *CreateRequest) (*CreateResponse, error)

Create creates a new ticket

func (*Service) CreateComment

func (s *Service) CreateComment(ctx context.Context, req *CreateCommentRequest) (*CreateCommentResponse, error)

CreateComment creates a new comment on a ticket

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, req *DeleteRequest) error

Delete deletes a ticket

func (*Service) Get

func (s *Service) Get(ctx context.Context, req *GetRequest) (*GetResponse, error)

Get returns ticket details with comments

func (*Service) GetComments

func (s *Service) GetComments(ctx context.Context, req *GetCommentsRequest) (*GetCommentsResponse, error)

GetComments returns comments for a ticket

func (*Service) List

func (s *Service) List(ctx context.Context, req *ListRequest) (*ListResponse, error)

List returns a list of tickets

func (*Service) Transition

func (s *Service) Transition(ctx context.Context, req *TransitionRequest) (*TransitionResponse, error)

Transition transitions a ticket to a new status

func (*Service) Update

func (s *Service) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)

Update updates a ticket

type Ticket

type Ticket struct {
	Id        int64    `json:"id"`
	Title     string   `json:"title"`
	Content   string   `json:"content"`
	Category  string   `json:"category"`
	Priority  string   `json:"priority"`
	Status    string   `json:"status"`
	Assignee  string   `json:"assignee"`
	Tags      []string `json:"tags"`
	PlayerId  string   `json:"playerId"`
	Contact   string   `json:"contact"`
	GameId    string   `json:"gameId"`
	Env       string   `json:"env"`
	Source    string   `json:"source"`
	CreatedAt string   `json:"createdAt"`
	UpdatedAt string   `json:"updatedAt"`
}

type TicketCommentCreateRequest

type TicketCommentCreateRequest struct {
	TicketID string `uri:"ticketId"`
	Content  string `json:"content"`
}

type TicketCommentsRequest

type TicketCommentsRequest struct {
	TicketID string `uri:"ticketId"`
}

type TicketCommentsResponse

type TicketCommentsResponse struct {
	Items []Comment `json:"items"`
}

type TicketCreateRequest

type TicketCreateRequest struct {
	Title    string   `json:"title"`
	Content  string   `json:"content"`
	Category string   `json:"category"`
	Priority string   `json:"priority,optional,default=medium"`
	Tags     []string `json:"tags"`
	PlayerId string   `json:"playerId"`
	Contact  string   `json:"contact"`
	GameId   string   `json:"gameId"`
	Env      string   `json:"env"`
}

type TicketDeleteRequest

type TicketDeleteRequest struct {
	ID string `uri:"id"`
}

type TicketDetailRequest

type TicketDetailRequest struct {
	ID string `uri:"id"`
}

type TicketDetailResponse

type TicketDetailResponse struct {
	Ticket
	Comments []Comment `json:"comments,omitempty"`
}

type TicketTransitionRequest

type TicketTransitionRequest struct {
	ID     string `uri:"id"`
	Status string `json:"status"` // open, in_progress, resolved, closed
	Note   string `json:"note"`
}

type TicketUpdateRequest

type TicketUpdateRequest struct {
	ID       string   `uri:"id"`
	Title    string   `json:"title"`
	Content  string   `json:"content"`
	Category string   `json:"category"`
	Priority string   `json:"priority"`
	Assignee string   `json:"assignee"`
	Tags     []string `json:"tags"`
}

type TicketsListRequest

type TicketsListRequest struct {
	Page     int    `form:"page,optional,default=1"`
	PageSize int    `form:"pageSize,optional,default=20"`
	Status   string `form:"status"`
	Category string `form:"category"`
	Priority string `form:"priority"`
	Assignee string `form:"assignee"`
}

type TicketsListResponse

type TicketsListResponse struct {
	Items []Ticket `json:"items"`
	Total int64    `json:"total"`
	Page  int      `json:"page"`
	Size  int      `json:"pageSize"`
}

type TransitionRequest

type TransitionRequest = TicketTransitionRequest

type TransitionResponse

type TransitionResponse = TicketDetailResponse

type UpdateRequest

type UpdateRequest = TicketUpdateRequest

type UpdateResponse

type UpdateResponse = TicketDetailResponse

Jump to

Keyboard shortcuts

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