Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Controller ¶
func Controller(orgr *Repository) func(r *gin.Engine) *gin.RouterGroup
func Find ¶
func Find(orgr *Repository) gin.HandlerFunc
func FindOne ¶
func FindOne(orgr *Repository) gin.HandlerFunc
Types ¶
type FindResponseModel ¶
type FindResponseModel struct { Slug string `json:"slug"` Name string `json:"name"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` }
func NewFindResponseModel ¶
func NewFindResponseModel(rows *sql.Rows) []*FindResponseModel
type Model ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(conn *sql.DB) *Repository
func (*Repository) Find ¶
func (self *Repository) Find(p *page.Page) ([]*FindResponseModel, int)
func (*Repository) FindById ¶
func (self *Repository) FindById(id string) *Model
func (*Repository) FindBySlug ¶
func (self *Repository) FindBySlug(slug string) *Model
Click to show internal directories.
Click to hide internal directories.