syntax = "v1"

info (
	title:   "user 相关 api"
	desc:    "注册登录"
	author:  "whyiyhw"
	email:   "whyiyhw@outlook.com"
	version: "v1"
)

type (
	UserRegisterReq {
		Avatar   string `json:"avatar,optional"  label:"头像"`
		Email    string `json:"email,optional" validate:"required,email" label:"邮箱"`
		Name     string `json:"name,optional" validate:"required,max=50" label:"用户名"`
		Password string `json:"password,optional" validate:"required" label:"密码"`
	}
	UserRegisterReply {
		Message string `json:"message"`
	}
	UserLoginReq {
		Email    string `json:"email,optional" validate:"required,email" label:"邮箱"`
		Password string `json:"password,optional" validate:"required" label:"密码"`
	}
	UserLoginReply {
		Token string `json:"token" label:"认证token"`
	}
	UserDetailReq  {}
	UserDetailReply {
		ID    int64  `json:"id" label:"用户id"`
		Email string `json:"email" label:"邮箱"`
		Name  string `json:"name" label:"用户名"`
		IsAdmin bool `json:"is_admin" label:"是否是管理员"`
	}
)

