|
|
@ -19,14 +19,14 @@ var (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type tweetServant struct {
|
|
|
|
type tweetServant struct {
|
|
|
|
db *sqlx.DB
|
|
|
|
*sqlxServant
|
|
|
|
stmtGetTweet *sqlx.Stmt
|
|
|
|
stmtGetTweet *sqlx.Stmt
|
|
|
|
stmtListTweet *sqlx.Stmt
|
|
|
|
stmtListTweet *sqlx.Stmt
|
|
|
|
stmtListStar *sqlx.Stmt
|
|
|
|
stmtListStar *sqlx.Stmt
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type tweetManageServant struct {
|
|
|
|
type tweetManageServant struct {
|
|
|
|
db *sqlx.DB
|
|
|
|
*sqlxServant
|
|
|
|
cacheIndex core.CacheIndexService
|
|
|
|
cacheIndex core.CacheIndexService
|
|
|
|
stmtAddTweet *sqlx.Stmt
|
|
|
|
stmtAddTweet *sqlx.Stmt
|
|
|
|
stmtDelTweet *sqlx.Stmt
|
|
|
|
stmtDelTweet *sqlx.Stmt
|
|
|
@ -34,7 +34,7 @@ type tweetManageServant struct {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type tweetHelpServant struct {
|
|
|
|
type tweetHelpServant struct {
|
|
|
|
db *sqlx.DB
|
|
|
|
*sqlxServant
|
|
|
|
stmtAddTag *sqlx.Stmt
|
|
|
|
stmtAddTag *sqlx.Stmt
|
|
|
|
stmtDelTag *sqlx.Stmt
|
|
|
|
stmtDelTag *sqlx.Stmt
|
|
|
|
stmtListTag *sqlx.Stmt
|
|
|
|
stmtListTag *sqlx.Stmt
|
|
|
@ -230,7 +230,7 @@ func (s *tweetServant) GetPostContentByID(id int64) (*core.PostContent, error) {
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetService(db *sqlx.DB) core.TweetService {
|
|
|
|
func newTweetService(db *sqlx.DB) core.TweetService {
|
|
|
|
return &tweetServant{
|
|
|
|
return &tweetServant{
|
|
|
|
db: db,
|
|
|
|
sqlxServant: newSqlxServant(db),
|
|
|
|
stmtGetTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtGetTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListStar: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListStar: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
@ -239,7 +239,7 @@ func newTweetService(db *sqlx.DB) core.TweetService {
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetManageService(db *sqlx.DB, cacheIndex core.CacheIndexService) core.TweetManageService {
|
|
|
|
func newTweetManageService(db *sqlx.DB, cacheIndex core.CacheIndexService) core.TweetManageService {
|
|
|
|
return &tweetManageServant{
|
|
|
|
return &tweetManageServant{
|
|
|
|
db: db,
|
|
|
|
sqlxServant: newSqlxServant(db),
|
|
|
|
cacheIndex: cacheIndex,
|
|
|
|
cacheIndex: cacheIndex,
|
|
|
|
stmtAddTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtAddTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtDelTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtDelTweet: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
@ -249,7 +249,7 @@ func newTweetManageService(db *sqlx.DB, cacheIndex core.CacheIndexService) core.
|
|
|
|
|
|
|
|
|
|
|
|
func newTweetHelpService(db *sqlx.DB) core.TweetHelpService {
|
|
|
|
func newTweetHelpService(db *sqlx.DB) core.TweetHelpService {
|
|
|
|
return &tweetHelpServant{
|
|
|
|
return &tweetHelpServant{
|
|
|
|
db: db,
|
|
|
|
sqlxServant: newSqlxServant(db),
|
|
|
|
stmtAddTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtAddTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtDelTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtDelTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|
stmtListTag: c(`SELECT * FROM @person WHERE first_name=?`),
|
|
|
|