29 lines
715 B
Go
29 lines
715 B
Go
package forum
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) LikeCheck(session comm.IUserSession, req *pb.ForumLikeReq) (code pb.ErrorCode) {
|
|
if req.Herocid == "" || req.Cid == "" {
|
|
code = pb.ErrorCode_ReqParameterError
|
|
}
|
|
return
|
|
}
|
|
|
|
///获取本服聊天消息记录
|
|
func (this *apiComp) Like(session comm.IUserSession, req *pb.ForumLikeReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
|
var (
|
|
err error
|
|
)
|
|
|
|
if _, err = this.module.modelForum.like(req.Herocid, req.Cid, req.Islike); err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
}
|
|
|
|
session.SendMsg(string(this.module.GetType()), "like", &pb.ForumLikeResp{Cid: req.Cid, Islike: req.Islike, Issucc: true})
|
|
return
|
|
}
|