package protocol

/*修改手机号-验证旧手机验证码 */
type CheckSmsCodeRequest struct {
	Captcha string `json:"captcha" valid:"Required"`
}
type CheckSmsCodeResponse struct {
}

/*修改手机号*/
type ChangePhoneRequest struct {
	Phone   string `json:"phone" valid:"Mobile"`
	Captcha string `json:"captcha" valid:"Required"`
}
type ChangePhoneResponse struct {
}

/*ResetPassword */
type ResetPasswordRequest struct {
	NewPwd     string `json:"newPwd" valid:"Required"`
	ConfirmPwd string `json:"confirmPwd" valid:"Required"`
}
type ResetPasswordResponse struct {
}

/*ChangePassword */
type ChangePasswordRequest struct {
	NewPwd     string `json:"newPwd" valid:"Required"`
	ConfirmPwd string `json:"confirmPwd" valid:"Required"`
	OldPwd     string `json:"oldPwd" valid:"Required"`
}
type ChangePasswordResponse struct {
}

/*UserCompanys */
type UserCompanysRequest struct {
}
type UserCompanysResponse struct {
	Companys []Company `json:"companys"`
}

/*SwitchCompany */
type SwitchCompanyRequest struct {
	CompanyId int64 `json:"companyId" valid:"Required"`
}
type SwitchCompanyResponse struct {
	AuthCode string `json:"authCode"`
}

/*用户信息 UserInfo */
type UserInfoRequest struct {
}
type UserInfoResponse struct {
	User User `json:"user"`
}

type User struct {
	UserId     int64   `json:"uid"`
	Name       string  `json:"uname"`
	Phone      string  `json:"phone"`
	Image      Picture `json:"image"`
	Department Dep     `json:"dep"`
	Position   Job     `json:"job"`
	ImToken    string  `json:"imToken"`

	//companys
	CompanyId int       `json:"companyId"`
	Company   Company   `json:"company"` //公司名称
	Companys  []Company `json:"companys"`
}

//公司
type Company struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

//部门
type Dep struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

//岗位
type Job struct {
	Id    int    `json:"id"`
	Name  string `json:"name"`
	Level int    `json:"level"`
}

//用户统计信息
/*UserStatistics */
type UserStatisticsRequest struct {
	TypeTotal int64 `json:"typeTotal" valid:"Required"`
}
type UserStatisticsResponse struct {
	Totals []TypeTotalItem `json:"totals"`
}
type TypeTotalItem struct {
	Type       int64 `json:"type"`       //类型
	Total      int   `json:"total"`      //总数
	HaveUpdate int   `json:"haveUpdate"` //是否含有更新(0无更新,1有更新)
}