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.
30 lines
475 B
30 lines
475 B
package trend
|
|
|
|
import (
|
|
"live/app/model/user"
|
|
)
|
|
|
|
// 会员统计
|
|
type Data struct {
|
|
}
|
|
|
|
// @Title 新增赞
|
|
func (d *Data) AddPraise(userId uint) bool {
|
|
userDataModel := &user.UserData{}
|
|
row := userDataModel.AddPraise(userId, 1)
|
|
if row > 0 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
// @Title 取消赞下
|
|
func (d *Data) CancelPraise(userId uint) bool {
|
|
userDataModel := &user.UserData{}
|
|
row := userDataModel.CancelPraise(userId)
|
|
if row > 0 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|