Documentation
¶
Overview ¶
Package dto holds the support module's contract: the requests and responses of the ticket, announcement, document, ads and marketing endpoints. The Go package keeps the name dto so the Swagger schema names (dto.*) stay stable.
Index ¶
- Constants
- type Ads
- type Announcement
- type BatchDeleteDocumentRequest
- type BatchSendEmailTask
- type CreateAdsRequest
- type CreateAnnouncementRequest
- type CreateBatchSendEmailTaskRequest
- type CreateDocumentRequest
- type CreateQuotaTaskRequest
- type CreateTicketFollowRequest
- type CreateUserTicketFollowRequest
- type CreateUserTicketRequest
- type DeleteAdsRequest
- type DeleteAnnouncementRequest
- type DeleteDocumentRequest
- type Document
- type Follow
- type GetAdsDetailRequest
- type GetAdsListRequest
- type GetAdsListResponse
- type GetAdsRequest
- type GetAdsResponse
- type GetAnnouncementListRequest
- type GetAnnouncementListResponse
- type GetAnnouncementRequest
- type GetBatchSendEmailTaskListRequest
- type GetBatchSendEmailTaskListResponse
- type GetBatchSendEmailTaskStatusRequest
- type GetBatchSendEmailTaskStatusResponse
- type GetDocumentDetailRequest
- type GetDocumentListRequest
- type GetDocumentListResponse
- type GetPreSendEmailCountRequest
- type GetPreSendEmailCountResponse
- type GetTicketListRequest
- type GetTicketListResponse
- type GetTicketRequest
- type GetUserTicketDetailRequest
- type GetUserTicketListRequest
- type GetUserTicketListResponse
- type QueryAnnouncementRequest
- type QueryAnnouncementResponse
- type QueryDocumentDetailRequest
- type QueryDocumentListResponse
- type QueryQuotaTaskListRequest
- type QueryQuotaTaskListResponse
- type QueryQuotaTaskPreCountRequest
- type QueryQuotaTaskPreCountResponse
- type QuotaTask
- type StaffTicketUpdateCommand
- type StaffTicketUpdateResult
- type StopBatchSendEmailTaskRequest
- type Ticket
- type UpdateAdsRequest
- type UpdateAnnouncementRequest
- type UpdateDocumentRequest
- type UpdateTicketStatusRequest
- type UpdateUserTicketStatusRequest
Constants ¶
const ( MaxTicketTitleLength = 255 MaxTicketDescriptionLength = 10000 MaxTicketFollowLength = 65535 )
The bounds below keep a reply inside its TEXT column and the mirror into the Telegram admin group finite: a follow may be an inline image, so its content is bounded by the column, a title by its VARCHAR(255) column.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ads ¶
type Ads struct {
Id int `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
Content string `json:"content"`
Description string `json:"description"`
TargetURL string `json:"target_url"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
Status int `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type Announcement ¶
type BatchDeleteDocumentRequest ¶
type BatchDeleteDocumentRequest struct {
Ids []int64 `json:"ids" validate:"required"`
}
type BatchSendEmailTask ¶
type BatchSendEmailTask struct {
Id int64 `json:"id"`
Subject string `json:"subject"`
Content string `json:"content"`
// Recipients lists the first recorded recipients, one per line, and
// says how many more there are; RecipientCount is the whole audience,
// the additional addresses included.
Recipients string `json:"recipients"`
RecipientCount int64 `json:"recipient_count"`
Scope int8 `json:"scope"`
RegisterStartTime int64 `json:"register_start_time"`
RegisterEndTime int64 `json:"register_end_time"`
Additional string `json:"additional"`
Scheduled int64 `json:"scheduled"`
Interval uint8 `json:"interval"`
Limit uint64 `json:"limit"`
Status uint8 `json:"status"`
Errors string `json:"errors"`
Total uint64 `json:"total"`
Current uint64 `json:"current"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type CreateAdsRequest ¶
type CreateBatchSendEmailTaskRequest ¶
type CreateBatchSendEmailTaskRequest struct {
Subject string `json:"subject" validate:"required"`
Content string `json:"content" validate:"required"`
Scope int8 `json:"scope" validate:"required,oneof=1 2 3 4 5"`
RegisterStartTime int64 `json:"register_start_time,omitempty" validate:"gte=0"`
RegisterEndTime int64 `json:"register_end_time,omitempty" validate:"gte=0"`
Additional string `json:"additional,omitempty"`
Scheduled int64 `json:"scheduled,omitempty" validate:"gte=0"`
Interval uint8 `json:"interval,omitempty"`
Limit uint64 `json:"limit,omitempty"`
}
type CreateDocumentRequest ¶
type CreateQuotaTaskRequest ¶
type CreateQuotaTaskRequest struct {
Subscribers []int64 `json:"subscribers" validate:"dive,gt=0"`
IsActive *bool `json:"is_active"`
StartTime int64 `json:"start_time" validate:"gte=0"`
EndTime int64 `json:"end_time" validate:"gte=0"`
ResetTraffic bool `json:"reset_traffic"`
Days uint64 `json:"days"`
GiftType uint8 `json:"gift_type" validate:"oneof=0 1 2"`
GiftValue uint64 `json:"gift_value"`
}
type CreateUserTicketFollowRequest ¶
type CreateUserTicketFollowRequest struct {
TicketId int64 `json:"ticket_id" validate:"required,gt=0"`
// From is ignored: the author is always the ticket owner.
From string `json:"from" validate:"max=255"`
Type uint8 `json:"type" validate:"oneof=0 1 2"`
Content string `json:"content" validate:"required,max=65535"`
}
type CreateUserTicketRequest ¶
type DeleteAdsRequest ¶
type DeleteAdsRequest struct {
Id int64 `json:"id"`
}
type DeleteAnnouncementRequest ¶
type DeleteAnnouncementRequest struct {
Id int64 `json:"id" validate:"required"`
}
type DeleteDocumentRequest ¶
type DeleteDocumentRequest struct {
Id int64 `json:"id" validate:"required"`
}
type GetAdsDetailRequest ¶
type GetAdsDetailRequest struct {
Id int64 `form:"id"`
}
type GetAdsListRequest ¶
type GetAdsListResponse ¶
type GetAdsRequest ¶
type GetAdsResponse ¶
type GetAdsResponse struct {
List []Ads `json:"list"`
}
type GetAnnouncementListRequest ¶
type GetAnnouncementListRequest struct {
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=100"`
Show *bool `form:"show,omitempty"`
Pinned *bool `form:"pinned,omitempty"`
Popup *bool `form:"popup,omitempty"`
Search string `form:"search,omitempty"`
}
type GetAnnouncementListResponse ¶
type GetAnnouncementListResponse struct {
Total int64 `json:"total"`
List []Announcement `json:"list"`
}
type GetAnnouncementRequest ¶
type GetAnnouncementRequest struct {
Id int64 `form:"id" validate:"required"`
}
type GetBatchSendEmailTaskListRequest ¶
type GetBatchSendEmailTaskListRequest struct {
Page int `form:"page" validate:"omitempty,gt=0"`
Size int `form:"size" validate:"omitempty,gt=0,lte=100"`
Scope *int8 `form:"scope,omitempty" validate:"omitempty,oneof=1 2 3 4 5"`
Status *uint8 `form:"status,omitempty" validate:"omitempty,oneof=0 1 2 3 4 5"`
}
type GetBatchSendEmailTaskListResponse ¶
type GetBatchSendEmailTaskListResponse struct {
Total int64 `json:"total"`
List []BatchSendEmailTask `json:"list"`
}
type GetBatchSendEmailTaskStatusRequest ¶
type GetBatchSendEmailTaskStatusRequest struct {
Id int64 `json:"id" validate:"required,gt=0"`
}
type GetDocumentDetailRequest ¶
type GetDocumentDetailRequest struct {
Id int64 `json:"id" validate:"required"`
}
type GetDocumentListRequest ¶
type GetDocumentListResponse ¶
type GetPreSendEmailCountResponse ¶
type GetPreSendEmailCountResponse struct {
Count int64 `json:"count"`
}
type GetTicketListRequest ¶
type GetTicketListResponse ¶
type GetTicketRequest ¶
type GetTicketRequest struct {
Id int64 `form:"id" validate:"required"`
}
type GetUserTicketDetailRequest ¶
type GetUserTicketDetailRequest struct {
Id int64 `form:"id" validate:"required"`
}
type QueryAnnouncementResponse ¶
type QueryAnnouncementResponse struct {
Total int64 `json:"total"`
List []Announcement `json:"announcements"`
}
type QueryDocumentDetailRequest ¶
type QueryDocumentDetailRequest struct {
Id int64 `form:"id" validate:"required"`
}
type QueryQuotaTaskPreCountResponse ¶
type QueryQuotaTaskPreCountResponse struct {
Count int64 `json:"count"`
}
type QuotaTask ¶
type QuotaTask struct {
Id int64 `json:"id"`
Subscribers []int64 `json:"subscribers"`
IsActive *bool `json:"is_active"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
ResetTraffic bool `json:"reset_traffic"`
Days uint64 `json:"days"`
GiftType uint8 `json:"gift_type"`
GiftValue uint64 `json:"gift_value"`
Objects []int64 `json:"objects"` // UserSubscribe IDs
Status uint8 `json:"status"`
Total int64 `json:"total"`
Current int64 `json:"current"`
Errors string `json:"errors"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type StaffTicketUpdateCommand ¶ added in v1.21.0
type StaffTicketUpdateCommand struct {
TicketId int64
// Reply, when not empty, is appended as a staff text follow and moves the
// ticket to Waiting, exactly like a reply from the admin panel.
Reply string
// From is the reply's author as stored on the follow.
From string
// Status is the status to move the ticket to when there is no reply.
Status uint8
// FromMirror reports that the change was made inside the channel the
// ticket notifier mirrors to (the ticket's Telegram topic). That channel
// already shows it, so the notifier is skipped instead of echoing the
// change back.
FromMirror bool
}
StaffTicketUpdateCommand is an internal, trusted contract for a ticket change staff make outside the admin panel: today the Telegram bot's /rp, /close and /reopen commands and its ticket topics. It must NOT be bound to an HTTP request; the caller has already authenticated the administrator.
type StaffTicketUpdateResult ¶ added in v1.21.0
type StaffTicketUpdateResult struct {
PreviousStatus uint8
}
StaffTicketUpdateResult describes the ticket before the update applied.
type StopBatchSendEmailTaskRequest ¶
type StopBatchSendEmailTaskRequest struct {
Id int64 `json:"id" validate:"required,gt=0"`
}
type UpdateAdsRequest ¶
type UpdateAdsRequest struct {
Id int64 `json:"id"`
Title string `json:"title"`
Type string `json:"type"`
Content string `json:"content"`
Description string `json:"description"`
TargetURL string `json:"target_url"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
Status int `json:"status"`
}