78 lines
1.4 KiB
Go
78 lines
1.4 KiB
Go
|
|
package usecase
|
||
|
|
|
||
|
|
import "context"
|
||
|
|
|
||
|
|
type MentionSummary struct {
|
||
|
|
MediaID string
|
||
|
|
AuthorUsername string
|
||
|
|
Text string
|
||
|
|
Permalink string
|
||
|
|
Shortcode string
|
||
|
|
Timestamp string
|
||
|
|
MediaType string
|
||
|
|
IsReply bool
|
||
|
|
IsQuotePost bool
|
||
|
|
HasReplies bool
|
||
|
|
RootPostID string
|
||
|
|
ParentID string
|
||
|
|
ThreadPostText string
|
||
|
|
ParentReplyText string
|
||
|
|
ReplyReady bool
|
||
|
|
ReplyReadyMsg string
|
||
|
|
SyncedAt int64
|
||
|
|
}
|
||
|
|
|
||
|
|
type Pagination struct {
|
||
|
|
Total int64
|
||
|
|
ReadyTotal int64
|
||
|
|
Page int64
|
||
|
|
PageSize int64
|
||
|
|
TotalPages int64
|
||
|
|
NewestSyncedAt int64
|
||
|
|
}
|
||
|
|
|
||
|
|
type SyncRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
AccountID string
|
||
|
|
Limit int
|
||
|
|
MaxPages int
|
||
|
|
}
|
||
|
|
|
||
|
|
type SyncResult struct {
|
||
|
|
Synced int
|
||
|
|
Ready int
|
||
|
|
Total int64
|
||
|
|
}
|
||
|
|
|
||
|
|
type ListRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
AccountID string
|
||
|
|
Page int
|
||
|
|
PageSize int
|
||
|
|
}
|
||
|
|
|
||
|
|
type ListResult struct {
|
||
|
|
List []MentionSummary
|
||
|
|
Pagination Pagination
|
||
|
|
}
|
||
|
|
|
||
|
|
type PublishReplyRequest struct {
|
||
|
|
TenantID string
|
||
|
|
OwnerUID string
|
||
|
|
AccountID string
|
||
|
|
MediaID string
|
||
|
|
Text string
|
||
|
|
}
|
||
|
|
|
||
|
|
type PublishReplyResult struct {
|
||
|
|
MediaID string
|
||
|
|
Permalink string
|
||
|
|
}
|
||
|
|
|
||
|
|
type UseCase interface {
|
||
|
|
SyncFromAPI(ctx context.Context, req SyncRequest) (*SyncResult, error)
|
||
|
|
List(ctx context.Context, req ListRequest) (*ListResult, error)
|
||
|
|
PublishReply(ctx context.Context, req PublishReplyRequest) (*PublishReplyResult, error)
|
||
|
|
}
|