demo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DemoRedis added in v1.0.0

func DemoRedis(c *gin.Context)

DemoRedis redis的路由方法

func RegisterRoutes added in v1.0.0

func RegisterRoutes(r *gin.Engine) error

RegisterRoutes 注册路由

Types

type DemoApi

type DemoApi struct{}

func (*DemoApi) Demo

func (api *DemoApi) Demo(c *gin.Context)

Demo godoc @Summary 获取所有学生 @Description 获取所有学生 @Produce json @Tags demo @Success 200 array []UserDTO @Router /demo/demo [get]

func (*DemoApi) DemoCache added in v1.0.0

func (api *DemoApi) DemoCache(c *gin.Context)

DemoCache cache的简单例子

func (*DemoApi) DemoOrm added in v1.0.0

func (api *DemoApi) DemoOrm(c *gin.Context)

DemoOrm Orm的路由方法

func (*DemoApi) DemoPost

func (api *DemoApi) DemoPost(c *gin.Context)

type User added in v1.0.0

type User struct {
	ID           uint
	Name         string
	Email        *string
	Age          uint8
	Birthday     *time.Time
	MemberNumber sql.NullString
	ActivatedAt  sql.NullTime
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

User is gorm model

type UserDTO

type UserDTO struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

func StudentsToUserDTOs

func StudentsToUserDTOs(students []demoService.Student) []UserDTO

type UserModel

type UserModel struct {
	UserId int
	Name   string
	Age    int
}

Jump to

Keyboard shortcuts

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