base

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAny

func BindAny(c *gin.Context, obj any) mir.Error

func RenderAny

func RenderAny(c *gin.Context, data any, err mir.Error)

func UserFrom

func UserFrom(c *gin.Context) (*core.User, bool)

func UserIdFrom

func UserIdFrom(c *gin.Context) (int64, bool)

func UserNameFrom

func UserNameFrom(c *gin.Context) (string, bool)

Types

type BaseBinding

type BaseBinding types.Empty

type BaseRender

type BaseRender types.Empty

type BaseServant

type BaseServant types.Empty

type DaoServant

type DaoServant struct {
	Redis *redis.Client
	Ds    core.DataService
	Ts    core.TweetSearchService
}

func (*DaoServant) DeleteSearchPost

func (s *DaoServant) DeleteSearchPost(post *core.Post) error

func (*DaoServant) GetTweetBy

func (s *DaoServant) GetTweetBy(id int64) (*core.PostFormated, error)

func (*DaoServant) GetTweetList

func (s *DaoServant) GetTweetList(conditions *core.ConditionsT, offset, limit int) ([]*core.Post, []*core.PostFormated, error)

func (*DaoServant) PushPostToSearch

func (s *DaoServant) PushPostToSearch(post *core.Post)

func (*DaoServant) PushPostsToSearch

func (s *DaoServant) PushPostsToSearch(c context.Context)

type JsonResp

type JsonResp struct {
	Code int    `json:"code"`
	Msg  string `json:"msg,omitempty"`
	Data any    `json:"data,omitempty"`
}

type PageInfoSetter

type PageInfoSetter interface {
	SetPageInfo(page, pageSize int)
}

type PageResp

type PageResp struct {
	List  any   `json:"list"`
	Pager Pager `json:"pager"`
}

func PageRespFrom

func PageRespFrom(list any, page int, pageSize int, totalRows int64) *PageResp

type Pager

type Pager struct {
	Page      int   `json:"page"`
	PageSize  int   `json:"page_size"`
	TotalRows int64 `json:"total_rows"`
}

type UserIdSetter

type UserIdSetter interface {
	SetUserId(int64)
}

type UserSetter

type UserSetter interface {
	SetUser(*core.User)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL