Documentation
¶
Overview ¶
Package ticket implements the ticket subdomain of the support module. Only the module facade (internal/module/support) may reach it.
Index ¶
- type Notifier
- type Service
- func (s *Service) CreateFollow(ctx context.Context, req *dto.CreateTicketFollowRequest) error
- func (s *Service) CreateUserFollow(ctx context.Context, req *dto.CreateUserTicketFollowRequest) error
- func (s *Service) CreateUserTicket(ctx context.Context, req *dto.CreateUserTicketRequest) error
- func (s *Service) GetDetail(ctx context.Context, req *dto.GetTicketRequest) (*dto.Ticket, error)
- func (s *Service) GetUserDetail(ctx context.Context, req *dto.GetUserTicketDetailRequest) (*dto.Ticket, error)
- func (s *Service) GetUserList(ctx context.Context, req *dto.GetUserTicketListRequest) (*dto.GetUserTicketListResponse, error)
- func (s *Service) List(ctx context.Context, req *dto.GetTicketListRequest) (*dto.GetTicketListResponse, error)
- func (s *Service) UpdateStatus(ctx context.Context, req *dto.UpdateTicketStatusRequest) error
- func (s *Service) UpdateUserStatus(ctx context.Context, req *dto.UpdateUserTicketStatusRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶ added in v1.15.18
type Notifier interface {
TicketCreated(ctx context.Context, t *entity.Ticket)
TicketReplied(ctx context.Context, ticketID int64, from, content string)
TicketStatusChanged(ctx context.Context, ticketID int64, status uint8)
}
Notifier mirrors ticket lifecycle into other channels — today the forum topic in the Telegram admin group. Implementations are best-effort by contract: they never fail the ticket operation, so the methods return nothing and do their own logging.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo repository.TicketRepo, notify Notifier) *Service
NewService builds the ticket service; notify may be nil when no mirror channel is wired.
func (*Service) CreateFollow ¶
CreateFollow appends an admin reply and flips the ticket back to Waiting.
func (*Service) CreateUserFollow ¶
func (s *Service) CreateUserFollow(ctx context.Context, req *dto.CreateUserTicketFollowRequest) error
CreateUserFollow appends a user reply after verifying ticket ownership and flips the ticket to Pending.
func (*Service) CreateUserTicket ¶
func (*Service) GetUserDetail ¶
func (*Service) GetUserList ¶
func (s *Service) GetUserList(ctx context.Context, req *dto.GetUserTicketListRequest) (*dto.GetUserTicketListResponse, error)
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *dto.GetTicketListRequest) (*dto.GetTicketListResponse, error)