• haoyanbin's avatar
    1 · 7970f4d3
    haoyanbin authored
    7970f4d3
sys_user.go 5.8 KB
package request

import (
	"gin-vue-admin/model"
	uuid "github.com/satori/go.uuid"
)

type SendCodeReq struct {
	Mobile string `json:"mobile"`
}

type CheckCodeReq struct {
	UserId int    `gorm:"type:int(255)" json:"user_id"`
	MocId  int    `gorm:"type:int(255)" json:"moc_id"`
	Mobile string `json:"mobile"`
	Code   string `json:"code"`
}

type MobileRegisterReq struct {
	Mobile       string `json:"mobile"`       //Phone:手机登录 WeChat:微信登录
	HospitalCode string `json:"hospitalCode"` //Phone:手机登录 WeChat:微信登录
	RegType      int    `json:"regType"`      //Phone:手机登录 WeChat:微信登录
}

type MobileLogin struct {
	LoginType     string `json:"loginType"`     //Phone:手机登录 WeChat:微信登录
	EncryptedDate string `json:"encryptedDate"` //小程序通过 api 得到的加密数据
	Iv            string `json:"iv"`            //小程序通过 api 得到的初始向量
	WxCode        string `json:"wxCode"`        //微信code
	Code          string `json:"code"`          //验证码
	Scene         string `json:"scene"`         // phone;hospitalCode;otherNo
	UserType      int    `json:"userType"`
	//HospitalCode  string `json:"hospitalCode"`  //手机号
	//OtherNo       string `json:"otherNo"`       //领取积分时 传金像奖id
	//NickName      string `json:"nickName"`
	//AvatarUrl     string `json:"avatarUrl"`
}

type GetUserInfoReq struct {
}

type GetUserInfoReply struct {
	model.SysUserAuthe
	PointsNum int      `json:"pointsNum"`
	DbddAuth  int      `json:"dbddAuth"`
	ImExpert  ImExpert `json:"imExpert" gorm:"-"`
}

type ImExpertReq struct {
	Phone string `json:"phone"`
}

type ImExpertReply struct {
	Code int      `json:"code"`
	Data ImExpert `json:"data"`
}

type ImExpert struct {
	ID             int    `json:"ID" gorm:"column:id;comment:用户昵称"`       // 用户昵称
	Name           string `json:"name" gorm:"column:name;comment:用户昵称"`   // 用户昵称
	Phone          string `json:"phone" gorm:"column:phone;comment:用户昵称"` // 用户昵称
	HeaderImg      string `json:"headerImg" gorm:"column:header_img"`     // 用户头像
	ClinicalExp    string `json:"clinicalExp" gorm:"column:clinical_exp"` //
	Sex            int    `json:"sex" gorm:"column:sex"`                  // 客服是否在线  0: 不在线  1:在线
	ImState        int    `json:"imState" gorm:"column:im_state"`         // 客服是否在线  0: 不在线  1:在线
	Status         int    `json:"status" gorm:"column:status"`
	ExpertSource   int    `json:"expertSource" gorm:"column:expert_source"`
	ExpertSourceId string `json:"expertSourceId" gorm:"column:expert_source_id"`
	GroupId        int    `json:"groupId" gorm:"column:group_id"`
	GroupName      string `json:"groupName" gorm:"column:group_name"`
	GroupSourceId  string `json:"groupSourceId" gorm:"column:group_source_id"`
	CreateTime     string `json:"createTime" gorm:"column:create_time"`
	DoctorCount    string `json:"doctorCount" gorm:"column:doctor_count"`
}

// User register structure
type Register struct {
	Username    string `json:"userName"` //
	Password    string `json:"passWord"`
	NickName    string `json:"nickName" gorm:"default:'QMPlusUser'"`
	HeaderImg   string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
	AuthorityId string `json:"authorityId" gorm:"default:888"`
}

type HospitalRegister struct {
	Username     string `json:"userName"`
	ChainCode    string `json:"chainCode"`
	HospitalCode string `json:"hospitalCode"`
	Code         string `json:"code"`
}

// User login structure
type Login struct {
	Username  string `json:"username"`  // 用户名
	Password  string `json:"password"`  // 密码
	Captcha   string `json:"captcha"`   // 验证码
	CaptchaId string `json:"captchaId"` // 验证码ID
}

// Modify password structure
type ChangePasswordStruct struct {
	Mobile      string `json:"mobile"`      // 用户名
	Password    string `json:"password"`    // 密码
	NewPassword string `json:"newPassword"` // 新密码
}

// Modify  user's auth structure
type SetUserAuth struct {
	UUID        uuid.UUID `json:"uuid"`        // 用户UUID
	AuthorityId string    `json:"authorityId"` // 角色ID
}

type SendMsgReq struct {
	Phone   string `json:"phone"`
	MsgType string `json:"msgType"`
}

type UpdateUserReq struct {
	NickName  string `json:"nickName"`
	HeaderImg string `json:"headerImg"`
}

type DeleteReq struct {
	Id int `json:"id"`
}

type GetMobileUserInfoReq struct {
	Id string `json:"id"`
}

type GetMobileUserListReq struct {
	PageInfo
	Mobile         string `json:"mobile" form:"mobile"`
	StartCreatedAt string `json:"startCreatedAt" form:"startCreatedAt"`
	EndCreatedAt   string `json:"endCreatedAt" form:"endCreatedAt"`
	IsManager      string `json:"isManager"`
	IsAuth         string `json:"isAuth"`
	IsVip          string `json:"isVip"`
	AuthorityId    string `json:"authorityId"`
	UserType       string `json:"userType"`
}

type GetMobileUserListReply struct {
	Id              string `json:"id"`
	Mobile          string `json:"mobile"`
	CreatedAt       string `json:"createdAt"`
	NickName        string `json:"nickName"`
	Name            string `json:"name"`
	Phone           string `json:"phone"`
	WorkingYears    string `json:"workingYears"`
	WorkingPlace    string `json:"workingPlace"`
	Position        string `json:"Position"`
	ProvinceName    string `json:"provinceName"`
	CityName        string `json:"cityName"`
	CountyName      string `json:"countyName"`
	HospitalAddress string `json:"hospitalAddress"`
	UpdateTime      string `json:"updateTime"`
	MaturityTime    string `json:"maturityTime"`
	VipLevel        string `json:"vipLevel"`
	PointsNum       string `json:"pointsNum"`
}

type GetUserNameReq struct {
	Mobile string `json:"mobile"`
}

type GetUserNameReply struct {
	Id       int    `json:"id"`
	Mobile   string `json:"mobile"`
	Name     string `json:"name"`
	NickName string `json:"nickName"`
}