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