|
|
@ -7,7 +7,6 @@ package slonik
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"github.com/jackc/pgx/v5"
|
|
|
|
"github.com/jackc/pgx/v5"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
dbr "github.com/rocboss/paopao-ce/internal/dao/slonik/ce/postgres"
|
|
|
|
|
|
|
|
"github.com/rocboss/paopao-ce/pkg/debug"
|
|
|
|
"github.com/rocboss/paopao-ce/pkg/debug"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -19,18 +18,15 @@ var (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type tweetServant struct {
|
|
|
|
type tweetServant struct {
|
|
|
|
db *pgx.Conn
|
|
|
|
*pgxServant
|
|
|
|
q dbr.Querier
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type tweetManageServant struct {
|
|
|
|
type tweetManageServant struct {
|
|
|
|
db *pgx.Conn
|
|
|
|
*pgxServant
|
|
|
|
q dbr.Querier
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type tweetHelpServant struct {
|
|
|
|
type tweetHelpServant struct {
|
|
|
|
db *pgx.Conn
|
|
|
|
*pgxServant
|
|
|
|
q dbr.Querier
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MergePosts post数据整合
|
|
|
|
// MergePosts post数据整合
|
|
|
@ -223,21 +219,18 @@ func (s *tweetServant) GetPostContentByID(id int64) (*core.PostContent, error) {
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetService(db *pgx.Conn) core.TweetService {
|
|
|
|
func newTweetService(db *pgx.Conn) core.TweetService {
|
|
|
|
return &tweetServant{
|
|
|
|
return &tweetServant{
|
|
|
|
db: db,
|
|
|
|
pgxServant: newPgxServant(db),
|
|
|
|
q: dbr.New(db),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetManageService(db *pgx.Conn, cacheIndex core.CacheIndexService) core.TweetManageService {
|
|
|
|
func newTweetManageService(db *pgx.Conn, cacheIndex core.CacheIndexService) core.TweetManageService {
|
|
|
|
return &tweetManageServant{
|
|
|
|
return &tweetManageServant{
|
|
|
|
db: db,
|
|
|
|
pgxServant: newPgxServant(db),
|
|
|
|
q: dbr.New(db),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetHelpService(db *pgx.Conn) core.TweetHelpService {
|
|
|
|
func newTweetHelpService(db *pgx.Conn) core.TweetHelpService {
|
|
|
|
return &tweetHelpServant{
|
|
|
|
return &tweetHelpServant{
|
|
|
|
db: db,
|
|
|
|
pgxServant: newPgxServant(db),
|
|
|
|
q: dbr.New(db),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|