// Copyright 2019 github.com. All rights reserved. // Use of this source code is governed by github.com. package v1 import ( "property-applete-gateway/param/base" "property-applete-gateway/pb/v1" ) type LoginBody struct { User string `form:"user"` Password string `form:"password"` } type LoginRequest struct { base.Header LoginBody } type LoginData struct { Uid int64 `json:"uid"` Token string `json:"token"` User string `json:"user"` IsSuper bool `json:"is_super"` Permissions []v1.SystemGroupPermissionData `json:"permissions"` } type LoginResponse struct { base.Result Data LoginData `json:"data"` // 当账号存在多个小区时使用phone_data PhoneData LoginByPhoneData `json:"phone_data"` } type TokenRequest struct { base.Header } type TokenResponse struct { base.Result Data string `json:"data"` RefreshToken string `json:"refresh_token"` } type GetVcodeQuery struct { Phone string `form:"phone"` } type GetVcodeRequest struct { GetVcodeQuery } type GetVcodeResponse struct { base.Result Data v1.GetVcodeReply `json:"data"` } type LoginByPhoneBody struct { // 短信验证码 Vcode uint32 `form:"vcode"` Phone string `form:"phone"` } type LoginByPhoneRequest struct { base.Header LoginByPhoneBody } type LoginByPhoneItem struct { Uid int64 `json:"uid"` User string `json:"user"` GardenName string `json:"garden_name"` GardenId int64 `json:"garden_id"` IsSuper bool `json:"is_super"` Permissions []v1.SystemGroupPermissionData `json:"permissions"` } type LoginByPhoneData struct { List []LoginByPhoneItem `json:"list"` Token string `json:"token"` } type LoginByPhoneResponse struct { base.Result Data LoginByPhoneData `json:"data"` } type ChooseUserQuery struct { Id int64 `form:"id" json:"id"` } type ChooseUserRequest struct { base.Header ChooseUserQuery } type ChooseUserResponse struct { base.Result Data LoginData `json:"data"` } type ResetPasswordBody struct { Phone string `form:"phone" json:"phone"` // 用户id,第一次调用时为空,如果电话对应多个账号,选择账号后第二次调用需填该值 Uid int64 `form:"uid" json:"uid"` // 短信验证码 Vcode uint32 `form:"vcode" json:"vcode"` Password string `form:"password" json:"password"` } type ResetPasswordRequest struct { ResetPasswordBody } type ResetPasswordResponse struct { base.Result Data v1.ResetPasswordReply `json:"data"` } type ChangePasswordBody struct { OldPassword string `form:"old_password" json:"old_password"` NewPassword string `form:"new_password" json:"new_password"` } type ChangePasswordRequest struct { base.Header ChangePasswordBody } type ChangePasswordResponse struct { base.Result } type CompanyEnterGardenRequest struct { base.Header } type CompanyEnterGardenResponse struct { base.Result Data LoginData `json:"data"` } type StatisticRequest struct{ base.Header } type StatisticResponse struct { base.Result Data v1.StatisticReply `json:"data"` }