Browse Source

1.登录选择公司登陆
2.更替Proto文件

huangyp 6 years ago
parent
commit
41a352af3d

+ 42 - 28
UU_Ent/UU_Ent.xcodeproj/project.pbxproj

@@ -18,6 +18,7 @@
 		2710E66522815DCF0002A4B0 /* YRMineCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E66422815DCF0002A4B0 /* YRMineCell.m */; };
 		2710E66822815E030002A4B0 /* YRMineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E66722815E030002A4B0 /* YRMineModel.m */; };
 		2710E66A228166990002A4B0 /* mine_route.json in Resources */ = {isa = PBXBuildFile; fileRef = 2710E669228166990002A4B0 /* mine_route.json */; };
+		2710E66E2281746E0002A4B0 /* UIPopoverListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E66D2281746E0002A4B0 /* UIPopoverListView.m */; };
 		3FE47A8D89A70D18F98B1E41 /* libPods-UU_EntUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F4F857DEEC69AEDCFACDFD51 /* libPods-UU_EntUITests.a */; };
 		9948171422783494007C7CEA /* msg_route.json in Resources */ = {isa = PBXBuildFile; fileRef = 9948171322783494007C7CEA /* msg_route.json */; };
 		9948171722785013007C7CEA /* YRWorkTabCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9948171622785013007C7CEA /* YRWorkTabCell.m */; };
@@ -150,8 +151,8 @@
 		27029BD22277E16300D53A94 /* YRButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRButton.m; sourceTree = "<group>"; };
 		2710E65322801B7E0002A4B0 /* YRRegisterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRRegisterVC.h; sourceTree = "<group>"; };
 		2710E65422801B7E0002A4B0 /* YRRegisterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRRegisterVC.m; sourceTree = "<group>"; };
-		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Controllers/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
-		2710E65722801B930002A4B0 /* YRPwdLevelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = YRPwdLevelView.m; path = UU_Ent/Modules/Login/Main/Controllers/YRPwdLevelView.m; sourceTree = SOURCE_ROOT; };
+		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
+		2710E65722801B930002A4B0 /* YRPwdLevelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = YRPwdLevelView.m; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.m; sourceTree = SOURCE_ROOT; };
 		2710E65B22801E330002A4B0 /* LeftViewTF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LeftViewTF.h; sourceTree = "<group>"; };
 		2710E65C22801E330002A4B0 /* LeftViewTF.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LeftViewTF.m; sourceTree = "<group>"; };
 		2710E65E22801ED10002A4B0 /* YRShowMessageFromNavi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRShowMessageFromNavi.h; sourceTree = "<group>"; };
@@ -161,6 +162,8 @@
 		2710E66622815E030002A4B0 /* YRMineModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRMineModel.h; sourceTree = "<group>"; };
 		2710E66722815E030002A4B0 /* YRMineModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRMineModel.m; sourceTree = "<group>"; };
 		2710E669228166990002A4B0 /* mine_route.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = mine_route.json; sourceTree = "<group>"; };
+		2710E66C2281746E0002A4B0 /* UIPopoverListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPopoverListView.h; sourceTree = "<group>"; };
+		2710E66D2281746E0002A4B0 /* UIPopoverListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIPopoverListView.m; sourceTree = "<group>"; };
 		49A8B37D50A80EFFD84620EC /* Pods-UU_EntTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UU_EntTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-UU_EntTests/Pods-UU_EntTests.release.xcconfig"; sourceTree = "<group>"; };
 		49D3F089EECE8E3EDF7D2E1C /* Pods-UU_EntUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UU_EntUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-UU_EntUITests/Pods-UU_EntUITests.release.xcconfig"; sourceTree = "<group>"; };
 		71B4DF45C8EC3368ACFC4193 /* Pods-UU_Ent.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UU_Ent.debug.xcconfig"; path = "Pods/Target Support Files/Pods-UU_Ent/Pods-UU_Ent.debug.xcconfig"; sourceTree = "<group>"; };
@@ -389,6 +392,38 @@
 			path = Views;
 			sourceTree = "<group>";
 		};
+		2710E66B2281744C0002A4B0 /* UIPopoverListView */ = {
+			isa = PBXGroup;
+			children = (
+				2710E66C2281746E0002A4B0 /* UIPopoverListView.h */,
+				2710E66D2281746E0002A4B0 /* UIPopoverListView.m */,
+			);
+			path = UIPopoverListView;
+			sourceTree = "<group>";
+		};
+		2710E66F228175140002A4B0 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+				2710E65622801B930002A4B0 /* YRPwdLevelView.h */,
+				2710E65722801B930002A4B0 /* YRPwdLevelView.m */,
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
+		2710E670228175280002A4B0 /* Models */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Models;
+			sourceTree = "<group>";
+		};
+		2710E671228175390002A4B0 /* Others */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Others;
+			sourceTree = "<group>";
+		};
 		999F650C227E656B00329012 /* UIView */ = {
 			isa = PBXGroup;
 			children = (
@@ -587,6 +622,7 @@
 		99C6FE8D22768EC000C7070A /* Utils */ = {
 			isa = PBXGroup;
 			children = (
+				2710E66B2281744C0002A4B0 /* UIPopoverListView */,
 				2710E65A22801D870002A4B0 /* UINavigation */,
 				2710E65922801D760002A4B0 /* UITextField */,
 				999F651B227E6A3E00329012 /* NSString */,
@@ -697,28 +733,14 @@
 		99C6FEA32276940600C7070A /* Main */ = {
 			isa = PBXGroup;
 			children = (
-				99C6FEA42276940600C7070A /* Others */,
-				99C6FEA52276940600C7070A /* Models */,
+				2710E671228175390002A4B0 /* Others */,
+				2710E670228175280002A4B0 /* Models */,
+				2710E66F228175140002A4B0 /* Views */,
 				99C6FEA62276940600C7070A /* Controllers */,
-				99C6FEA72276940600C7070A /* Views */,
 			);
 			path = Main;
 			sourceTree = "<group>";
 		};
-		99C6FEA42276940600C7070A /* Others */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = Others;
-			sourceTree = "<group>";
-		};
-		99C6FEA52276940600C7070A /* Models */ = {
-			isa = PBXGroup;
-			children = (
-			);
-			path = Models;
-			sourceTree = "<group>";
-		};
 		99C6FEA62276940600C7070A /* Controllers */ = {
 			isa = PBXGroup;
 			children = (
@@ -730,15 +752,6 @@
 			path = Controllers;
 			sourceTree = "<group>";
 		};
-		99C6FEA72276940600C7070A /* Views */ = {
-			isa = PBXGroup;
-			children = (
-				2710E65622801B930002A4B0 /* YRPwdLevelView.h */,
-				2710E65722801B930002A4B0 /* YRPwdLevelView.m */,
-			);
-			path = Views;
-			sourceTree = "<group>";
-		};
 		99C6FEA92276941900C7070A /* Others */ = {
 			isa = PBXGroup;
 			children = (
@@ -1331,6 +1344,7 @@
 				99C6FED12276982F00C7070A /* YRTabBar.m in Sources */,
 				27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */,
 				99C6FF232276E4C000C7070A /* YRMsgMainCell.m in Sources */,
+				2710E66E2281746E0002A4B0 /* UIPopoverListView.m in Sources */,
 				99C16345228027C8002ED79D /* YRMsgHeader.m in Sources */,
 				99C6FECB227696CA00C7070A /* YRMsgVC.m in Sources */,
 				99C16340227FD24E002ED79D /* YRWorkConModel.m in Sources */,

+ 125 - 6
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m

@@ -11,7 +11,7 @@
 #import "YRRegisterVC.h"
 #import <UU_Ent/Account.pbrpc.h>
 
-@interface YRLoginVC ()<UITextFieldDelegate>
+@interface YRLoginVC ()<UITextFieldDelegate,UIPopoverListViewDelegate,UIPopoverListViewDataSource>
 @property (nonatomic,strong) UIScrollView *scrollView;
 @property (nonatomic,strong) UITextField *passwordTF;
 @property (nonatomic,strong) UITextField *phoneTF;
@@ -54,19 +54,27 @@
         [MBProgressHUD hideHUDForView:self.view animated:YES];
 
         if (response.responseHeader.success) {
-
-        [YRUserInfo shareManager].masChanged = YES;
-
+            
+            [YRUserInfo shareManager].masChanged = YES;
             
             NSDictionary *resDic = response.mj_keyValues;
             
             [YRUserInfo shareManager].token = response.authedToken.token;
+            
             [YRUserInfo shareManager].userInfo = resDic;
             
-            if (self.completed) {
+            /*用户绑定的企业大于1个时,提供选择公司登陆*/
+            if (response.companyArray.count > 1) {
                 
-                self.completed(YES);
+                [self setSelectCompanyUI];
                 
+            }else{
+                /*只有一个企业时,直接登录*/
+                if (self.completed) {
+                    
+                    self.completed(YES);
+                    
+                }
             }
             
         }else{
@@ -78,6 +86,117 @@
     }];
 }
 
+#pragma mark --- 登录某家公司
+-(void)loginCompanyAction:(NSDictionary *)dic
+{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    
+    [GRPCCall useInsecureConnectionsForHost:kHostAddress];
+    
+    AccountService *client = [[AccountService alloc]initWithHost:kHostAddress];
+    
+    SwitchCompanyRequest *request = [SwitchCompanyRequest message];
+    
+    request.companyId = [[dic objectForKey:@"id_p"] integerValue];
+    
+    GRPCProtoCall *call = [client RPCToswitchCompanyWithRequest:request handler:^(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error) {
+        
+        [MBProgressHUD hideHUDForView:self.view animated:YES];
+        
+        if (response.responseHeader.success) {
+            
+            [YRUserInfo shareManager].masChanged = YES;
+            
+            NSDictionary *resDic = response.mj_keyValues;
+            
+            [YRUserInfo shareManager].token = response.authedToken.token;
+            
+            [YRUserInfo shareManager].userCompanyInfo = resDic;
+            
+            if (self.completed) {
+                
+                self.completed(YES);
+                
+            }
+            
+        }else{
+            
+            
+        }
+    }];
+    
+    call.requestHeaders[@"authentication"] = [YRUserInfo shareManager].token;
+    
+    [call start];
+}
+
+#pragma mark --- UIPopoverListView Delegate : 公司选择
+-(void)setSelectCompanyUI
+{
+    CGFloat xWidth = self.view.bounds.size.width - 33;
+    CGFloat yHeight = 300.0f;
+    CGFloat yOffset = (self.view.bounds.size.height - yHeight)/2.0f;
+    UIPopoverListView *companyPopList = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10, yOffset, xWidth, yHeight) isDateView:NO];
+    companyPopList.isCannotClickBackGround = YES;
+    companyPopList.delegate = self;
+    companyPopList.datasource = self;
+    [companyPopList setTitle:@"公司"];
+    [companyPopList show];
+}
+
+- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
+                    cellForIndexPath:(NSIndexPath *)indexPath
+{
+    static NSString *identifier = @"cell";
+    
+    UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1
+                                                   reuseIdentifier:identifier];
+    
+    NSArray *companyArr = [[YRUserInfo shareManager].userInfo objectForKey:@"companyArray"];
+    
+    NSDictionary *companyDic = [companyArr objectAtIndex:indexPath.row];
+    
+    cell.textLabel.text = [companyDic objectForKey:@"name"];
+    
+    cell.textLabel.font = FONT_SIZE(13);
+    
+    return cell;
+}
+
+- (NSInteger)popoverListView:(UIPopoverListView *)popoverListView
+       numberOfRowsInSection:(NSInteger)section
+{
+    NSArray *companyArr = [[YRUserInfo shareManager].userInfo objectForKey:@"companyArray"];
+    
+    return [companyArr count];
+}
+
+- (void)popoverListView:(UIPopoverListView *)popoverListView
+     didSelectIndexPath:(NSIndexPath *)indexPath
+{
+    NSArray *companyArr = [[YRUserInfo shareManager].userInfo objectForKey:@"companyArray"];
+    
+    NSDictionary *companyDic = [companyArr objectAtIndex:indexPath.row];
+    
+    [self loginCompanyAction:companyDic];
+    
+}
+
+- (NSInteger)numberOfSectionsInUIPopoverListView:(UIPopoverListView *)tableView
+{
+    return 1;
+}
+
+- (NSString *)popoverListView:(UIPopoverListView *)popoverListView titleForHeaderInSection:(NSInteger)section {
+    return nil;
+}
+
+- (CGFloat)popoverListView:(UIPopoverListView *)popoverListView
+   heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    return 30.0f;
+}
+
 #pragma mark --- 新用户注册
 -(void)registerAction
 {

+ 0 - 0
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRPwdLevelView.h → UU_Ent/UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h


+ 0 - 0
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRPwdLevelView.m → UU_Ent/UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.m


+ 5 - 0
UU_Ent/UU_Ent/Modules/Mine/Main/Others/YRUserInfo.h

@@ -24,6 +24,11 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property(strong,nonatomic)NSDictionary *userInfo;
 
+/**
+ 登录某家公司返回的账户所有信息
+ */
+@property(strong,nonatomic)NSDictionary *userCompanyInfo;
+
 /**
  是否切换账套
  */

+ 1 - 0
UU_Ent/UU_Ent/Supporting Files/defines/import.h

@@ -28,6 +28,7 @@
 #import "UILabel+vertical.h"
 #import "YRShowMessageFromNavi.h"
 #import "YRBaseNav.h"
+#import "UIPopoverListView.h"
 
 //第三方导入
 #import <GRPCClient/GRPCCall+Tests.h>

+ 74 - 0
UU_Ent/UU_Ent/Utils/UIPopoverListView/UIPopoverListView.h

@@ -0,0 +1,74 @@
+//
+//  UIPopoverListView.h
+//  UIPopoverListViewDemo
+//
+//  Created by su xinde on 13-3-13.
+//  Copyright (c) 2013年 su xinde. All rights reserved.
+//
+#import <UIKit/UIKit.h>
+
+
+@class UIPopoverListView;
+
+@protocol UIPopoverListViewDataSource <NSObject>
+@required
+
+- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
+                    cellForIndexPath:(NSIndexPath *)indexPath;
+
+- (NSInteger)popoverListView:(UIPopoverListView *)popoverListView
+       numberOfRowsInSection:(NSInteger)section;
+- (NSInteger)numberOfSectionsInUIPopoverListView:(UIPopoverListView *)popoverListView;
+
+-(NSString*)popoverListView:(UIPopoverListView*)popoverListView titleForHeaderInSection:(NSInteger)section;
+@end
+
+@protocol UIPopoverListViewDelegate <NSObject>
+@optional
+
+- (void)popoverListView:(UIPopoverListView *)popoverListView
+     didSelectIndexPath:(NSIndexPath *)indexPath;
+
+- (void)popoverListViewCancel:(UIPopoverListView *)popoverListView;
+
+- (CGFloat)popoverListView:(UIPopoverListView *)popoverListView
+   heightForRowAtIndexPath:(NSIndexPath *)indexPath;
+- (void)setDateText:(NSString*) dateText;
+@end
+
+
+@interface UIPopoverListView : UIView <UITableViewDataSource, UITableViewDelegate,UITextViewDelegate,UIWebViewDelegate,UITabBarDelegate>
+{
+    UITableView  *_listView;
+    UILabel      *_titleView;
+    UIControl    *_overlayView;
+    UIDatePicker *_datePickerView;
+    UIWebView    *_webView;
+    
+    //id<UIPopoverListViewDataSource> _datasource;
+    //id<UIPopoverListViewDelegate>   _delegate;
+    
+}
+
+@property (nonatomic, strong) id<UIPopoverListViewDataSource> datasource;
+@property (nonatomic, strong) id<UIPopoverListViewDelegate>   delegate;
+@property (nonatomic, retain) UITableView *listView;
+@property (nonatomic, strong) UIDatePicker *datePickerView;
+@property (nonatomic,strong) UITextView *textView;;
+@property (nonatomic, copy) dispatch_block_t dateBlock;
+@property (nonatomic, copy) dispatch_block_t BackBlock;
+@property (nonatomic,strong) NSDictionary *detailDicArr;
+@property (nonatomic,strong) NSString *webViewLink;
+@property (nonatomic,assign)BOOL isCannotClickBackGround;
+
+@property (nonatomic,strong) NSString *ImageWeburl;
+- (void)setTitle:(NSString *)title;
+- (id)initWithFrame:(CGRect)frame isDateView:(BOOL)isDateView;
+- (void)show;
+- (void)dismiss;
+- (id)initWithFrame:(CGRect)frame isDetail:(NSString*)isDetail;
+- (id)initWithFrame:(CGRect)frame DateAndTimeTitle:(NSString*)title;
+- (id)initWithFrame:(CGRect)frame forTextView:(BOOL)isTextView;
+- (id)initWithFrame:(CGRect)frame forMapView:(NSString*)webViewLink;
+- (id)initWithFrame:(CGRect)frame imageName:(NSString*)name;
+@end

+ 468 - 0
UU_Ent/UU_Ent/Utils/UIPopoverListView/UIPopoverListView.m

@@ -0,0 +1,468 @@
+//
+//  UIPopoverListView.m
+//  UIPopoverListViewDemo
+//
+//  Created by su xinde on 13-3-13.
+//  Copyright (c) 2013年 su xinde. All rights reserved.
+//
+
+#import "UIPopoverListView.h"
+#import <QuartzCore/QuartzCore.h>
+
+//#define FRAME_X_INSET 20.0f
+//#define FRAME_Y_INSET 40.0f
+
+@interface UIPopoverListView ()
+
+//- (void)defalutInit;
+- (void)fadeIn;
+- (void)fadeOut;
+
+@end
+
+@implementation UIPopoverListView
+NSString *popoverDateStr;
+//view
+UIView *popDetailView;
+@synthesize datasource = _datasource;
+@synthesize delegate = _delegate;
+
+@synthesize listView = _listView;
+@synthesize datePickerView=_datePickerView;
+
+- (id)initWithFrame:(CGRect)frame isDateView:(BOOL)isDateView
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self defalutInit:isDateView];
+    }
+    return self;
+}
+- (id)initWithFrame:(CGRect)frame forTextView:(BOOL)isTextView
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self textViewDefalutInit:isTextView];
+    }
+    return self;
+}
+- (id)initWithFrame:(CGRect)frame forMapView:(NSString *)webViewLink
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self webViewDefalutInit:webViewLink];
+    }
+    return self;
+}
+
+- (id)initWithFrame:(CGRect)frame imageName:(NSString*)name
+{
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self imageViewDefalutInit:name];
+    }
+    return self;
+}
+
+- (void)imageViewDefalutInit:(NSString*)name
+{
+    self.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    self.layer.borderWidth = 1.0f;
+    self.layer.cornerRadius = 10.0f;
+    self.clipsToBounds = TRUE;
+    
+    _titleView = [[UILabel alloc] initWithFrame:CGRectZero];
+    _titleView.font =  FONT_SIZE(15);
+    _titleView.backgroundColor = HexColor(@"#4388B7");
+    _titleView.textAlignment = NSTextAlignmentCenter;
+    _titleView.textColor = [UIColor whiteColor];
+    CGFloat xWidth = self.bounds.size.width;
+    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
+    _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
+    [self addSubview:_titleView];
+    
+        UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 32.0f, self.bounds.size.width, self.bounds.size.height-32.0f)];
+        view.backgroundColor=[UIColor whiteColor];
+        [self addSubview:view];
+        //UIImageView
+        UIImageView *imageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 150,150)];
+        imageView.center=CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2+17);
+        imageView.image=[UIImage imageNamed:name];
+        [self addSubview:imageView];
+    
+    
+    
+    
+    _overlayView = [[UIControl alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    _overlayView.backgroundColor = [UIColor colorWithRed:.16 green:.17 blue:.21 alpha:.8];
+    
+    
+    if (self.isCannotClickBackGround) {
+        [_overlayView addTarget:self
+                         action:@selector(dismiss)
+               forControlEvents:UIControlEventTouchUpInside];
+								
+    }
+    
+}
+
+- (void)webViewDefalutInit:(NSString *)webViewLink
+{
+    
+    self.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    self.layer.borderWidth = 1.0f;
+    self.layer.cornerRadius = 10.0f;
+    self.clipsToBounds = TRUE;
+    
+    _titleView = [[UILabel alloc] initWithFrame:CGRectZero];
+    _titleView.font =  FONT_SIZE(15);
+    _titleView.backgroundColor = HexColor(@"#4388B7");
+    _titleView.textAlignment = NSTextAlignmentCenter;
+    _titleView.textColor = [UIColor whiteColor];
+    CGFloat xWidth = self.bounds.size.width;
+    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
+    _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
+    [self addSubview:_titleView];
+    //view
+    popDetailView=[[UIView alloc] initWithFrame:CGRectMake(0, 32.0f, self.bounds.size.width, self.bounds.size.height-32.0f)];
+    popDetailView.backgroundColor=[UIColor whiteColor];
+    [self addSubview:popDetailView];
+    //textView
+    
+    _webView=[[UIWebView alloc] initWithFrame:CGRectMake(0, 32, self.bounds.size.width, self.bounds.size.height)];
+    [self addSubview:_webView];
+    _webView.delegate=self;
+    _webView.scalesPageToFit=YES;
+    NSMutableURLRequest *preRequest;
+    DLog(@"popWebView=%@",webViewLink);
+    preRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:webViewLink]];
+    [_webView loadRequest:preRequest];
+
+    _overlayView = [[UIControl alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    _overlayView.backgroundColor = [UIColor colorWithRed:.16 green:.17 blue:.21 alpha:.8
+                                    ];
+    if (self.isCannotClickBackGround) {
+        [_overlayView addTarget:self
+                         action:@selector(dismiss)
+               forControlEvents:UIControlEventTouchUpInside];
+								
+    }
+}
+
+- (void)textViewDefalutInit:(BOOL)isTextView
+{
+    self.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    self.layer.borderWidth = 1.0f;
+    self.layer.cornerRadius = 10.0f;
+    self.clipsToBounds = TRUE;
+    
+    _titleView = [[UILabel alloc] initWithFrame:CGRectZero];
+    _titleView.font =  FONT_SIZE(15);
+    _titleView.backgroundColor = HexColor(@"#4388B7");
+    _titleView.textAlignment = NSTextAlignmentCenter;
+    _titleView.textColor = [UIColor whiteColor];
+    CGFloat xWidth = self.bounds.size.width;
+    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
+    _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
+    [self addSubview:_titleView];
+    //view
+    popDetailView=[[UIView alloc] initWithFrame:CGRectMake(0, 32.0f, self.bounds.size.width, self.bounds.size.height-32.0f)];
+    popDetailView.backgroundColor=[UIColor whiteColor];
+    [self addSubview:popDetailView];
+    //textView
+    
+    self.textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 32.0f, self.bounds.size.width, self.bounds.size.height-32.0f)];//初始化大小并自动释放
+    
+    self.textView.textColor = [UIColor blackColor];//设置textview里面的字体颜色
+    
+    self.textView.font = [UIFont fontWithName:@"Arial" size:15.0];//设置字体名字和字体大小
+    
+    //self.textView.delegate = self;//设置它的委托方法
+    
+    self.textView.backgroundColor = [UIColor whiteColor];//设置它的背景颜色
+    
+    //self.textView.text = @"请在此处输入:";//设置它显示的内容
+    
+    self.textView.returnKeyType = UIReturnKeyDefault;//返回键的类型
+    
+    self.textView.keyboardType = UIKeyboardTypeDefault;//键盘类型
+    
+    self.textView.scrollEnabled = YES;//是否可以拖动
+    
+    UILabel *label=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 20)];
+    label.text=@"请在此处输入:";
+    label.tag=1;
+    [self.textView addSubview:label];
+    [self addSubview:self.textView];
+
+    
+    
+    
+    _overlayView = [[UIControl alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    _overlayView.backgroundColor = [UIColor colorWithRed:.16 green:.17 blue:.21 alpha:.8
+                                    ];
+    if (self.isCannotClickBackGround) {
+        [_overlayView addTarget:self
+                         action:@selector(dismiss)
+               forControlEvents:UIControlEventTouchUpInside];
+								
+    }
+}
+
+- (void)defalutInit:(BOOL)isDateView
+{
+    self.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    self.layer.borderWidth = 1.0f;
+    self.layer.cornerRadius = 10.0f;
+    self.clipsToBounds = TRUE;
+    
+    _titleView = [[UILabel alloc] initWithFrame:CGRectZero];
+
+    _titleView.font =  FONT_SIZE(15);
+    _titleView.backgroundColor = HexColor(@"#4388B7");
+
+    _titleView.textAlignment = NSTextAlignmentCenter;
+    _titleView.textColor = [UIColor whiteColor];
+    CGFloat xWidth = self.bounds.size.width;
+    _titleView.lineBreakMode = NSLineBreakByCharWrapping;
+    _titleView.frame = CGRectMake(0, 0, xWidth, 32.0f);
+    [self addSubview:_titleView];
+    
+    //tableview
+        //////////////////////////////////////
+    
+    if (isDateView) {
+        UIView *view=[[UIView alloc] initWithFrame:CGRectMake(0, 32, xWidth , self.bounds.size.height-32.0f)];
+        view.backgroundColor=[UIColor whiteColor];
+        [self addSubview:view];
+        
+        CGRect datePickerCR = CGRectMake(0, 32.0f, xWidth, self.bounds.size.height-32.0f);
+        _datePickerView=[[UIDatePicker alloc] initWithFrame:datePickerCR];
+        [_datePickerView addTarget:self action:@selector(dateAction:) forControlEvents:UIControlEventValueChanged];
+        //设置中文区域化
+        NSLocale *locale=[[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
+        _datePickerView.locale=locale;
+        //[_datePickerView selectRow:0 inComponent:0 animated:NO];
+        [_datePickerView setDatePickerMode:UIDatePickerModeDate];
+        [self addSubview:_datePickerView];
+        
+        //加一个按钮
+        CGRect frame1 =CGRectMake(self.bounds.size.width/2-30, self.bounds.size.height-40.0f, 60, 30.0f);
+
+        UIImage *buttonImageNomal=[UIImage imageNamed:@"changBlue.png"];
+        UIImage *stretchableButtonImageNomal=[buttonImageNomal stretchableImageWithLeftCapWidth:12 topCapHeight:1];
+
+        UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+        button1.frame = frame1;
+        [button1 setTitle:@"确定" forState: UIControlStateNormal];
+        button1.backgroundColor = [UIColor clearColor];
+        button1.tag = 2001;
+        [button1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+        [button1 addTarget:self action:@selector(buttonClicked1:) forControlEvents:UIControlEventTouchUpInside];
+        [button1 setBackgroundImage:stretchableButtonImageNomal forState:UIControlStateNormal];
+        [self  addSubview:button1];
+        
+     
+    }else
+    {
+        CGRect tableFrame = CGRectMake(0, 32.0f, xWidth, self.bounds.size.height-32.0f);
+        _listView = [[UITableView alloc] initWithFrame:tableFrame style:UITableViewStylePlain];
+        _listView.dataSource = self;
+        _listView.delegate = self;
+        [self addSubview:_listView];
+
+    }
+    
+    _overlayView = [[UIControl alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    _overlayView.backgroundColor = [UIColor colorWithRed:.16 green:.17 blue:.21 alpha:.5];
+    if (self.isCannotClickBackGround) {
+        [_overlayView addTarget:self
+                         action:@selector(dismiss)
+               forControlEvents:UIControlEventTouchUpInside];
+
+    }    
+    
+}
+
+-(void)setIsCannotClickBackGround:(BOOL)isCannotClickBackGround{
+    
+    if (isCannotClickBackGround) {
+        
+        [_overlayView addTarget:self
+                         action:@selector(dismiss)
+               forControlEvents:UIControlEventTouchUpInside];
+        
+    }
+    
+}
+
+#pragma mark -UIDatePicker
+//日期确定按钮
+BOOL isfirstOpen=YES;
+-(void)dateAction:(id)sender{
+    UIDatePicker *control=(UIDatePicker *)sender;
+    NSDate* date=control.date;
+    
+    NSDateFormatter * df2 = [[NSDateFormatter alloc] init];
+    
+    [df2 setDateFormat:@"yyyy-MM-dd"];
+    
+    NSString * str1 = [df2 stringFromDate:date];
+    popoverDateStr=str1;
+    [self.delegate setDateText:popoverDateStr];
+    isfirstOpen=NO;
+    DLog(@"date=%@",str1);
+}
+-(void)buttonClicked1:(id)sender{
+//    [self.delegate setDateText:popoverDateStr];
+    if (isfirstOpen) {
+        [self dateAction:nil];
+    }
+    if (self.dateBlock) {
+        self.dateBlock();
+    }
+    [self dismiss];
+}
+
+#pragma mark - UITableViewDataSource
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    if (self.datasource&&
+        [self.datasource respondsToSelector:@selector(numberOfSectionsInUIPopoverListView:)]) {
+        return [self.datasource numberOfSectionsInUIPopoverListView:self];
+    }
+    return 4;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    if(self.datasource &&
+       [self.datasource respondsToSelector:@selector(popoverListView:numberOfRowsInSection:)])
+    {
+        return [self.datasource popoverListView:self numberOfRowsInSection:section];
+    }
+    
+    return 0;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    if(self.datasource &&
+       [self.datasource respondsToSelector:@selector(popoverListView:cellForIndexPath:)])
+    {
+        return [self.datasource popoverListView:self cellForIndexPath:indexPath];
+    }
+    return nil;
+}
+-(NSString*)tableView:(UITableView*)tableView titleForHeaderInSection:(NSInteger)section
+{
+    //return [stories objectAtIndex:section];
+    if(self.datasource &&
+       [self.datasource respondsToSelector:@selector(popoverListView:titleForHeaderInSection:)])
+    {
+        return [self.datasource popoverListView:self titleForHeaderInSection:section];
+    }
+    return @"";
+}
+#pragma mark - UITableViewDelegate
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    if(self.delegate &&
+       [self.delegate respondsToSelector:@selector(popoverListView:heightForRowAtIndexPath:)])
+    {
+        return [self.delegate popoverListView:self heightForRowAtIndexPath:indexPath];
+    }
+    
+    return 0.0f;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    if(self.delegate &&
+       [self.delegate respondsToSelector:@selector(popoverListView:didSelectIndexPath:)])
+    {
+        [self.delegate popoverListView:self didSelectIndexPath:indexPath];
+    }
+    
+    [self dismiss];
+}
+
+#pragma mark --- 显示完整分割线
+-(void)viewDidLayoutSubviews {
+    
+    if ([_listView respondsToSelector:@selector(setSeparatorInset:)]) {
+        [_listView setSeparatorInset:UIEdgeInsetsZero];
+    }
+    if ([_listView respondsToSelector:@selector(setLayoutMargins:)])  {
+        [_listView setLayoutMargins:UIEdgeInsetsZero];
+    }
+}
+
+
+#pragma mark - animations
+
+- (void)fadeIn
+{
+    self.transform = CGAffineTransformMakeScale(1.3, 1.3);
+    self.alpha = 0;
+    [UIView animateWithDuration:.35 animations:^{
+        self.alpha = 1;
+        self.transform = CGAffineTransformMakeScale(1, 1);
+    }];
+    
+}
+- (void)fadeOut
+{
+    [UIView animateWithDuration:.35 animations:^{
+        self.transform = CGAffineTransformMakeScale(1.3, 1.3);
+        self.alpha = 0.0;
+    } completion:^(BOOL finished) {
+        if (finished) {
+            [self->_overlayView removeFromSuperview];
+            [self removeFromSuperview];
+        }
+    }];
+}
+
+- (void)setTitle:(NSString *)title
+{
+    _titleView.text = title;
+}
+
+- (void)show
+{
+    UIWindow *keywindow = [[UIApplication sharedApplication] keyWindow];
+    [keywindow addSubview:_overlayView];
+    [keywindow addSubview:self];
+    
+    self.center = CGPointMake(keywindow.bounds.size.width/2.0f,self.frame.origin.y+self.frame.size.height/2);
+                             // keywindow.bounds.size.height/2.0f);
+    [self fadeIn];
+}
+
+- (void)dismiss
+{
+    DLog(@"????????????????????-----@@@#");
+    [self fadeOut];
+    isfirstOpen=YES;
+    if (self.BackBlock) {
+        self.BackBlock();
+    }
+}
+
+#define mark - UITouch
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
+{
+    // tell the delegate the cancellation
+    if (self.delegate && [self.delegate respondsToSelector:@selector(popoverListViewCancel:)]) {
+        [self.delegate popoverListViewCancel:self];
+    }
+    DLog(@"Cancel!!!!!!!");
+    // dismiss self
+    [self dismiss];
+}
+
+
+@end

+ 208 - 192
UU_Ent/protos/account.proto

@@ -1,193 +1,209 @@
-syntax = "proto3";
-
-package uu.mobile;
-
-import "base.proto";
-
-option java_multiple_files = true;
-option java_package = "com.usoftchina.uu.mobile.grpc.api";
-
-// 账户服务
-service AccountService {
-    // 注册
-    rpc signup (AccountSignupRequest) returns (AccountSignupResponse) {};
-    // 登录
-    rpc signin (AccountSigninRequest) returns (AccountSigninResponse) {};
-    // 切换公司
-    rpc switchCompany (SwitchCompanyRequest) returns (SwitchCompanyResponse) {};
-    // 获取已登录账户信息
-    rpc getInfo (GetAccountInfoRequest) returns (GetAccountInfoResponse) {};
-    // 保存账户信息
-    rpc saveInfo (SaveAccountInfoRequest) returns (SaveAccountInfoResponse) {};
-    // 退出
-    rpc signout (AccountSignoutRequest) returns (AccountSignoutResponse) {};
-}
-
-// 身份令牌,超时需重新登录
-message AuthedToken {
-    // 令牌
-    string token = 1;
-    // 有效期/秒
-    int32 expire = 2;
-    // 产生时间
-    int64 timestamp = 3;
-}
-
-// 注册请求参数
-message AccountSignupRequest {
-    // 手机号
-    string mobile = 1;
-    // 密码
-    string password = 2;
-    // 真实姓名
-    string realname = 3;
-    // 邮箱
-    string email = 4;
-    // 性别
-    AccountInfo.Sex sex = 5;
-    // 头像
-    string avatarUrl = 6;
-}
-
-// 注册响应参数
-message AccountSignupResponse {
-    ResponseHeader responseHeader = 1;
-}
-
-// 登录请求参数
-message AccountSigninRequest {
-    // 手机号
-    string mobile = 1;
-    // 密码
-    string password = 2;
-    // 设备信息
-    DeviceInfo deviceInfo = 3;
-}
-
-// 登录响应参数
-message AccountSigninResponse {
-    ResponseHeader responseHeader = 1;
-    // 身份令牌
-    AuthedToken authedToken = 2;
-    // 账户信息
-    AccountInfo account = 3;
-    // 当前选择的公司(如果只有一个公司,会自动登录到该公司)
-    int64 activeCompanyId = 4;
-    // 账户已绑定公司
-    repeated Company company = 5;
-}
-
-// 切换公司请求参数
-message SwitchCompanyRequest {
-    // 公司ID
-    int64 companyId = 1;
-}
-
-// 切换公司响应参数
-message SwitchCompanyResponse {
-    ResponseHeader responseHeader = 1;
-    // 身份令牌
-    AuthedToken authedToken = 2;
-}
-
-// 获取账户信息请求参数
-message GetAccountInfoRequest {
-}
-
-// 获取账户信息响应参数
-message GetAccountInfoResponse {
-    ResponseHeader responseHeader = 1;
-    // 账户信息
-    AccountInfo account = 2;
-    // 当前选择的公司
-    int64 activeCompanyId = 3;
-    // 账户已绑定公司
-    repeated Company company = 4;
-}
-
-// 保存账户信息请求参数
-message SaveAccountInfoRequest {
-    // 真实姓名
-    string realname = 1;
-    // 头像
-    string avatarUrl = 2;
-    // 性别
-    AccountInfo.Sex sex = 3;
-}
-
-// 保存账户信息响应参数
-message SaveAccountInfoResponse {
-    ResponseHeader responseHeader = 1;
-}
-
-// 退出请求参数
-message AccountSignoutRequest {
-}
-
-// 退出响应参数
-message AccountSignoutResponse {
-    ResponseHeader responseHeader = 1;
-}
-
-// 密码找回相关
-service PasswordService {
-    // 手机验证码方式找回密码,发送手机验证码
-    rpc sendCheckCodeByMobile (SendCheckCodeByMobileRequest) returns (SendCheckCodeByMobileResponse) {};
-    // 手机验证码方式找回密码,校验验证码
-    rpc resetByCheckCode (ResetByCheckCodeRequest) returns (ResetByCheckCodeResponse) {};
-    // 邮箱链接方式找回密码,按手机号获取邮箱号
-    rpc getEmailByMobile (GetEmailByMobileRequest) returns (GetEmailByMobileResponse) {};
-    // 发送带验证链接的邮件
-    rpc sendCheckEmail (SendCheckEmailRequest) returns (SendCheckEmailResponse) {};
-}
-
-// 手机验证码方式找回密码,发送手机验证码请求参数
-message SendCheckCodeByMobileRequest {
-    string mobile = 1;
-}
-
-// 手机验证码方式找回密码,发送手机验证码响应参数
-message SendCheckCodeByMobileResponse {
-    ResponseHeader responseHeader = 1;
-    // 本次验证标志
-    string token = 2;
-}
-
-// 手机验证码方式找回密码,重置密码请求参数
-message ResetByCheckCodeRequest {
-    string mobile = 1;
-    // SendCheckCodeByMobileResponse返回的token标志
-    string token = 2;
-    // 验证码
-    string code = 3;
-    // 新的密码
-    string password = 4;
-}
-
-// 手机验证码方式找回密码,重置密码响应参数
-message ResetByCheckCodeResponse {
-    ResponseHeader responseHeader = 1;
-}
-
-// 邮箱链接方式找回密码,按手机号获取邮箱号请求参数
-message GetEmailByMobileRequest {
-    string mobile = 1;
-}
-
-// 邮箱链接方式找回密码,按手机号获取邮箱号响应参数
-message GetEmailByMobileResponse {
-    ResponseHeader responseHeader = 1;
-    // 本次验证标志
-    string token = 2;
-    string email = 3;
-}
-
-// 发送带验证链接的邮件请求参数
-message SendCheckEmailRequest {
-    string token = 1;
-}
-
-// 发送带验证链接的邮件响应参数
-message SendCheckEmailResponse {
-    ResponseHeader responseHeader = 1;
+syntax = "proto3";
+
+package uu.mobile;
+
+import "base.proto";
+
+option java_multiple_files = true;
+option java_package = "com.usoftchina.uu.mobile.grpc.api";
+
+// 账户服务
+service AccountService {
+    // 注册
+    rpc signup (AccountSignupRequest) returns (AccountSignupResponse) {};
+    // 登录
+    rpc signin (AccountSigninRequest) returns (AccountSigninResponse) {};
+    // 切换公司
+    rpc switchCompany (SwitchCompanyRequest) returns (SwitchCompanyResponse) {};
+    // 获取已登录账户信息
+    rpc getInfo (GetAccountInfoRequest) returns (GetAccountInfoResponse) {};
+    // 保存账户信息
+    rpc saveInfo (SaveAccountInfoRequest) returns (SaveAccountInfoResponse) {};
+    // 退出
+    rpc signout (AccountSignoutRequest) returns (AccountSignoutResponse) {};
+}
+
+// 身份令牌,超时需重新登录
+message AuthedToken {
+    // 令牌
+    string token = 1;
+    // 有效期/秒
+    int32 expire = 2;
+    // 产生时间
+    int64 timestamp = 3;
+}
+
+// 注册请求参数
+message AccountSignupRequest {
+    // 手机号
+    string mobile = 1;
+    // 密码
+    string password = 2;
+    // 真实姓名
+    string realname = 3;
+    // 邮箱
+    string email = 4;
+    // 性别
+    AccountInfo.Sex sex = 5;
+    // 头像
+    string avatarUrl = 6;
+}
+
+// 注册响应参数
+message AccountSignupResponse {
+    ResponseHeader responseHeader = 1;
+}
+
+// 登录请求参数
+message AccountSigninRequest {
+    // 手机号
+    string mobile = 1;
+    // 密码
+    string password = 2;
+    // 设备信息
+    DeviceInfo deviceInfo = 3;
+}
+
+// 登录响应参数
+message AccountSigninResponse {
+    ResponseHeader responseHeader = 1;
+    // 身份令牌
+    AuthedToken authedToken = 2;
+    // 账户信息
+    AccountInfo account = 3;
+    // 当前选择的公司(如果只有一个公司,会自动登录到该公司)
+    int64 activeCompanyId = 4;
+    // 账户已绑定公司
+    repeated Company company = 5;
+    // 消息中心配置,activeCompanyId != null时返回
+    repeated MessageConfig messageConfig = 6;
+    // 未读消息统计,activeCompanyId != null时返回
+    repeated UnreadMessageCount unreadMessageCount = 7;
+    // 应用中心配置,activeCompanyId != null时返回
+    repeated AppGroupConfig appGroupConfig = 8;
+    // 我的主页配置,activeCompanyId != null时返回
+    repeated HomeConfig homeConfig = 9;
+}
+
+// 切换公司请求参数
+message SwitchCompanyRequest {
+    // 公司ID,null == companyId 表示切换到个人身份
+    int64 companyId = 1;
+}
+
+// 切换公司响应参数
+message SwitchCompanyResponse {
+    ResponseHeader responseHeader = 1;
+    // 新的身份令牌
+    AuthedToken authedToken = 2;
+    // 新的消息中心配置
+    repeated MessageConfig messageConfig = 3;
+    // 新的未读消息统计
+    repeated UnreadMessageCount unreadMessageCount = 4;
+    // 新的应用中心配置
+    repeated AppGroupConfig appGroupConfig = 5;
+    // 新的我的主页配置
+    repeated HomeConfig homeConfig = 6;
+}
+
+// 获取账户信息请求参数
+message GetAccountInfoRequest {
+}
+
+// 获取账户信息响应参数
+message GetAccountInfoResponse {
+    ResponseHeader responseHeader = 1;
+    // 账户信息
+    AccountInfo account = 2;
+    // 当前选择的公司
+    int64 activeCompanyId = 3;
+    // 账户已绑定公司
+    repeated Company company = 4;
+}
+
+// 保存账户信息请求参数
+message SaveAccountInfoRequest {
+    // 真实姓名
+    string realname = 1;
+    // 头像
+    string avatarUrl = 2;
+    // 性别
+    AccountInfo.Sex sex = 3;
+}
+
+// 保存账户信息响应参数
+message SaveAccountInfoResponse {
+    ResponseHeader responseHeader = 1;
+}
+
+// 退出请求参数
+message AccountSignoutRequest {
+}
+
+// 退出响应参数
+message AccountSignoutResponse {
+    ResponseHeader responseHeader = 1;
+}
+
+// 密码找回相关
+service PasswordService {
+    // 手机验证码方式找回密码,发送手机验证码
+    rpc sendCheckCodeByMobile (SendCheckCodeByMobileRequest) returns (SendCheckCodeByMobileResponse) {};
+    // 手机验证码方式找回密码,校验验证码
+    rpc resetByCheckCode (ResetByCheckCodeRequest) returns (ResetByCheckCodeResponse) {};
+    // 邮箱链接方式找回密码,按手机号获取邮箱号
+    rpc getEmailByMobile (GetEmailByMobileRequest) returns (GetEmailByMobileResponse) {};
+    // 发送带验证链接的邮件
+    rpc sendCheckEmail (SendCheckEmailRequest) returns (SendCheckEmailResponse) {};
+}
+
+// 手机验证码方式找回密码,发送手机验证码请求参数
+message SendCheckCodeByMobileRequest {
+    string mobile = 1;
+}
+
+// 手机验证码方式找回密码,发送手机验证码响应参数
+message SendCheckCodeByMobileResponse {
+    ResponseHeader responseHeader = 1;
+    // 本次验证标志
+    string token = 2;
+}
+
+// 手机验证码方式找回密码,重置密码请求参数
+message ResetByCheckCodeRequest {
+    string mobile = 1;
+    // SendCheckCodeByMobileResponse返回的token标志
+    string token = 2;
+    // 验证码
+    string code = 3;
+    // 新的密码
+    string password = 4;
+}
+
+// 手机验证码方式找回密码,重置密码响应参数
+message ResetByCheckCodeResponse {
+    ResponseHeader responseHeader = 1;
+}
+
+// 邮箱链接方式找回密码,按手机号获取邮箱号请求参数
+message GetEmailByMobileRequest {
+    string mobile = 1;
+}
+
+// 邮箱链接方式找回密码,按手机号获取邮箱号响应参数
+message GetEmailByMobileResponse {
+    ResponseHeader responseHeader = 1;
+    // 本次验证标志
+    string token = 2;
+    string email = 3;
+}
+
+// 发送带验证链接的邮件请求参数
+message SendCheckEmailRequest {
+    string token = 1;
+}
+
+// 发送带验证链接的邮件响应参数
+message SendCheckEmailResponse {
+    ResponseHeader responseHeader = 1;
 }

+ 23 - 23
UU_Ent/protos/app.proto

@@ -1,24 +1,24 @@
-syntax = "proto3";
-
-package uu.mobile;
-
-import "base.proto";
-
-option java_multiple_files = true;
-option java_package = "com.usoftchina.uu.mobile.grpc.api";
-
-// 应用中心
-service AppService {
-    // 获取应用配置
-    rpc getConfig (GetAppConfigRequest) returns (GetAppConfigResponse) {};
-}
-
-// 获取应用配置请求参数
-message GetAppConfigRequest {
-}
-
-// 获取应用配置响应参数
-message GetAppConfigResponse {
-    ResponseHeader responseHeader = 1;
-    repeated AppGroupConfig config = 2;
+syntax = "proto3";
+
+package uu.mobile;
+
+import "base.proto";
+
+option java_multiple_files = true;
+option java_package = "com.usoftchina.uu.mobile.grpc.api";
+
+// 应用中心
+service AppService {
+    // 获取应用配置
+    rpc getConfig (GetAppConfigRequest) returns (GetAppConfigResponse) {};
+}
+
+// 获取应用配置请求参数
+message GetAppConfigRequest {
+}
+
+// 获取应用配置响应参数
+message GetAppConfigResponse {
+    ResponseHeader responseHeader = 1;
+    repeated AppGroupConfig config = 2;
 }

+ 171 - 169
UU_Ent/protos/base.proto

@@ -1,170 +1,172 @@
-syntax = "proto3";
-
-package uu.mobile;
-
-option java_multiple_files = true;
-option java_package = "com.usoftchina.uu.mobile.grpc.api";
-
-// 响应头
-message ResponseHeader {
-    // 是否成功
-    bool success = 1;
-    // 错误码
-    int32 code = 2;
-    // 错误信息
-    string message = 3;
-}
-
-// 分页信息
-message Paging {
-    // 总页数
-    int32 totalPage = 1;
-    // 总条数
-    int32 totalCount = 2;
-    // 每页条数
-    int32 pageSize = 3;
-    // 当前页
-    int32 pageNumber = 4;
-}
-
-// 账户
-message AccountInfo {
-    int64 id = 1;
-    // 真实姓名(考虑是企业应用,非社交类型,不需要昵称)
-    string realname = 2;
-    // 手机号
-    string mobile = 3;
-    // 邮箱
-    string email = 4;
-    // 头像
-    string avatarUrl = 5;
-    Sex sex = 6;
-    // 性别
-    enum Sex {
-        // 女
-        FEMALE = 0;
-        // 男
-        MALE = 1;
-    }
-}
-
-// 公司
-message Company {
-    int64 id = 1;
-    // 名称
-    string name = 2;
-}
-
-// 视图类型
-enum ViewType {
-    // 原生
-    WIDGET = 0;
-    // 网页
-    WEB = 1;
-}
-
-// 消息配置
-message MessageConfig {
-    // 唯一编码,例如 uas.todo
-    string code = 1;
-    // 消息名,例如 待办事项
-    string name = 2;
-    // 图标
-    string icon = 3;
-    // 打开视图类型
-    ViewType viewType = 4;
-    // Android
-    string androidWidget = 5;
-    // IOS
-    string iosWidget = 6;
-    // 网页
-    string webUrl = 7;
-}
-
-// 未读消息统计
-message UnreadMessageCount {
-    // 消息编码
-    string code = 1;
-    // 消息数
-    int32 count = 2;
-}
-
-// 消息
-message MessageInfo {
-    // ID
-    int64 id = 1;
-    // 消息内容
-    string body = 2;
-    // 状态
-    Status status = 3;
-    enum Status {
-        // 未读
-        UNREAD = 0;
-        // 已读
-        READ = 1;
-    }
-}
-
-// 应用组配置
-message AppGroupConfig {
-    string name = 1;
-    repeated AppConfig appConfig = 2;
-}
-
-// 应用配置
-message AppConfig {
-    int32 id = 1;
-    // 应用名
-    string name = 2;
-    // 图标
-    string icon = 3;
-    // 打开视图类型
-    ViewType viewType = 4;
-    // Android
-    string androidWidget = 5;
-    // IOS
-    string iosWidget = 6;
-    // 网页
-    string webUrl = 7;
-}
-
-// 我的主页配置
-message HomeConfig {
-    int32 id = 1;
-    // 显示名
-    string name = 2;
-    // 图标
-    string icon = 3;
-    // 显示/打开视图类型
-    ViewType viewType = 4;
-    // 显示/打开Android控件
-    string androidWidget = 5;
-    // 显示/打开IOS控件
-    string iosWidget = 6;
-    // 打开网页
-    string webUrl = 7;
-}
-
-// 设备信息
-message DeviceInfo {
-    // 客户端发行版本,例如1.0.0
-    string version = 1;
-    // 设备型号
-    string model = 2;
-    // 系统
-    OS os = 3;
-    enum OS {
-        ANDROID = 0;
-        IOS = 1;
-    }
-    // 系统版本,例如7.1
-    string osVersion = 4;
-    // 经度
-    double longitude = 5;
-    // 纬度
-    double latitude = 6;
-    // 位置
-    string location = 7;
-    // 语言
-    string lang = 8;
+syntax = "proto3";
+
+package uu.mobile;
+
+option java_multiple_files = true;
+option java_package = "com.usoftchina.uu.mobile.grpc.api";
+
+// 响应头
+message ResponseHeader {
+    // 是否成功
+    bool success = 1;
+    // 错误码
+    int32 code = 2;
+    // 错误信息
+    string message = 3;
+}
+
+// 分页信息
+message Paging {
+    // 总页数
+    int32 totalPage = 1;
+    // 总条数
+    int64 totalCount = 2;
+    // 每页条数
+    int32 pageSize = 3;
+    // 当前页
+    int32 pageNumber = 4;
+}
+
+// 账户
+message AccountInfo {
+    int64 id = 1;
+    // 真实姓名(考虑是企业应用,非社交类型,不需要昵称)
+    string realname = 2;
+    // 手机号
+    string mobile = 3;
+    // 邮箱
+    string email = 4;
+    // 头像
+    string avatarUrl = 5;
+    Sex sex = 6;
+    // 性别
+    enum Sex {
+        // 女
+        FEMALE = 0;
+        // 男
+        MALE = 1;
+    }
+}
+
+// 公司
+message Company {
+    int64 id = 1;
+    // 名称
+    string name = 2;
+}
+
+// 视图类型
+enum ViewType {
+    // 原生
+    WIDGET = 0;
+    // 网页
+    WEB = 1;
+}
+
+// 消息配置
+message MessageConfig {
+    // 唯一编码,例如 uas.todo
+    string code = 1;
+    // 消息名,例如 待办事项
+    string name = 2;
+    // 图标
+    string icon = 3;
+    // 打开视图类型
+    ViewType viewType = 4;
+    // Android
+    string androidWidget = 5;
+    // IOS
+    string iosWidget = 6;
+    // 网页
+    string webUrl = 7;
+}
+
+// 未读消息统计
+message UnreadMessageCount {
+    // 消息编码
+    string code = 1;
+    // 消息数
+    int32 count = 2;
+}
+
+// 消息
+message MessageInfo {
+    // ID
+    int64 id = 1;
+    // 消息内容
+    string body = 2;
+    // 状态
+    Status status = 3;
+    enum Status {
+        // 未读
+        UNREAD = 0;
+        // 已读
+        READ = 1;
+    }
+}
+
+// 应用组配置
+message AppGroupConfig {
+    string name = 1;
+    repeated AppConfig appConfig = 2;
+}
+
+// 应用配置
+message AppConfig {
+    int32 id = 1;
+    // 应用名
+    string name = 2;
+    // 图标
+    string icon = 3;
+    // 打开视图类型
+    ViewType viewType = 4;
+    // Android
+    string androidWidget = 5;
+    // IOS
+    string iosWidget = 6;
+    // 网页
+    string webUrl = 7;
+}
+
+// 我的主页配置
+message HomeConfig {
+    int32 id = 1;
+    // 显示名
+    string name = 2;
+    // 图标
+    string icon = 3;
+    // 显示/打开视图类型
+    ViewType viewType = 4;
+    // 显示/打开Android控件
+    string androidWidget = 5;
+    // 显示/打开IOS控件
+    string iosWidget = 6;
+    // 打开网页
+    string webUrl = 7;
+}
+
+// 设备信息
+message DeviceInfo {
+    // 客户端发行版本,例如1.0.0
+    string version = 1;
+    // 设备型号
+    string model = 2;
+    // 系统
+    OS os = 3;
+    enum OS {
+        ANDROID = 0;
+        IOS = 1;
+    }
+    // 系统版本,例如7.1
+    string osVersion = 4;
+    // 经度
+    double longitude = 5;
+    // 纬度
+    double latitude = 6;
+    // 位置
+    string location = 7;
+    // 语言
+    string lang = 8;
+    // 消息通道
+    string channelId = 9;
 }

+ 23 - 23
UU_Ent/protos/home.proto

@@ -1,24 +1,24 @@
-syntax = "proto3";
-
-package uu.mobile;
-
-import "base.proto";
-
-option java_multiple_files = true;
-option java_package = "com.usoftchina.uu.mobile.grpc.api";
-
-// 我的主页
-service HomeService {
-    // 获取我的主页配置
-    rpc getConfig (GetHomeConfigRequest) returns (GetHomeConfigResponse);
-}
-
-// 获取我的主页配置请求参数
-message GetHomeConfigRequest {
-}
-
-// 获取我的主页配置响应参数
-message GetHomeConfigResponse {
-    ResponseHeader responseHeader = 1;
-    repeated HomeConfig config = 2;
+syntax = "proto3";
+
+package uu.mobile;
+
+import "base.proto";
+
+option java_multiple_files = true;
+option java_package = "com.usoftchina.uu.mobile.grpc.api";
+
+// 我的主页
+service HomeService {
+    // 获取我的主页配置
+    rpc getConfig (GetHomeConfigRequest) returns (GetHomeConfigResponse);
+}
+
+// 获取我的主页配置请求参数
+message GetHomeConfigRequest {
+}
+
+// 获取我的主页配置响应参数
+message GetHomeConfigResponse {
+    ResponseHeader responseHeader = 1;
+    repeated HomeConfig config = 2;
 }

+ 77 - 77
UU_Ent/protos/message.proto

@@ -1,78 +1,78 @@
-syntax = "proto3";
-
-package uu.mobile;
-
-import "base.proto";
-
-option java_multiple_files = true;
-option java_package = "com.usoftchina.uu.mobile.grpc.api";
-
-// 消息服务
-service MessageService {
-    // 获取消息配置
-    rpc getConfig (GetMessageConfigRequest) returns (GetMessageConfigResponse) {};
-    // 未读消息统计
-    rpc getUnreadCount (GetUnreadMessageCountRequest) returns (GetUnreadMessageCountResponse) {};
-    // 获取消息
-    rpc getMessages (GetMessagesRequest) returns (GetMessagesResponse) {};
-    // 设置为已读
-    rpc setRead (SetMessageReadRequest) returns (SetMessageReadResponse) {};
-}
-
-// 获取消息配置请求参数
-message GetMessageConfigRequest {
-}
-
-// 获取消息配置响应参数
-message GetMessageConfigResponse {
-    ResponseHeader responseHeader = 1;
-    repeated MessageConfig config = 2;
-}
-
-// 未读消息统计请求参数
-message GetUnreadMessageCountRequest {
-}
-
-// 未读消息统计响应参数
-message GetUnreadMessageCountResponse {
-    ResponseHeader responseHeader = 1;
-    repeated UnreadMessageCount unread = 2;
-}
-
-// 获取消息请求参数
-message GetMessagesRequest {
-    // 每页条数
-    int32 pageSize = 1;
-    // 当前页
-    int32 pageNumber = 2;
-    // 消息编码
-    string code = 3;
-    // 消息状态
-    Status status = 4;
-
-    enum Status {
-        // 未读
-        UNREAD = 0;
-        // 已读
-        READ = 1;
-        // 全部
-        ALL = 2;
-    }
-}
-
-// 获取消息响应参数
-message GetMessagesResponse {
-    ResponseHeader responseHeader = 1;
-    Paging paging = 2;
-    repeated MessageInfo message = 3;
-}
-
-// 设置消息已读请求参数
-message SetMessageReadRequest {
-    int64 messageId = 1;
-}
-
-// 设置消息已读响应参数
-message SetMessageReadResponse {
-    ResponseHeader responseHeader = 1;
+syntax = "proto3";
+
+package uu.mobile;
+
+import "base.proto";
+
+option java_multiple_files = true;
+option java_package = "com.usoftchina.uu.mobile.grpc.api";
+
+// 消息服务
+service MessageService {
+    // 获取消息配置
+    rpc getConfig (GetMessageConfigRequest) returns (GetMessageConfigResponse) {};
+    // 未读消息统计
+    rpc getUnreadCount (GetUnreadMessageCountRequest) returns (GetUnreadMessageCountResponse) {};
+    // 获取消息
+    rpc getMessages (GetMessagesRequest) returns (GetMessagesResponse) {};
+    // 设置为已读
+    rpc setRead (SetMessageReadRequest) returns (SetMessageReadResponse) {};
+}
+
+// 获取消息配置请求参数
+message GetMessageConfigRequest {
+}
+
+// 获取消息配置响应参数
+message GetMessageConfigResponse {
+    ResponseHeader responseHeader = 1;
+    repeated MessageConfig config = 2;
+}
+
+// 未读消息统计请求参数
+message GetUnreadMessageCountRequest {
+}
+
+// 未读消息统计响应参数
+message GetUnreadMessageCountResponse {
+    ResponseHeader responseHeader = 1;
+    repeated UnreadMessageCount unread = 2;
+}
+
+// 获取消息请求参数
+message GetMessagesRequest {
+    // 每页条数
+    int32 pageSize = 1;
+    // 当前页
+    int32 pageNumber = 2;
+    // 消息编码
+    string code = 3;
+    // 消息状态
+    Status status = 4;
+
+    enum Status {
+        // 未读
+        UNREAD = 0;
+        // 已读
+        READ = 1;
+        // 全部
+        ALL = 2;
+    }
+}
+
+// 获取消息响应参数
+message GetMessagesResponse {
+    ResponseHeader responseHeader = 1;
+    Paging paging = 2;
+    repeated MessageInfo message = 3;
+}
+
+// 设置消息已读请求参数
+message SetMessageReadRequest {
+    int64 messageId = 1;
+}
+
+// 设置消息已读响应参数
+message SetMessageReadResponse {
+    ResponseHeader responseHeader = 1;
 }