32 lines
789 B
Go
32 lines
789 B
Go
package forum
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
//参数校验
|
|
func (this *apiComp) LikeCheck(session comm.IUserSession, req *pb.ForumLikeReq) (errdata *pb.ErrorData) {
|
|
if req.Herocid == "" || req.Cid == "" {
|
|
errdata = &pb.ErrorData{
|
|
Code: pb.ErrorCode_ReqParameterError,
|
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
///获取本服聊天消息记录
|
|
func (this *apiComp) Like(session comm.IUserSession, req *pb.ForumLikeReq) (errdata *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
|
|
}
|