You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/internal/dao/sakila/index.go

55 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// Copyright 2023 ROC. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package sakila
import (
"github.com/jmoiron/sqlx"
"github.com/rocboss/paopao-ce/internal/core"
"github.com/rocboss/paopao-ce/pkg/debug"
)
var (
_ core.IndexPostsService = (*indexPostsServant)(nil)
_ core.IndexPostsService = (*simpleIndexPostsServant)(nil)
)
type indexPostsServant struct {
*sqlxServant
stmtIndex *sqlx.Stmt
}
type simpleIndexPostsServant struct {
*sqlxServant
stmtIndex *sqlx.Stmt
}
// IndexPosts 根据userId查询广场推文列表简单做到不同用户的主页都是不同的
func (s *indexPostsServant) IndexPosts(user *core.User, offset int, limit int) (*core.IndexTweetList, error) {
// TODO
debug.NotImplemented()
return nil, nil
}
// simpleCacheIndexGetPosts simpleCacheIndex 专属获取广场推文列表函数
func (s *simpleIndexPostsServant) IndexPosts(_user *core.User, offset int, limit int) (*core.IndexTweetList, error) {
// TODO
debug.NotImplemented()
return nil, nil
}
func newIndexPostsService(db *sqlx.DB) core.IndexPostsService {
return &indexPostsServant{
sqlxServant: newSqlxServant(db),
stmtIndex: c(`SELECT * FROM @person WHERE first_name=?`),
}
}
func newSimpleIndexPostsService(db *sqlx.DB) core.IndexPostsService {
return &simpleIndexPostsServant{
sqlxServant: newSqlxServant(db),
stmtIndex: c(`SELECT * FROM @person WHERE first_name=?`),
}
}