|
|
|
@ -7,6 +7,7 @@ package sakila
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
"github.com/bitbus/sqlx/db"
|
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core/ms"
|
|
|
|
|
"github.com/rocboss/paopao-ce/internal/dao/sakila/auto/pgc"
|
|
|
|
@ -21,23 +22,19 @@ type pgcCommentManageSrv struct {
|
|
|
|
|
p *pgc.CommentManage
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateComment(r *ms.Comment) (res *ms.Comment, err error) {
|
|
|
|
|
err = stmtGet(s.p.CreateComment, &res,
|
|
|
|
|
r.PostID, r.UserID, r.IP,
|
|
|
|
|
r.IPLoc, time.Now().Unix())
|
|
|
|
|
return
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateComment(r *ms.Comment) (*ms.Comment, error) {
|
|
|
|
|
return db.Get[ms.Comment](s.p.CreateComment, r.PostID, r.UserID, r.IP, r.IPLoc, time.Now().Unix())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateCommentReply(r *ms.CommentReply) (res *ms.CommentReply, err error) {
|
|
|
|
|
err = stmtGet(s.p.CreateCommentReply, &res,
|
|
|
|
|
r.CommentID, r.UserID, r.Content,
|
|
|
|
|
r.AtUserID, r.IP, r.IPLoc, time.Now().Unix())
|
|
|
|
|
return
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateCommentReply(r *ms.CommentReply) (*ms.CommentReply, error) {
|
|
|
|
|
return db.Get[ms.CommentReply](s.p.CreateCommentReply, r.CommentID,
|
|
|
|
|
r.UserID, r.Content, r.AtUserID,
|
|
|
|
|
r.IP, r.IPLoc, time.Now().Unix())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateCommentContent(r *ms.CommentContent) (res *ms.CommentContent, err error) {
|
|
|
|
|
err = stmtGet(s.p.CreateCommentContent, &res,
|
|
|
|
|
func (s *pgcCommentManageSrv) CreateCommentContent(r *ms.CommentContent) (*ms.CommentContent, error) {
|
|
|
|
|
return db.Get[ms.CommentContent](s.p.CreateCommentContent,
|
|
|
|
|
r.CommentID, r.UserID, r.Content,
|
|
|
|
|
r.Type, r.Sort, time.Now().Unix())
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|