2022-11-21 17:59:52 +08:00
|
|
|
package schema
|
|
|
|
|
|
|
|
import "github.com/answerdev/answer/internal/base/constant"
|
|
|
|
|
|
|
|
// ActivityMsg activity message
|
|
|
|
type ActivityMsg struct {
|
2022-11-22 19:48:27 +08:00
|
|
|
UserID string `json:"user_id"`
|
|
|
|
TriggerUserID int64 `json:"trigger_user_id"`
|
|
|
|
ObjectID string `json:"object_id"`
|
|
|
|
OriginalObjectID string `json:"original_object_id"`
|
|
|
|
ActivityTypeKey constant.ActivityTypeKey `json:"activity_type_key"`
|
|
|
|
RevisionID string `json:"revision_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetObjectTimelineReq get object timeline request
|
|
|
|
type GetObjectTimelineReq struct {
|
2022-11-23 11:07:28 +08:00
|
|
|
ObjectID string `validate:"omitempty,gt=0,lte=100" form:"object_id"`
|
|
|
|
ShowVote bool `validate:"omitempty" form:"show_vote"`
|
|
|
|
UserID string `json:"-"`
|
2022-11-23 16:12:48 +08:00
|
|
|
IsAdmin bool `json:"-"`
|
2022-11-22 19:48:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetObjectTimelineResp get object timeline response
|
|
|
|
type GetObjectTimelineResp struct {
|
|
|
|
ObjectInfo *ActObjectInfo `json:"object_info"`
|
|
|
|
Timeline []*ActObjectTimeline `json:"timeline"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActObjectTimeline act object timeline
|
|
|
|
type ActObjectTimeline struct {
|
|
|
|
ActivityID string `json:"activity_id"`
|
|
|
|
RevisionID string `json:"revision_id"`
|
|
|
|
CreatedAt int64 `json:"created_at"`
|
|
|
|
ActivityType string `json:"activity_type"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
UserDisplayName string `json:"user_display_name"`
|
|
|
|
Comment string `json:"comment"`
|
|
|
|
ObjectID string `json:"object_id"`
|
|
|
|
ObjectType string `json:"object_type"`
|
|
|
|
Cancelled bool `json:"cancelled"`
|
|
|
|
CancelledAt int64 `json:"cancelled_at"`
|
2022-11-23 19:30:38 +08:00
|
|
|
UserID string `json:"-"`
|
2022-11-22 19:48:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ActObjectInfo act object info
|
|
|
|
type ActObjectInfo struct {
|
2022-11-29 10:00:23 +08:00
|
|
|
Title string `json:"title"`
|
|
|
|
ObjectType string `json:"object_type"`
|
|
|
|
QuestionID string `json:"question_id"`
|
|
|
|
AnswerID string `json:"answer_id"`
|
|
|
|
Username string `json:"username"`
|
|
|
|
DisplayName string `json:"display_name"`
|
2022-11-23 16:12:48 +08:00
|
|
|
MainTagSlugName string `json:"main_tag_slug_name"`
|
2022-11-21 17:59:52 +08:00
|
|
|
}
|
2022-11-23 11:07:28 +08:00
|
|
|
|
|
|
|
// GetObjectTimelineDetailReq get object timeline detail request
|
|
|
|
type GetObjectTimelineDetailReq struct {
|
|
|
|
NewRevisionID string `validate:"required,gt=0,lte=100" form:"new_revision_id"`
|
|
|
|
OldRevisionID string `validate:"required,gt=0,lte=100" form:"old_revision_id"`
|
|
|
|
UserID string `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetObjectTimelineDetailResp get object timeline detail response
|
|
|
|
type GetObjectTimelineDetailResp struct {
|
|
|
|
NewRevision *ObjectTimelineDetail `json:"new_revision"`
|
|
|
|
OldRevision *ObjectTimelineDetail `json:"old_revision"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// ObjectTimelineDetail object timeline detail
|
|
|
|
type ObjectTimelineDetail struct {
|
2022-11-23 16:12:48 +08:00
|
|
|
Title string `json:"title"`
|
|
|
|
Tags []*ObjectTimelineTag `json:"tags"`
|
|
|
|
OriginalText string `json:"original_text"`
|
|
|
|
SlugName string `json:"slug_name"`
|
|
|
|
MainTagSlugName string `json:"main_tag_slug_name"`
|
2022-11-23 14:21:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ObjectTimelineTag object timeline tags
|
|
|
|
type ObjectTimelineTag struct {
|
|
|
|
SlugName string `json:"slug_name"`
|
|
|
|
DisplayName string `json:"display_name"`
|
|
|
|
MainTagSlugName string `json:"main_tag_slug_name"`
|
|
|
|
Recommend bool `json:"recommend"`
|
|
|
|
Reserved bool `json:"reserved"`
|
2022-11-23 11:07:28 +08:00
|
|
|
}
|