object

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParamsCreateWithUserName

type ParamsCreateWithUserName struct {
	Username   string  `json:"username" validate:"required,max=32" comment:"用户名"`    // 用户名
	Password   string  `json:"password" validate:"required,max=32" comment:"密码"`     // 密码
	InviteCode *string `json:"invite_code" validate:"omitempty,len=8" comment:"邀请码"` // 邀请码
}

type ParamsUpdateProfile

type ParamsUpdateProfile struct {
	Username *string                    `json:"username" validate:"omitempty,max=32" comment:"用户名"` // 用户名,部分用户有机会修改自己的用户名,比如微信注册的帐号
	Nickname *string                    `json:"nickname" validate:"omitempty,max=32" comment:"昵称"`
	Gender   *model.Gender              `json:"gender" validate:"omitempty,number,oneof=0 1 2" comment:"性别"`
	Avatar   *string                    `json:"avatar" validate:"omitempty,url,max=255" comment:"头像"`
	Wechat   *UpdateWechatProfileParams `json:"wechat" validate:"omitempty" comment:"微信绑定信息"` // 更新微信绑定的帐号相关
}

type UpdateWechatProfileParams

type UpdateWechatProfileParams struct {
	Nickname  *string `json:"nickname" validate:"omitempty,max=32" comment:"微信昵称"`        // 用户昵称
	AvatarUrl *string `json:"avatar_url" validate:"omitempty,url,max=255" comment:"微信头像"` // 用户头像
	Gender    *int    `json:"gender" validate:"omitempty,number" comment:"性别"`            // 性别
	Country   *string `json:"country" validate:"omitempty,max=32" comment:"国家"`           // 国家
	Province  *string `json:"province" validate:"omitempty,max=32" comment:"省份"`          // 省份
	City      *string `json:"city" validate:"omitempty,max=32" comment:"城市"`              // 城市
	Language  *string `json:"language" validate:"omitempty,max=32" comment:"语言"`          // 语言
}

绑定的微信信息帐号相关

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(db *gorm.DB, ctx helper.Context) User

func (User) Create

func (u User) Create(input ParamsCreateWithUserName) (data schema.Profile, err error)

func (User) GetProfile

func (u User) GetProfile(uid string)

func (User) Update

func (u User) Update(input ParamsUpdateProfile) (data schema.Profile, err error)

Jump to

Keyboard shortcuts

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