comment.go 2.1 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"`
	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
}
type CommentsResponse struct {
	Total    int         `json:"total"`
	Comments []*Comments `json:"comments"`
}

/*评论列表*/
type Comments struct {
	Id           int64         `json:"id"`
	Provider     *BaseUserInfo `json:"provider"`
	Content      string        `json:"content"`
	ViewTotal    int           `json:"pageView"`
	CommentTotal int           `json:"commentTotal"`
	ZanTotal     int           `json:"zanTotal"`
	CreateTime   int64         `json:"createTime"`
	IsZan        int           `json:"is_zan"` //0:未点赞 1:点赞
}

/*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"`
}