go-common/app/interface/main/dm2/model/thumbup.go

24 lines
568 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package model
// All const variable used in thumbup
const (
ThumbupLike int8 = 1 // 点赞
ThumbupLikeCancel int8 = 2 // 取消赞
ThumbupHate int8 = 3 // 点踩
ThumbupHateCancel int8 = 4 // 取消踩
)
// ThumbupStat thumbup state
type ThumbupStat struct {
Likes int64 `json:"likes"`
UserLike int8 `json:"user_like"`
}
// CheckThumbup check thumbup.
func CheckThumbup(Thumbup int8) bool {
if Thumbup == ThumbupLikeCancel || Thumbup == ThumbupLike || Thumbup == ThumbupHateCancel || Thumbup == ThumbupHate {
return true
}
return false
}