v1

package
v1.0.1-0...-5616c21 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DemoGet

func DemoGet(c *gin.Context)

DemoGet @Summary Demo for Get @Tags Demo API @Param param query CommonParam true "getParam" @Success 200 {object} app.ApiJson "" @Router /v1/demo/get [get]

func DemoPanic

func DemoPanic(c *gin.Context)

DemoPanic @Summary Demo for Panic @Tags Demo API @Success 200 {object} app.ApiJson "" @Router /v1/demo/panic [get]

func DemoPost

func DemoPost(c *gin.Context)

DemoPost @Summary Demo for Post @Tags Demo API @Param param body CommonParam true "getParam" @Success 200 {object} app.ApiJson "" @Router /v1/demo/post [post]

func SystemInfo

func SystemInfo(c *gin.Context)

SystemInfo @Summary System Info @Tags System API @Success 200 {object} app.ApiJson "" @Router /v1/system/info [get]

func UserLogin

func UserLogin(c *gin.Context)

UserLogin @Summary @Tags User API @Param param body LoginParam true "login param" @Success 200 {object} app.ApiJson "" @Router /v1/user/login [post]

func UserMe

func UserMe(c *gin.Context)

UserMe @Summary @Tags User API @Success 200 {object} app.ApiJson "" @Router /v1/user/me [post]

func UserRegister

func UserRegister(c *gin.Context)

UserRegister @Summary @Tags User API @Param param body RegisterParam true "register param" @Success 200 {object} app.ApiJson "" @Router /v1/user/register [post]

Types

type CommonParam

type CommonParam struct {
	// param1, min 10 words and max 255 words
	Param1 string `json:"param1" form:"param1" binding:"min=10,max=255"`
	// param2, required
	Param2 string `json:"param2" form:"param2" binding:"required"`
	// param3, if it's null, validate nothing. if it's not null, must match email regex
	Param3 string `json:"param3" form:"param3" binding:"omitempty,email"`
}

type LoginParam

type LoginParam struct {
	LoginName string `json:"loginName" form:"loginName" binding:"required"`
	Password  string `json:"password" form:"password" binding:"required"`
}

type RegisterParam

type RegisterParam struct {
	DisplayName string `json:"displayName" form:"displayName" binding:"required"`
	Email       string `json:"email" form:"email" binding:"required,email"`
	Phone       string `json:"phone" form:"phone" binding:"omitempty"`
	Password    string `json:"password" form:"password" binding:"required"`
}

Jump to

Keyboard shortcuts

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