sys_user.go 5.7 KB
Newer Older
haoyanbin's avatar
1  
haoyanbin committed
1 2 3 4 5 6 7
package request

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

haoyanbin's avatar
1  
haoyanbin committed
8 9 10 11 12 13 14 15 16
type SendCodeReq struct {
	Mobile string `json:"mobile"`
}

type CheckCodeReq struct {
	Mobile string `json:"mobile"`
	Code   string `json:"code"`
}

haoyanbin's avatar
1  
haoyanbin committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
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"`
}