mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
649 B
26 lines
649 B
1 year ago
|
// Copyright 2023 ROC. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
// Package cs contain core data service interface type
|
||
|
// model define
|
||
|
|
||
|
package cs
|
||
|
|
||
|
type TweetMetric struct {
|
||
|
PostId int64
|
||
|
CommentCount int64
|
||
|
UpvoteCount int64
|
||
|
CollectionCount int64
|
||
|
ShareCount int64
|
||
|
ThumbdownCount int64
|
||
|
ThumbupCount int64
|
||
|
}
|
||
|
|
||
|
func (m *TweetMetric) RankScore(motivationFactor int) int64 {
|
||
|
if motivationFactor == 0 {
|
||
|
motivationFactor = 1
|
||
|
}
|
||
|
return (m.CommentCount + m.UpvoteCount*2 + m.CollectionCount*4 + m.ShareCount*8) * int64(motivationFactor)
|
||
|
}
|