|
|
@ -12,7 +12,6 @@ import (
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
"github.com/jmoiron/sqlx"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core/cs"
|
|
|
|
"github.com/rocboss/paopao-ce/internal/core/cs"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
@ -21,7 +20,7 @@ var (
|
|
|
|
|
|
|
|
|
|
|
|
type topicSrv struct {
|
|
|
|
type topicSrv struct {
|
|
|
|
*sqlxSrv
|
|
|
|
*sqlxSrv
|
|
|
|
Scope yesql.Scope `yesql:"topic"`
|
|
|
|
yesql.Namespace `yesql:"topic"`
|
|
|
|
StmtNewestTags *sqlx.Stmt `yesql:"newest_tags"`
|
|
|
|
StmtNewestTags *sqlx.Stmt `yesql:"newest_tags"`
|
|
|
|
StmtHotTags *sqlx.Stmt `yesql:"hot_tags"`
|
|
|
|
StmtHotTags *sqlx.Stmt `yesql:"hot_tags"`
|
|
|
|
StmtTagsByKeywordA *sqlx.Stmt `yesql:"tags_by_keyword_a"`
|
|
|
|
StmtTagsByKeywordA *sqlx.Stmt `yesql:"tags_by_keyword_a"`
|
|
|
@ -124,11 +123,7 @@ func (s *topicSrv) TagsByKeyword(keyword string) (res cs.TagInfoList, err error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func newTopicService(db *sqlx.DB, query yesql.SQLQuery) core.TopicService {
|
|
|
|
func newTopicService(db *sqlx.DB, query yesql.SQLQuery) core.TopicService {
|
|
|
|
obj := &topicSrv{
|
|
|
|
return yesqlScan(query, &topicSrv{
|
|
|
|
sqlxSrv: newSqlxSrv(db),
|
|
|
|
sqlxSrv: newSqlxSrv(db),
|
|
|
|
}
|
|
|
|
})
|
|
|
|
if err := yesql.Scan(obj, query); err != nil {
|
|
|
|
|
|
|
|
logrus.Fatal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return obj
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|