comment.go 2.6 KB
package protocol

const (
	SourceTypeChance   = 1
	SourceTypeComment  = 2
	SourceTypeBulletin = 3
)

/*IComment */
type ICommentRequest struct {
	Content    string `json:"content" valid:"Required"`
	SourceType int    `json:"type" valid:"Required"` //1.机会 2:评论
	Id         int64  `json:"id" valid:"Required"`
}
type ICommentResponse struct {
	Id         int64         `json:"id"`
	Provider   *BaseUserInfo `json:"provider"`
	CreateTime int64         `json:"createTime"`
	Content    string        `json:"content"`
}

/*IComments */
type ICommentsRequest struct {
	LastId   int64 `json:"lastId"`
	PageSize int   `json:"pageSize" valid:"Required"`
}
type ICommentsResponse struct {
	Comments []*IComments `json:"comments"`
	Total    int          `json:"total"`
}

type IComments struct {
	//question `json:"question"`
	Comment *ICommentResponse `json:"comment"`
}

/*机会评论*/
type CommentsRequest struct {
	LastId     int64 `json:"lastId"`
	PageSize   int   `json:"pageSize" valid:"Required"`
	SourceId   int64 `json:"id" valid:"Required"`
	SourceType int   `json:"sourceType" valid:"Required"` //1:机会 2:评论
}
type CommentsResponse struct {
	Comments []*Comments `json:"comments"`
	Total    int         `json:"total"`
}

/*Thumbsups 点赞列表*/
type ThumbsupsRequest struct {
	LastId     int64 `json:"lastId"`
	PageSize   int   `json:"pageSize" valid:"Required"`
	SourceId   int64 `json:"id" valid:"Required"`
	SourceType int   `json:"sourceType" valid:"Required"` //1:机会 2:评论
}
type ThumbsupsResponse struct {
	Thumbups []*Thumbups `json:"thumbups"`
	Total    int         `json:"total"`
}

/*评论列表*/
type Comments struct {
	Id         int64         `json:"id"`
	CreateTime int64         `json:"createTime"`
	Content    string        `json:"content"`
	Provider   *BaseUserInfo `json:"provider"`

	ViewTotal    int  `json:"pageViewTotal"`
	CommentTotal int  `json:"commentTotal"`
	ZanTotal     int  `json:"thumbsupTotal"`
	IsZan        bool `json:"isThumbsUp"` //0:未点赞 1:点赞
}

type Thumbups struct {
	Id         int64         `json:"id"`
	CreateTime int64         `json:"createTime"`
	Provider   *BaseUserInfo `json:"provider"`
}

/*CommentDetailsMulti */
type CommentDetailsMultiRequest struct {
	SourceId int64 `json:"cid"`
	LastId   int64 `json:"commentLastId"`
	PageSize int   `json:"commentPageSize" valid:"Required"`
}
type CommentDetailsMultiResponse struct {
	Comment  *Comments   `json:"comment"`
	Comments []*Comments `json:"comments"`
}

/*CommentDetailsSingle */
type CommentDetailsSingleRequest struct {
	Id int64 `json:"cid" valid:"Required"`
}
type CommentDetailsSingleResponse struct {
	Comment *Comments `json:"comment"`
}