123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- // 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"`
- }
|