api

package
v0.0.0-...-8e399c3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeInformation

func ChangeInformation(c *gin.Context)

ChangeInformation @Summary 修改个人信息 @Description 修改个人信息 @Tags 个人中心 @Produce json @Param name body string false "姓名" @Param mobile body int false "手机" @Param email body string false "邮箱" @Success 200 {object} app.Response @Failure 400 {object} app.Response @Router /api/profile/information [put]

func ChangePassword

func ChangePassword(c *gin.Context)

ChangePassword @Summary 修改个人密码 @Description 修改个人密码 @Tags 个人中心 @Produce json @Param old_password body string true "旧密码" @Param password body string true "新密码" @Param confirm_password body string true "确认密码" @Success 200 {object} app.Response @Failure 400 {object} app.Response @Router /api/profile/password [put]

func MobileValidation

func MobileValidation(fl validator.FieldLevel) bool

MobileValidation 自定义验证函数

func NameValidation

func NameValidation(fl validator.FieldLevel) bool

NameValidation 自定义验证函数,只是示例,未使用

Types

type InformationFrom

type InformationFrom struct {
	Name string `json:"name" validate:"omitempty,min=2,max=32"`
	//Mobile string `json:"mobile" validate:"omitempty,e164"`
	Mobile string `json:"mobile" validate:"omitempty,MobileValidation"`
	Email  string `json:"email" validate:"omitempty,email"`
}

type PasswordFrom

type PasswordFrom struct {
	OldPassword     string `json:"old_password" validate:"required,min=6,max=32"`
	Password        string `json:"password" validate:"required,min=6,max=32,nefield=OldPassword"`
	ConfirmPassword string `json:"confirm_password" validate:"required,min=6,max=32,eqfield=Password"`
}

Jump to

Keyboard shortcuts

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