dingxin пре 6 година
родитељ
комит
9ff931fc55
88 измењених фајлова са 6430 додато и 1659 уклоњено
  1. 0
    20
      CODE/smart-community/app-api/src/main/java/com/community/huiju/Test.java
  2. 6
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BillController.java
  4. 53
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/ImageController.java
  5. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java
  6. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  7. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  8. 8
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  9. 4
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  10. 5
    0
      CODE/smart-community/community-common/pom.xml
  11. 10
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  12. 7
    2
      CODE/smart-community/community-common/src/main/java/com/community/commom/session/UserElement.java
  13. 60
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/utils/OssUtil.java
  14. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class
  15. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/session/UserElement.class
  16. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/OssUtil.class
  17. 43
    0
      CODE/smart-community/operate-api/pom.xml
  18. 2
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/OperateApplication.java
  19. 2
    2
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/Swagger2.java
  20. 15
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/ICode.java
  21. 48
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java
  22. 23
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java
  23. 11
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java
  24. 70
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java
  25. 92
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java
  26. 63
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CodeController.java
  27. 88
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CommunityController.java
  28. 0
    65
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/TestController.java
  29. 59
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/UserController.java
  30. 0
    11
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ScUserMapper.java
  31. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/SysDictionaryMapper.java
  32. 37
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java
  33. 25
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java
  34. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysMenuMapper.java
  35. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMapper.java
  36. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMenuMapper.java
  37. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysUserRoleMapper.java
  38. 22
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToUserMapper.java
  39. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TpUserCommunityMapper.java
  40. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TpUserMapper.java
  41. 58
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java
  42. 17
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/exception/WisdomException.java
  43. 0
    14
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/microController/MicroTestController.java
  44. 0
    37
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ScUser.java
  45. 53
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/SysDictionary.java
  46. 184
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToBanner.java
  47. 103
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToCommunities.java
  48. 83
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysMenu.java
  49. 85
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysRole.java
  50. 33
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysRoleMenu.java
  51. 33
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysUserRole.java
  52. 125
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToUser.java
  53. 135
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TpUser.java
  54. 33
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TpUserCommunity.java
  55. 38
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/CommunityServiceI.java
  56. 48
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java
  57. 19
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToUserService.java
  58. 0
    9
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/ScUserServiceI.java
  59. 96
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java
  60. 0
    25
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ScUserServiceImpl.java
  61. 158
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java
  62. 55
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToUserServerImpl.java
  63. 55
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToBannerVO.java
  64. 52
    0
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToUserVO.java
  65. 13
    8
      CODE/smart-community/operate-api/src/main/resources/application.yml
  66. 1
    7
      CODE/smart-community/operate-api/src/main/resources/bootstrap.yml
  67. 0
    16
      CODE/smart-community/operate-api/src/main/resources/mapper/ScUserMapper.xml
  68. 93
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/SysDictionaryMapper.xml
  69. 280
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml
  70. 165
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToCommunitiesMapper.xml
  71. 128
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToSysMenuMapper.xml
  72. 128
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMapper.xml
  73. 71
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMenuMapper.xml
  74. 71
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToSysUserRoleMapper.xml
  75. 184
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/ToUserMapper.xml
  76. 71
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/TpUserCommunityMapper.xml
  77. 188
    0
      CODE/smart-community/operate-api/src/main/resources/mapper/TpUserMapper.xml
  78. 0
    33
      CODE/smart-community/zuul/src/main/java/com/community/huiju/config/entity/UserElement.java
  79. 1
    1
      CODE/smart-community/zuul/src/main/java/com/community/huiju/constant/Status.java
  80. 4
    2
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java
  81. 0
    30
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateManager.java
  82. 8
    12
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java
  83. 4
    1
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java
  84. 2
    14
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/WisdomSecurityConfig.java
  85. 0
    88
      CODE/smart-community/zuul/src/main/java/com/community/huiju/security/dome/TokenAuthrentication.java
  86. 1334
    626
      文档/MYSQL/smartCommunity.pdb
  87. 1330
    622
      文档/MYSQL/smartCommunity.pdm
  88. BIN
      文档/需求/APP需求补充接口.xlsx

+ 0
- 20
CODE/smart-community/app-api/src/main/java/com/community/huiju/Test.java Прегледај датотеку

@@ -1,20 +0,0 @@
1
-package com.community.huiju;
2
-
3
-import com.community.commom.utils.DateUtils;
4
-
5
-import java.util.Date;
6
-
7
-/**
8
- * @author admin
9
- * @Title: Test
10
- * @Description: TODO
11
- * @date 2018/10/23
12
- */
13
-public class Test {
14
-    public static void main(String[] args) {
15
-       Date str1 = new Date(12L);
16
-       Date str2 = new Date(16L);
17
-
18
-        System.out.println(str1.compareTo(str2));
19
-    }
20
-}

+ 6
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BannerController.java Прегледај датотеку

@@ -1,5 +1,6 @@
1 1
 package com.community.huiju.controller;
2 2
 
3
+import com.aliyun.oss.OSSClient;
3 4
 import com.community.commom.mode.ResponseBean;
4 5
 import com.community.huiju.model.ToBanner;
5 6
 import com.community.huiju.service.BannerServiceI;
@@ -10,11 +11,11 @@ import io.swagger.annotations.ApiOperation;
10 11
 import org.springframework.beans.factory.annotation.Autowired;
11 12
 import org.springframework.cloud.context.config.annotation.RefreshScope;
12 13
 import org.springframework.util.CollectionUtils;
13
-import org.springframework.web.bind.annotation.PathVariable;
14
-import org.springframework.web.bind.annotation.RequestMapping;
15
-import org.springframework.web.bind.annotation.RequestMethod;
16
-import org.springframework.web.bind.annotation.RestController;
14
+import org.springframework.web.bind.annotation.*;
15
+import org.springframework.web.multipart.MultipartFile;
17 16
 
17
+import java.io.ByteArrayInputStream;
18
+import java.util.Date;
18 19
 import java.util.List;
19 20
 
20 21
 /**
@@ -50,4 +51,5 @@ public class BannerController {
50 51
         responseBean.addSuccess(toBannerList);
51 52
         return responseBean;
52 53
     }
54
+
53 55
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/BillController.java Прегледај датотеку

@@ -2,7 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.huiju.config.entity.UserElement;
5
+import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.service.BillServiceI;
7 7
 import io.swagger.annotations.Api;
8 8
 import io.swagger.annotations.ApiImplicitParam;

+ 53
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/ImageController.java Прегледај датотеку

@@ -0,0 +1,53 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.aliyun.oss.OSSClient;
4
+import io.swagger.annotations.Api;
5
+import io.swagger.annotations.ApiImplicitParam;
6
+import io.swagger.annotations.ApiImplicitParams;
7
+import io.swagger.annotations.ApiOperation;
8
+import org.springframework.cloud.context.config.annotation.RefreshScope;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RequestMethod;
11
+import org.springframework.web.bind.annotation.RequestParam;
12
+import org.springframework.web.bind.annotation.RestController;
13
+import org.springframework.web.multipart.MultipartFile;
14
+
15
+import java.io.ByteArrayInputStream;
16
+import java.util.Date;
17
+
18
+/**
19
+ * @author weichaochao
20
+ * @Title: ImageController
21
+ * @Description: 图片上传以及获取url
22
+ * @date 2018/10/31
23
+ */
24
+@RestController
25
+@RefreshScope
26
+@RequestMapping("/")
27
+@Api(value = "图片操作API", description = "图片操作API")
28
+public class ImageController {
29
+
30
+    private static String imgName = System.currentTimeMillis() + ".png";
31
+    private static String endpoint = "http://oss-cn-beijing.aliyuncs.com";
32
+    private static String accessKeyId = "LTAIkc75dpkJw8Lb";
33
+    private static String accessKeySecret = "v4bvXCaix6vSDTCFfwSAdqV53iFEQw";
34
+    private static String bucketName = "yc-smart-community";
35
+
36
+    @ApiOperation(value = "图片上传以及获取url", notes = "图片上传以及获取url")
37
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "form",dataType = "file",name = "uploadFile",value = "图片")})
38
+    @RequestMapping(value = "/getUrl", method = RequestMethod.POST)
39
+    public static String uploadImgAndGetUrl(@RequestParam("file") MultipartFile uploadFile) throws Exception {
40
+
41
+        // 创建OSSClient实例
42
+        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
43
+        // 上传
44
+        long time = System.currentTimeMillis();
45
+
46
+        ossClient.putObject(bucketName, imgName, new ByteArrayInputStream(uploadFile.getBytes()));
47
+        // 关闭client
48
+        ossClient.shutdown();
49
+        Date expiration = new Date(time + 3600 * 1000 * 24 * 365 * 10);
50
+        String url = ossClient.generatePresignedUrl(bucketName, imgName, expiration).toString();
51
+        return url;
52
+    }
53
+}

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/MessageController.java Прегледај датотеку

@@ -2,7 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.huiju.config.entity.UserElement;
5
+import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.model.ToCommunities;
7 7
 import com.community.huiju.model.TpMessage;
8 8
 import com.community.huiju.service.MessageServiceI;

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Прегледај датотеку

@@ -2,7 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.huiju.config.entity.UserElement;
5
+import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.model.TpActivity;
7 7
 import com.community.huiju.model.TpAnnouncement;
8 8
 import com.community.huiju.model.TpTicket;

+ 2
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Прегледај датотеку

@@ -2,7 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
-import com.community.huiju.config.entity.UserElement;
5
+import com.community.commom.session.UserElement;
6 6
 import com.community.huiju.model.TaUser;
7 7
 import com.community.huiju.model.TpTicket;
8 8
 import com.community.huiju.model.TpTransaction;
@@ -43,6 +43,7 @@ public class TicketController {
43 43
             @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少数据"),
44 44
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
45 45
     })
46
+    @Deprecated
46 47
     public ResponseBean getService(@PathVariable(value = "communityId") String communityId,
47 48
                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
48 49
                                    @RequestParam(value = "pageSize", defaultValue = "3") Integer pageSize,

+ 8
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Прегледај датотеку

@@ -3,8 +3,8 @@ package com.community.huiju.controller;
3 3
 import com.alibaba.fastjson.JSONObject;
4 4
 import com.community.commom.constant.Constant;
5 5
 import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
6 7
 import com.community.huiju.common.code.cache.AppkeyCache;
7
-import com.community.huiju.config.entity.UserElement;
8 8
 import com.community.huiju.model.TaUser;
9 9
 import com.community.huiju.model.TpTicket;
10 10
 import com.community.huiju.service.ITaUserService;
@@ -53,6 +53,7 @@ public class UserController {
53 53
         if (null != userVO) {
54 54
             UserElement userElement = new UserElement();
55 55
             BeanUtils.copyProperties(userVO,userElement);
56
+            userElement.setLoginType(Constant.APP_LOGIN_TYPE);
56 57
             session.setAttribute(Constant.APP_USER_SESSION,userElement);
57 58
             userVO.setToken(session.getId());
58 59
         }
@@ -75,6 +76,9 @@ public class UserController {
75 76
     }
76 77
 
77 78
     @ApiOperation(value = "查看房屋成员列表", notes = "查看房屋成员列表")
79
+    @ApiImplicitParams({
80
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
81
+    })
78 82
     @RequestMapping(value = "/roomUserList", method = RequestMethod.GET)
79 83
     public ResponseBean accessTicket(HttpSession session){
80 84
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
@@ -109,7 +113,7 @@ public class UserController {
109 113
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userId(租客或者家属) type(1启用 0停用)"),
110 114
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
111 115
     })
112
-    @RequestMapping(value = "/user/update/dependentsOrTenants",method = RequestMethod.PUT)
116
+    @RequestMapping(value = "/user/dependentsOrTenants",method = RequestMethod.PUT)
113 117
     public ResponseBean updateDependentsOrTenants(@RequestBody String parameter,
114 118
                                                 HttpSession session){
115 119
         ResponseBean response = new ResponseBean();
@@ -132,7 +136,7 @@ public class UserController {
132 136
                     "type(1家属 0租客)"),
133 137
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
134 138
     })
135
-    @RequestMapping(value = "/user/update/addTenantsOrDependents",method = RequestMethod.POST)
139
+    @RequestMapping(value = "/user/addTenantsOrDependents",method = RequestMethod.POST)
136 140
     public ResponseBean addTenantsOrDependents(@RequestBody String parameter,
137 141
                                                HttpSession session){
138 142
         ResponseBean response = new ResponseBean();
@@ -154,7 +158,7 @@ public class UserController {
154 158
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "headPortrait(用户头像)"),
155 159
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
156 160
     })
157
-    @RequestMapping(value = "/user/update/modifyUserHeadPortrait",method = RequestMethod.PUT)
161
+    @RequestMapping(value = "/user/modifyUserHeadPortrait",method = RequestMethod.PUT)
158 162
     public ResponseBean modifyUserHeadPortrait(@RequestBody String parameter,
159 163
                                                HttpSession session){
160 164
 

+ 4
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Прегледај датотеку

@@ -228,7 +228,7 @@ public class TaUserServiceImpl implements ITaUserService {
228 228
     @Override
229 229
     public ResponseBean startOrEndUsingUser(Integer currentUserId, Integer userId, Integer type) {
230 230
         ResponseBean response = null;
231
-        if ("1".equals(type)){
231
+        if (Constant.EFFECTIVE.equals(type)){
232 232
             response = startAndEnd(currentUserId,userId,true);
233 233
         } else {
234 234
             response = startAndEnd(currentUserId,userId,false);
@@ -319,7 +319,9 @@ public class TaUserServiceImpl implements ITaUserService {
319 319
         user.setVerifyStatus("1");
320 320
         user.setAcceptAgreementStatus("1");
321 321
         user.setRemark("这是业主添加的!");
322
-        user.setUserName(user.getLoginName());
322
+        if (StringUtils.isEmpty(userName)) {
323
+            user.setUserName(user.getLoginName());
324
+        }
323 325
         user.setBuildingOwnerInfoId(taUser.getBuildingOwnerInfoId());
324 326
         user.setCommunityId(taUser.getCommunityId());
325 327
 

+ 5
- 0
CODE/smart-community/community-common/pom.xml Прегледај датотеку

@@ -99,6 +99,11 @@
99 99
             <version>4.3.16.RELEASE</version>
100 100
             <scope>compile</scope>
101 101
         </dependency>
102
+        <dependency>
103
+            <groupId>com.aliyun.oss</groupId>
104
+            <artifactId>aliyun-sdk-oss</artifactId>
105
+            <version>2.8.3</version>
106
+        </dependency>
102 107
     </dependencies>
103 108
     <build>
104 109
         <plugins>

+ 10
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Прегледај датотеку

@@ -6,6 +6,9 @@ package com.community.commom.constant;
6 6
  */
7 7
 public class Constant {
8 8
 
9
+    /** 系统异常 500 **/
10
+    public static final String REQUEST_ERROR = "500";
11
+
9 12
     /** APP端session **/
10 13
     public static final String APP_USER_SESSION = "appUser";
11 14
 
@@ -74,4 +77,11 @@ public class Constant {
74 77
     
75 78
     /** 工单回复的发起人 **/
76 79
     public static final String TICKET_USER_TYPE = "1";
80
+
81
+    /** banner的类型 外链接 **/
82
+    public static final String BANNER_TYPE_LINK = "1";
83
+
84
+    /** banner的类型 文章 **/
85
+    public static final String BANNER_TYPE_ARTICLE = "2";
86
+
77 87
 }

CODE/smart-community/app-api/src/main/java/com/community/huiju/config/entity/UserElement.java → CODE/smart-community/community-common/src/main/java/com/community/commom/session/UserElement.java Прегледај датотеку

@@ -1,11 +1,10 @@
1
-package com.community.huiju.config.entity;
1
+package com.community.commom.session;
2 2
 
3 3
 import lombok.AllArgsConstructor;
4 4
 import lombok.Data;
5 5
 import lombok.NoArgsConstructor;
6 6
 
7 7
 import java.io.Serializable;
8
-import java.util.Date;
9 8
 
10 9
 /**
11 10
  * session 基础类
@@ -15,6 +14,9 @@ import java.util.Date;
15 14
 @NoArgsConstructor
16 15
 public class UserElement implements Serializable {
17 16
 
17
+
18
+
19
+
18 20
     /** 用户唯一标识符 **/
19 21
     private Integer id;
20 22
 
@@ -30,5 +32,8 @@ public class UserElement implements Serializable {
30 32
     /** 用户状态 **/
31 33
     private String status;
32 34
 
35
+    /** 登陆类型 **/
36
+    private String loginType;
37
+
33 38
 
34 39
 }

+ 60
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/utils/OssUtil.java Прегледај датотеку

@@ -0,0 +1,60 @@
1
+package com.community.commom.utils;
2
+
3
+import com.aliyun.oss.HttpMethod;
4
+import com.aliyun.oss.OSSClient;
5
+import com.aliyun.oss.model.GeneratePresignedUrlRequest;
6
+import org.springframework.web.multipart.MultipartFile;
7
+
8
+import java.io.ByteArrayInputStream;
9
+import java.net.URL;
10
+import java.util.Date;
11
+
12
+/**
13
+ * @author weichaochao
14
+ * @Title: OssUtil
15
+ * @Description: 图片上传到OSS
16
+ * @date 2018/10/31
17
+ */
18
+public class OssUtil {
19
+    public static void main(String[] args) {
20
+        // Endpoint以杭州为例,其它Region请按实际情况填写。
21
+        String endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
22
+// 阿里云主账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM账号进行API访问或日常运维,请登录 https://ram.console.aliyun.com 创建RAM账号。
23
+        String accessKeyId = "LTAIiG6xeHbVzTXC";
24
+        String accessKeySecret = "YUci8oBtm5WzobH6SP2eyZUbjCBKBo";
25
+        String bucketName = "faceidentity";
26
+// 创建OSSClient实例。
27
+        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
28
+// 设置图片处理样式。
29
+        String style = "image/resize,m_fixed,w_100,h_100/rotate,90";
30
+// 指定过期时间为10分钟。
31
+        Date expiration = new Date(System.currentTimeMillis() + 1000 * 60 * 10 );
32
+        GeneratePresignedUrlRequest req = new GeneratePresignedUrlRequest(bucketName, "1.png", HttpMethod.GET);
33
+        req.setExpiration(expiration);
34
+        req.setProcess(style);
35
+        URL signedUrl = ossClient.generatePresignedUrl(req);
36
+        System.out.println("url:" + signedUrl);
37
+// 关闭OSSClient。
38
+        ossClient.shutdown();
39
+    }
40
+
41
+
42
+    public static String picOSS(MultipartFile uploadFile) throws Exception {
43
+        String endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
44
+        // 云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用RAM子账号进行API访问或日常运维,请登录
45
+        // https://ram.console.aliyun.com 创建
46
+        String accessKeyId = "LTAIiG6xeHbVzTXC";
47
+        String accessKeySecret = "YUci8oBtm5WzobH6SP2eyZUbjCBKBo";
48
+        // 创建OSSClient实例
49
+        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
50
+        // 上传
51
+        long time = System.currentTimeMillis();
52
+
53
+        ossClient.putObject("bucketName", "filename", new ByteArrayInputStream(uploadFile.getBytes()));
54
+        // 关闭client
55
+        ossClient.shutdown();
56
+        Date expiration = new Date(time + 3600 * 1000 * 24 * 365 * 10);
57
+        String url = ossClient.generatePresignedUrl("bucketName", "filename", expiration).toString();
58
+        return url;
59
+    }
60
+}

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/constant/Constant.class Прегледај датотеку


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/session/UserElement.class Прегледај датотеку


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/OssUtil.class Прегледај датотеку


+ 43
- 0
CODE/smart-community/operate-api/pom.xml Прегледај датотеку

@@ -70,6 +70,11 @@
70 70
 			<version>1.3.2</version>
71 71
 		</dependency>
72 72
 
73
+		<dependency>
74
+			<groupId>com.github.pagehelper</groupId>
75
+			<artifactId>pagehelper-spring-boot-starter</artifactId>
76
+			<version>1.2.3</version>
77
+		</dependency>
73 78
 
74 79
 		<dependency>
75 80
 			<groupId>mysql</groupId>
@@ -99,6 +104,44 @@
99 104
 			<artifactId>spring-boot-starter-test</artifactId>
100 105
 			<scope>test</scope>
101 106
 		</dependency>
107
+
108
+
109
+		<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
110
+		<dependency>
111
+			<groupId>org.projectlombok</groupId>
112
+			<artifactId>lombok</artifactId>
113
+			<version>1.18.2</version>
114
+			<scope>provided</scope>
115
+		</dependency>
116
+
117
+		<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
118
+		<dependency>
119
+			<groupId>com.google.guava</groupId>
120
+			<artifactId>guava</artifactId>
121
+			<version>26.0-jre</version>
122
+		</dependency>
123
+
124
+		<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
125
+		<dependency>
126
+			<groupId>org.apache.commons</groupId>
127
+			<artifactId>commons-lang3</artifactId>
128
+			<version>3.8.1</version>
129
+		</dependency>
130
+
131
+		<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
132
+		<dependency>
133
+			<groupId>commons-lang</groupId>
134
+			<artifactId>commons-lang</artifactId>
135
+			<version>2.6</version>
136
+		</dependency>
137
+
138
+		<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp -->
139
+		<dependency>
140
+			<groupId>com.squareup.okhttp3</groupId>
141
+			<artifactId>okhttp</artifactId>
142
+			<version>3.11.0</version>
143
+		</dependency>
144
+
102 145
 	</dependencies>
103 146
 
104 147
 	<dependencyManagement>

+ 2
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/OperateApplication.java Прегледај датотеку

@@ -4,10 +4,12 @@ import org.springframework.boot.SpringApplication;
4 4
 import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
6 6
 import org.springframework.cloud.openfeign.EnableFeignClients;
7
+import org.springframework.transaction.annotation.EnableTransactionManagement;
7 8
 
8 9
 @SpringBootApplication
9 10
 @EnableDiscoveryClient
10 11
 @EnableFeignClients
12
+@EnableTransactionManagement
11 13
 public class OperateApplication {
12 14
 
13 15
 	public static void main(String[] args) {

+ 2
- 2
CODE/smart-community/operate-api/src/main/java/com/community/huiju/Swagger2.java Прегледај датотеку

@@ -21,14 +21,14 @@ public class Swagger2 {
21 21
     @Bean
22 22
     public Docket docket(){
23 23
         return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
24
-                .apis(RequestHandlerSelectors.basePackage("com.example.huiju.controller"))
24
+                .apis(RequestHandlerSelectors.basePackage("com.community.huiju.controller"))
25 25
                 .paths(PathSelectors.any()).build();
26 26
     }
27 27
     //构建api文档的详细信息函数
28 28
     private ApiInfo apiInfo(){
29 29
         return new ApiInfoBuilder()
30 30
                 //页面标题
31
-                .title("eureka-client1 的 RESTful API")
31
+                .title("运营端 的 RESTful API")
32 32
                 //创建人
33 33
                 .contact(new Contact("fuxingfan","","fuxingfan@dingtalk.com"))
34 34
                 //版本号

+ 15
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/ICode.java Прегледај датотеку

@@ -0,0 +1,15 @@
1
+package com.community.huiju.common.code;
2
+
3
+
4
+/**
5
+ * 验证码接口
6
+ * @author weiximei
7
+ */
8
+public interface ICode {
9
+
10
+    /**
11
+     * 验证码
12
+     */
13
+    boolean sendCode(String phone, String code);
14
+
15
+}

+ 48
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/cache/AppkeyCache.java Прегледај датотеку

@@ -0,0 +1,48 @@
1
+package com.community.huiju.common.code.cache;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.google.common.cache.CacheBuilder;
5
+import com.google.common.cache.CacheLoader;
6
+import com.google.common.cache.LoadingCache;
7
+import lombok.extern.slf4j.Slf4j;
8
+
9
+import java.util.concurrent.ExecutionException;
10
+import java.util.concurrent.TimeUnit;
11
+
12
+/**
13
+ * 缓存
14
+ * @author weiximei
15
+ */
16
+@Slf4j
17
+public class AppkeyCache {
18
+
19
+    // .refreshAfterWrite(3, TimeUnit.HOURS)// 给定时间内没有被读/写访问,则回收。
20
+    static LoadingCache<String, Object> cache = CacheBuilder.newBuilder()
21
+            .expireAfterAccess(Constant.CACHE_EXPIRE, TimeUnit.HOURS)// 缓存过期时间和redis缓存时长一样
22
+            .maximumSize(Constant.CACHE_SIZE).// 设置缓存个数
23
+            build(new CacheLoader<String, Object>() {
24
+            @Override
25
+            /** 当本地缓存命没有中时,调用load方法获取结果并将结果缓存 **/
26
+            public String load(String appKey) throws Exception {
27
+                return null;
28
+            }
29
+
30
+    });
31
+
32
+    public static Object getCache(String appKey) {
33
+        Object value = null;
34
+        try {
35
+            value = cache.get(appKey);
36
+        } catch (ExecutionException e) {
37
+            e.printStackTrace();
38
+        }
39
+        return value;
40
+    }
41
+
42
+    public static void setCache(String appKey,Object appValue){
43
+        log.info("缓存的key-value: {}-{}", appKey,appValue);
44
+        cache.put(appKey,appValue);
45
+    }
46
+
47
+
48
+}

+ 23
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/entity/CodeEntity.java Прегледај датотеку

@@ -0,0 +1,23 @@
1
+package com.community.huiju.common.code.entity;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+@Data
8
+@AllArgsConstructor
9
+@NoArgsConstructor
10
+public class CodeEntity {
11
+
12
+   private String code;
13
+
14
+   private String tel;
15
+
16
+    /**
17
+     * 参数 格式 String params = "["xxx"]"
18
+     */
19
+   private String params;
20
+
21
+
22
+
23
+}

+ 11
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/impl/ImgCodeImpl.java Прегледај датотеку

@@ -0,0 +1,11 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+/**
4
+ * 图片验证码
5
+ * @author weiximei
6
+ */
7
+public class ImgCodeImpl {
8
+
9
+
10
+
11
+}

+ 70
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/common/code/impl/PhoneCodeImpl.java Прегледај датотеку

@@ -0,0 +1,70 @@
1
+package com.community.huiju.common.code.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.huiju.common.code.ICode;
5
+import lombok.extern.slf4j.Slf4j;
6
+import okhttp3.*;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.stereotype.Service;
9
+import org.springframework.web.client.RestTemplate;
10
+
11
+import java.io.IOException;
12
+import java.util.concurrent.TimeUnit;
13
+
14
+/**
15
+ * 手机验证码
16
+ * @author weiximei
17
+ */
18
+@Service("phoneCodeImpl")
19
+@Slf4j
20
+public class PhoneCodeImpl implements ICode {
21
+
22
+    public static final MediaType JSON = MediaType.parse("application/json; charset=utf-8");
23
+
24
+
25
+    public OkHttpClient getClient() {
26
+        OkHttpClient client  = new OkHttpClient.Builder()
27
+                .connectTimeout(10, TimeUnit.SECONDS)
28
+                .writeTimeout(10,TimeUnit.SECONDS)
29
+                .readTimeout(20, TimeUnit.SECONDS)
30
+                .build();
31
+        return client;
32
+    }
33
+
34
+    @Override
35
+    public boolean sendCode(String phone, String code) {
36
+        boolean bool = false;
37
+
38
+        try {
39
+            String result = null;
40
+            OkHttpClient client = getClient();
41
+            RequestBody body = RequestBody.create(JSON, "{\"code\":\""+Constant.CODE+"\"," + "\"tel\":\""+phone+"\"," + "\"params\":[\""+code+"\"]}");
42
+            Request request = new Request.Builder()
43
+                    .url(Constant.REQUEST_URL)
44
+                    .post(body)
45
+                    .build();
46
+            Response response = client.newCall(request).execute();
47
+            if (response.isSuccessful()) {
48
+                result = response.body().string();
49
+            } else {
50
+                throw new IOException("Unexpected code " + response);
51
+            }
52
+
53
+
54
+
55
+            if ("发送成功".equals(result)) {
56
+                bool = true;
57
+                log.info("手机号 {} 验证码 {} 发送成功!",phone,code);
58
+            }else {
59
+                bool = false;
60
+                log.error("短信发送验证码失败!{}", result);
61
+            }
62
+        } catch (Exception e){
63
+            e.printStackTrace();
64
+            log.error("短信发送错误!",e);
65
+            bool = false;
66
+        }
67
+
68
+        return bool;
69
+    }
70
+}

+ 92
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/BannerController.java Прегледај датотеку

@@ -0,0 +1,92 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.constant.Constant;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.model.ToBanner;
8
+import com.community.huiju.service.IToBannerService;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.cloud.context.config.annotation.RefreshScope;
15
+import org.springframework.web.bind.annotation.*;
16
+
17
+import javax.servlet.http.HttpSession;
18
+import javax.validation.Valid;
19
+
20
+@RestController
21
+@RefreshScope
22
+@RequestMapping("/")
23
+@Api(value = "Banner 控制器")
24
+public class BannerController {
25
+
26
+    @Autowired
27
+    private IToBannerService iToBannerService;
28
+
29
+    @ApiOperation(value = "添加Banner",notes = "添加Banner")
30
+    @ApiImplicitParams({
31
+            @ApiImplicitParam(paramType = "body",dataType = "ToBanner",name = "banner",value = "bannerTitle(标题)," +
32
+                    "sort(权重),bannerCover(图片),bannerPosition(Banner位),communityId(小区)," +
33
+                    "effTime(生效时间),expTime(失效时间),bannerType(Banner类型),externalLink(Banner的URL)," +
34
+                    "bannerContent(Banner内容)"),
35
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
36
+    })
37
+    @RequestMapping(value = "/banner",method = RequestMethod.POST)
38
+    public ResponseBean addBanner(@RequestBody @Valid ToBanner banner,
39
+                                  HttpSession session){
40
+
41
+        UserElement userElement = (UserElement) session.getAttribute(Constant.WEB_USER_SESSION);
42
+        ResponseBean response = new ResponseBean();
43
+        response = iToBannerService.addBanner(banner,userElement.getId());
44
+        return response;
45
+    }
46
+
47
+    @ApiOperation(value = "修改Banner",notes = "修改Banner")
48
+    @ApiImplicitParams({
49
+            @ApiImplicitParam(paramType = "body",dataType = "ToBanner",name = "banner",value = "bannerTitle(标题)," +
50
+                    "sort(权重),bannerCover(图片),bannerPosition(Banner位),communityId(小区)," +
51
+                    "effTime(生效时间),expTime(失效时间),bannerType(Banner类型),externalLink(Banner的URL)," +
52
+                    "bannerContent(Banner内容)"),
53
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
54
+    })
55
+    @RequestMapping(value = "/banner",method = RequestMethod.PUT)
56
+    public ResponseBean updateBanner(@RequestBody @Valid ToBanner banner,
57
+                                  HttpSession session){
58
+
59
+        UserElement userElement = (UserElement) session.getAttribute(Constant.WEB_USER_SESSION);
60
+        ResponseBean response = new ResponseBean();
61
+        response = iToBannerService.modifyBanner(banner,userElement.getId());
62
+        return response;
63
+    }
64
+
65
+    @ApiOperation(value = "获取Banner详情",notes = "获取Banner详情")
66
+    @ApiImplicitParams({
67
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "bannerId",value = "bannerId(编号),")
68
+    })
69
+    @RequestMapping(value = "/banner",method = RequestMethod.GET)
70
+    public ResponseBean getByIdBanner(@RequestParam(value = "bannerId") Integer bannerId){
71
+
72
+        ResponseBean response = new ResponseBean();
73
+        response = iToBannerService.getById(bannerId);
74
+        return response;
75
+    }
76
+
77
+    @ApiOperation(value = "根据条件查询Banner",notes = "根据条件查询Banner")
78
+    @ApiImplicitParams({
79
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "bannerTitle(标题)," +
80
+                    ",bannerPosition(Banner位),bannerDescription(跳转概述)"),
81
+    })
82
+    @RequestMapping(value = "/banner/list",method = RequestMethod.GET)
83
+    public ResponseBean getBanner(@RequestBody String parameter){
84
+
85
+        ToBanner banner = JSONObject.parseObject(parameter,ToBanner.class);
86
+
87
+        ResponseBean response = new ResponseBean();
88
+        response = iToBannerService.getBanner(banner);
89
+        return response;
90
+    }
91
+
92
+}

+ 63
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CodeController.java Прегледај датотеку

@@ -0,0 +1,63 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.utils.AccountValidatorUtil;
5
+import com.community.huiju.common.code.ICode;
6
+import com.community.huiju.common.code.cache.AppkeyCache;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+import lombok.extern.slf4j.Slf4j;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.beans.factory.annotation.Qualifier;
14
+import org.springframework.cloud.context.config.annotation.RefreshScope;
15
+import org.springframework.web.bind.annotation.RequestMapping;
16
+import org.springframework.web.bind.annotation.RequestMethod;
17
+import org.springframework.web.bind.annotation.RequestParam;
18
+import org.springframework.web.bind.annotation.RestController;
19
+
20
+import javax.servlet.http.HttpSession;
21
+
22
+/**
23
+ * @author weiximei
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+@RefreshScope
28
+@Api(value = "获取验证码的API", description = "获取验证码的API")
29
+@Slf4j
30
+public class CodeController {
31
+
32
+    @Autowired
33
+    @Qualifier("phoneCodeImpl")
34
+    private ICode iCode;
35
+
36
+    @ApiOperation(value = "获取手机验证码", notes = "根据手机号发送验证码")
37
+    @ApiImplicitParams({@ApiImplicitParam(paramType = "query",dataType = "String",name = "phone",value = "手机号")})
38
+    @RequestMapping(value = "/code/sendCode",method = RequestMethod.POST)
39
+    public ResponseBean sendCode(@RequestParam String phone, HttpSession session) {
40
+        ResponseBean response = new ResponseBean();
41
+
42
+        log.info("{} 手机号校验结果: {}",phone, AccountValidatorUtil.isPhone(phone));
43
+        if (!AccountValidatorUtil.isPhone(phone)){
44
+            response.addError("请输入正取的手机号!");
45
+            return response;
46
+        }
47
+
48
+        int code = (int) ((Math.random()*9+1)*1000);
49
+        //boolean result = iCode.sendCode(phone,String.valueOf(code));
50
+        boolean result = true;
51
+        if (result) {
52
+            log.info("{} 验证码: {}",phone,code);
53
+            // 设置缓存
54
+            AppkeyCache.setCache(phone,String.valueOf(code));
55
+            //session.setAttribute(Constant.SESSION_PHONE_CODE,String.valueOf(code));
56
+            response.addSuccess("发送成功!"+code);
57
+        } else {
58
+            response.addError("发送失败!");
59
+        }
60
+        return response;
61
+    }
62
+
63
+}

+ 88
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CommunityController.java Прегледај датотеку

@@ -0,0 +1,88 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.ToCommunities;
5
+import com.community.huiju.service.CommunityServiceI;
6
+import io.swagger.annotations.Api;
7
+import io.swagger.annotations.ApiImplicitParam;
8
+import io.swagger.annotations.ApiImplicitParams;
9
+import io.swagger.annotations.ApiOperation;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.cloud.context.config.annotation.RefreshScope;
12
+import org.springframework.web.bind.annotation.PathVariable;
13
+import org.springframework.web.bind.annotation.RequestBody;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RequestParam;
17
+import org.springframework.web.bind.annotation.RestController;
18
+
19
+import java.util.List;
20
+
21
+/**
22
+ * @author FXF
23
+ * @date 2018-10-31
24
+ */
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "运营端社区API", description = "运营端社区API")
29
+public class CommunityController {
30
+	
31
+	@Autowired
32
+	private CommunityServiceI communityService;
33
+	
34
+	@ApiOperation(value = "根据搜索条件获取小区列表", notes = "根据搜索条件获取小区列表")
35
+	@ApiImplicitParams({
36
+			@ApiImplicitParam(paramType = "body", name = "toCommunities", dataType = "String",value =
37
+					"id:社区编号,communityName:社区名称(模糊查询), provinceId:省份id,cityId:城市id,districtId:区县id"),
38
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
39
+			@ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")
40
+	})
41
+	@RequestMapping(value = "/communitys",method = RequestMethod.POST)
42
+	public ResponseBean getCommunitys(@RequestBody ToCommunities toCommunities,
43
+	                                  @RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
44
+	                                  @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize){
45
+		ResponseBean responseBean = new ResponseBean();
46
+		List<ToCommunities> communitiesList = communityService.getCommunitys(toCommunities,pageNum,pageSize);
47
+		responseBean.addSuccess(communitiesList);
48
+		return responseBean;
49
+	}
50
+	
51
+	@ApiOperation(value = "添加小区", notes = "添加小区")
52
+	@ApiImplicitParams({
53
+			@ApiImplicitParam(paramType = "body", name = "toCommunities", dataType = "String",value =
54
+					"communityName:社区名称,communityAlias:小区别名, provinceId:省份id,cityId:城市id,districtId:区县id,longitude: 经度,latitude: 纬度,userName:物业端用户名,loginName:物业端登录名")
55
+	})
56
+	@RequestMapping(value = "/community/add",method = RequestMethod.POST)
57
+	public ResponseBean addCommunity(@RequestBody ToCommunities toCommunities){
58
+		ResponseBean responseBean = new ResponseBean();
59
+		Integer size = communityService.addCommunity(toCommunities);
60
+		responseBean.addSuccess(size);
61
+		return responseBean;
62
+	}
63
+	
64
+	@ApiOperation(value = "根据id获取小区", notes = "根据id获取小区")
65
+	@ApiImplicitParams({
66
+			@ApiImplicitParam(paramType = "path", dataType = "integer", name = "id", value = "小区id")
67
+	})
68
+	@RequestMapping(value = "/community/{id}",method = RequestMethod.GET)
69
+	public ResponseBean getCommunityById(@PathVariable("id") Integer id){
70
+		ResponseBean responseBean = new ResponseBean();
71
+		ToCommunities communities = communityService.getCommunityById(id);
72
+		responseBean.addSuccess(communities);
73
+		return responseBean;
74
+	}
75
+	
76
+	@ApiOperation(value = "根据id更新小区数据", notes = "根据id更新小区数据")
77
+	@ApiImplicitParams({
78
+			@ApiImplicitParam(paramType = "body", name = "toCommunities", dataType = "String",value =
79
+					"communityName:社区名称,communityAlias:小区别名, provinceId:省份id,cityId:城市id,districtId:区县id,longitude: 经度,latitude: 纬度,userName:物业端用户名,loginName:物业端登录名")
80
+	})
81
+	@RequestMapping(value = "/community/update",method = RequestMethod.POST)
82
+	public ResponseBean updateCommunityById(@RequestBody ToCommunities toCommunities){
83
+		ResponseBean responseBean = new ResponseBean();
84
+		Integer size = communityService.updateCommunityById(toCommunities);
85
+		responseBean.addSuccess(size);
86
+		return responseBean;
87
+	}
88
+}

+ 0
- 65
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/TestController.java Прегледај датотеку

@@ -1,65 +0,0 @@
1
-package com.community.huiju.controller;
2
-
3
-import com.community.commom.redis.RedisTemplate;
4
-import com.community.huiju.model.ScUser;
5
-import com.community.huiju.service.ScUserServiceI;
6
-import com.community.huiju.microController.MicroTestController;
7
-import io.swagger.annotations.Api;
8
-import io.swagger.annotations.ApiOperation;
9
-import org.springframework.beans.factory.annotation.Autowired;
10
-import org.springframework.beans.factory.annotation.Value;
11
-import org.springframework.cloud.context.config.annotation.RefreshScope;
12
-import org.springframework.web.bind.annotation.RequestMapping;
13
-import org.springframework.web.bind.annotation.RequestMethod;
14
-import org.springframework.web.bind.annotation.ResponseBody;
15
-import org.springframework.web.bind.annotation.RestController;
16
-
17
-import java.util.List;
18
-
19
-/**
20
- * @author FXF
21
- * @date 2018-09-11
22
- */
23
-@RestController
24
-@RefreshScope
25
-@RequestMapping("/client1")
26
-@Api("eureka-client1的测试controller的API")
27
-public class TestController {
28
-    
29
-    @Value("${abc}")
30
-    private String abc;
31
-    
32
-    @Autowired
33
-    private ScUserServiceI scUserService;
34
-    
35
-    @Autowired
36
-    private MicroTestController microTestController;
37
-    
38
-    @Autowired
39
-    private RedisTemplate redisTemplate;
40
-    
41
-    @ApiOperation(value = "测试无参", notes = "无参")
42
-    @RequestMapping(value = "/hello",method = RequestMethod.GET)
43
-    @ResponseBody
44
-    public String index(){
45
-        redisTemplate.set("1","1");
46
-        return abc;
47
-    }
48
-    
49
-    /**
50
-     * 获取所有的用户信息
51
-     * @return
52
-     */
53
-    @ApiOperation(value = "测试restful接口", notes = "测试接口")
54
-    @RequestMapping(value = "/user",method = RequestMethod.GET)
55
-    @ResponseBody
56
-    public List<ScUser> getUser(){
57
-        return scUserService.getUser();
58
-    }
59
-    
60
-    @RequestMapping(value = "/feignUser",method = RequestMethod.GET)
61
-    @ResponseBody
62
-    public List<ScUser> getMicroUser(){
63
-        return microTestController.getUser();
64
-    }
65
-}

+ 59
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/UserController.java Прегледај датотеку

@@ -0,0 +1,59 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.constant.Constant;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.service.IToUserService;
8
+import com.community.huiju.vo.ToUserVO;
9
+import io.swagger.annotations.Api;
10
+import io.swagger.annotations.ApiImplicitParam;
11
+import io.swagger.annotations.ApiImplicitParams;
12
+import io.swagger.annotations.ApiOperation;
13
+import org.apache.catalina.servlet4preview.http.HttpServletRequest;
14
+import org.springframework.beans.BeanUtils;
15
+import org.springframework.beans.factory.annotation.Autowired;
16
+import org.springframework.cloud.context.config.annotation.RefreshScope;
17
+import org.springframework.web.bind.annotation.*;
18
+
19
+import javax.servlet.http.HttpSession;
20
+
21
+/**
22
+ * 用户 控制器
23
+ * @author weiximei
24
+ */
25
+@RestController
26
+@RequestMapping("/")
27
+@RefreshScope
28
+@Api(value = "运营web用户API",description = "运营web用户API")
29
+public class UserController {
30
+
31
+    @Autowired
32
+    private IToUserService iToUserService;
33
+
34
+    @ApiOperation(value = "用户登录",nickname = "根据手机号, 验证码")
35
+    @ApiImplicitParams({
36
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "loginName登陆名, code 验证码")
37
+    })
38
+    @RequestMapping(value = "/user/login",method = RequestMethod.POST)
39
+    public ResponseBean login(@RequestBody String parameter, HttpSession session, HttpServletRequest request){
40
+
41
+        ResponseBean response = new ResponseBean();
42
+
43
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
44
+        response = iToUserService.login(jsonObject.getString("loginName"),jsonObject.getString("code"));
45
+        ToUserVO userVO = (ToUserVO) response.getData();
46
+
47
+        if (null != userVO) {
48
+            UserElement userElement = new UserElement();
49
+            BeanUtils.copyProperties(userVO,userElement);
50
+            userElement.setLoginType(Constant.WEB_LOGIN_TYPE);
51
+            session.setAttribute(Constant.WEB_USER_SESSION,userElement);
52
+            userVO.setToken(session.getId());
53
+        }
54
+
55
+        return response;
56
+    }
57
+
58
+
59
+}

+ 0
- 11
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ScUserMapper.java Прегледај датотеку

@@ -1,11 +0,0 @@
1
-package com.community.huiju.dao;
2
-
3
-import com.community.huiju.model.ScUser;
4
-import org.apache.ibatis.annotations.Mapper;
5
-
6
-import java.util.List;
7
-
8
-@Mapper
9
-public interface ScUserMapper {
10
-	List<ScUser> find();
11
-}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/SysDictionaryMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.SysDictionary;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface SysDictionaryMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(SysDictionary record);
11
+
12
+    int insertSelective(SysDictionary record);
13
+
14
+    SysDictionary selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(SysDictionary record);
17
+
18
+    int updateByPrimaryKey(SysDictionary record);
19
+}

+ 37
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToBannerMapper.java Прегледај датотеку

@@ -0,0 +1,37 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToBanner;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+import java.util.List;
7
+
8
+@Mapper
9
+public interface ToBannerMapper {
10
+    int deleteByPrimaryKey(Integer id);
11
+
12
+    int insert(ToBanner record);
13
+
14
+    int insertSelective(ToBanner record);
15
+
16
+    ToBanner selectByPrimaryKey(Integer id);
17
+
18
+    int updateByPrimaryKeySelective(ToBanner record);
19
+
20
+    int updateByPrimaryKeyWithBLOBs(ToBanner record);
21
+
22
+    int updateByPrimaryKey(ToBanner record);
23
+
24
+    /**
25
+     * 根据条件查询Banner
26
+     *
27
+     * title 标题
28
+     * bannerDescription 跳转描述
29
+     * bannerPosition banner位
30
+     *
31
+     *
32
+     * @param toBanner
33
+     * @return
34
+     */
35
+    List<ToBanner> selectBanner(ToBanner toBanner);
36
+
37
+}

+ 25
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToCommunitiesMapper.java Прегледај датотеку

@@ -0,0 +1,25 @@
1
+package com.community.huiju.dao;
2
+
3
+
4
+import com.community.huiju.model.ToCommunities;
5
+import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
9
+
10
+@Mapper
11
+public interface ToCommunitiesMapper {
12
+    int deleteByPrimaryKey(Integer id);
13
+
14
+    int insert(ToCommunities record);
15
+
16
+    int insertSelective(ToCommunities record);
17
+
18
+    ToCommunities selectByPrimaryKey(Integer id);
19
+
20
+    int updateByPrimaryKeySelective(ToCommunities record);
21
+
22
+    int updateByPrimaryKey(ToCommunities record);
23
+    
24
+    List<ToCommunities> selectByCommunityName(ToCommunities record);
25
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysMenuMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToSysMenu;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface ToSysMenuMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(ToSysMenu record);
11
+
12
+    int insertSelective(ToSysMenu record);
13
+
14
+    ToSysMenu selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(ToSysMenu record);
17
+
18
+    int updateByPrimaryKey(ToSysMenu record);
19
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToSysRole;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface ToSysRoleMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(ToSysRole record);
11
+
12
+    int insertSelective(ToSysRole record);
13
+
14
+    ToSysRole selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(ToSysRole record);
17
+
18
+    int updateByPrimaryKey(ToSysRole record);
19
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysRoleMenuMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToSysRoleMenu;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface ToSysRoleMenuMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(ToSysRoleMenu record);
11
+
12
+    int insertSelective(ToSysRoleMenu record);
13
+
14
+    ToSysRoleMenu selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(ToSysRoleMenu record);
17
+
18
+    int updateByPrimaryKey(ToSysRoleMenu record);
19
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToSysUserRoleMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToSysUserRole;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface ToSysUserRoleMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(ToSysUserRole record);
11
+
12
+    int insertSelective(ToSysUserRole record);
13
+
14
+    ToSysUserRole selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(ToSysUserRole record);
17
+
18
+    int updateByPrimaryKey(ToSysUserRole record);
19
+}

+ 22
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/ToUserMapper.java Прегледај датотеку

@@ -0,0 +1,22 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.ToUser;
4
+import org.apache.ibatis.annotations.Mapper;
5
+import org.apache.ibatis.annotations.Param;
6
+
7
+@Mapper
8
+public interface ToUserMapper {
9
+    int deleteByPrimaryKey(Integer id);
10
+
11
+    int insert(ToUser record);
12
+
13
+    int insertSelective(ToUser record);
14
+
15
+    ToUser selectByPrimaryKey(Integer id);
16
+
17
+    int updateByPrimaryKeySelective(ToUser record);
18
+
19
+    int updateByPrimaryKey(ToUser record);
20
+
21
+    ToUser selectByLoginName(@Param(value = "loginName") String loginName);
22
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TpUserCommunityMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpUserCommunity;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface TpUserCommunityMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(TpUserCommunity record);
11
+
12
+    int insertSelective(TpUserCommunity record);
13
+
14
+    TpUserCommunity selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(TpUserCommunity record);
17
+
18
+    int updateByPrimaryKey(TpUserCommunity record);
19
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/dao/TpUserMapper.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpUser;
4
+import org.apache.ibatis.annotations.Mapper;
5
+
6
+@Mapper
7
+public interface TpUserMapper {
8
+    int deleteByPrimaryKey(Integer id);
9
+
10
+    int insert(TpUser record);
11
+
12
+    int insertSelective(TpUser record);
13
+
14
+    TpUser selectByPrimaryKey(Integer id);
15
+
16
+    int updateByPrimaryKeySelective(TpUser record);
17
+
18
+    int updateByPrimaryKey(TpUser record);
19
+}

+ 58
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/exception/ExceptionHandleAdice.java Прегледај датотеку

@@ -0,0 +1,58 @@
1
+package com.community.huiju.exception;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import lombok.extern.slf4j.Slf4j;
6
+import org.springframework.validation.ObjectError;
7
+import org.springframework.web.bind.MethodArgumentNotValidException;
8
+import org.springframework.web.bind.annotation.ControllerAdvice;
9
+import org.springframework.web.bind.annotation.ExceptionHandler;
10
+import org.springframework.web.bind.annotation.ResponseBody;
11
+
12
+import java.util.List;
13
+
14
+/**
15
+ * 统一异常出口
16
+ * @author weiximei
17
+ */
18
+@ControllerAdvice
19
+@ResponseBody
20
+@Slf4j
21
+public class ExceptionHandleAdice {
22
+
23
+
24
+    @ExceptionHandler(Exception.class)
25
+    public ResponseBean handleException(Exception e){
26
+        log.error(e.getMessage(),e);
27
+        ResponseBean response = new ResponseBean();
28
+        response.addError(Constant.REQUEST_ERROR,"系统异常,请稍后重试!");
29
+        return response;
30
+    }
31
+
32
+
33
+    @ExceptionHandler(WisdomException.class)
34
+    public ResponseBean handleException(WisdomException e) {
35
+        log.error(e.getMessage(),e);
36
+        ResponseBean response = new ResponseBean();
37
+        response.addError(e.getMessage());
38
+        return response;
39
+    }
40
+
41
+
42
+    @ExceptionHandler(MethodArgumentNotValidException.class)
43
+    public ResponseBean handlelllewgalParamException(MethodArgumentNotValidException e){
44
+        ResponseBean response = new ResponseBean();
45
+
46
+        List<ObjectError> errors  =e.getBindingResult().getAllErrors();
47
+        String message = "参数不合法";
48
+        if (errors.size() >0) {
49
+            message = errors.get(0).getDefaultMessage();
50
+        }
51
+
52
+        response.addError(message);
53
+
54
+        return response;
55
+    }
56
+
57
+
58
+}

+ 17
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/exception/WisdomException.java Прегледај датотеку

@@ -0,0 +1,17 @@
1
+package com.community.huiju.exception;
2
+
3
+
4
+/**
5
+ * @author weiximei
6
+ */
7
+public class WisdomException extends RuntimeException {
8
+
9
+
10
+    public WisdomException(String msg, Throwable t) {
11
+        super(msg, t);
12
+    }
13
+
14
+    public WisdomException(String msg) {
15
+        super(msg);
16
+    }
17
+}

+ 0
- 14
CODE/smart-community/operate-api/src/main/java/com/community/huiju/microController/MicroTestController.java Прегледај датотеку

@@ -1,14 +0,0 @@
1
-package com.community.huiju.microController;
2
-
3
-import com.community.huiju.model.ScUser;
4
-import org.springframework.cloud.openfeign.FeignClient;
5
-import org.springframework.web.bind.annotation.RequestMapping;
6
-
7
-import java.util.List;
8
-
9
-@FeignClient("eureka-client2")
10
-public interface MicroTestController {
11
-	
12
-	@RequestMapping("/user")
13
-	List<ScUser> getUser();
14
-}

+ 0
- 37
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ScUser.java Прегледај датотеку

@@ -1,37 +0,0 @@
1
-package com.community.huiju.model;
2
-
3
-/**
4
- * @author FXF
5
- * @date 2018-09-19
6
- */
7
-public class ScUser {
8
-	private Integer id;
9
-	
10
-	private String userName;
11
-	
12
-	private String userPassword;
13
-	
14
-	public Integer getId() {
15
-		return id;
16
-	}
17
-	
18
-	public void setId(Integer id) {
19
-		this.id = id;
20
-	}
21
-	
22
-	public String getUserName() {
23
-		return userName;
24
-	}
25
-	
26
-	public void setUserName(String userName) {
27
-		this.userName = userName;
28
-	}
29
-	
30
-	public String getUserPassword() {
31
-		return userPassword;
32
-	}
33
-	
34
-	public void setUserPassword(String userPassword) {
35
-		this.userPassword = userPassword;
36
-	}
37
-}

+ 53
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/SysDictionary.java Прегледај датотеку

@@ -0,0 +1,53 @@
1
+package com.community.huiju.model;
2
+
3
+public class SysDictionary {
4
+    private Integer id;
5
+
6
+    private String code;
7
+
8
+    private String name;
9
+
10
+    private String groupId;
11
+
12
+    private Integer sort;
13
+
14
+    public Integer getId() {
15
+        return id;
16
+    }
17
+
18
+    public void setId(Integer id) {
19
+        this.id = id;
20
+    }
21
+
22
+    public String getCode() {
23
+        return code;
24
+    }
25
+
26
+    public void setCode(String code) {
27
+        this.code = code == null ? null : code.trim();
28
+    }
29
+
30
+    public String getName() {
31
+        return name;
32
+    }
33
+
34
+    public void setName(String name) {
35
+        this.name = name == null ? null : name.trim();
36
+    }
37
+
38
+    public String getGroupId() {
39
+        return groupId;
40
+    }
41
+
42
+    public void setGroupId(String groupId) {
43
+        this.groupId = groupId == null ? null : groupId.trim();
44
+    }
45
+
46
+    public Integer getSort() {
47
+        return sort;
48
+    }
49
+
50
+    public void setSort(Integer sort) {
51
+        this.sort = sort;
52
+    }
53
+}

+ 184
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToBanner.java Прегледај датотеку

@@ -0,0 +1,184 @@
1
+package com.community.huiju.model;
2
+
3
+import javax.validation.constraints.Future;
4
+import javax.validation.constraints.Min;
5
+import javax.validation.constraints.NotBlank;
6
+import java.util.Date;
7
+
8
+public class ToBanner {
9
+    private Integer id;
10
+
11
+    private String title;
12
+
13
+    @Min(value = 0,message = "小区不能为空!")
14
+    private Integer communityId;
15
+
16
+    private String bannerDescription;
17
+
18
+    private Integer sort;
19
+
20
+    @NotBlank(message = "banner图片不能为空!")
21
+    private String bannerCover;
22
+
23
+    @Min(value = 0,message = "请选择有效的banner位!")
24
+    private Integer bannerPosition;
25
+
26
+    private Date effTime;
27
+
28
+    private Date expTime;
29
+
30
+    @NotBlank(message = "banner类型不能为空!")
31
+    private String bannerType;
32
+
33
+    @NotBlank(message = "跳转的URL不能为空!")
34
+    private String externalLink;
35
+
36
+    @NotBlank(message = "banner标题不能为空!")
37
+    private String bannerTitle;
38
+
39
+    private Integer createUser;
40
+
41
+    private Date createDate;
42
+
43
+    private Integer updateUser;
44
+
45
+    private Date updateDate;
46
+
47
+    private String bannerContent;
48
+
49
+    public Integer getId() {
50
+        return id;
51
+    }
52
+
53
+    public void setId(Integer id) {
54
+        this.id = id;
55
+    }
56
+
57
+    public String getTitle() {
58
+        return title;
59
+    }
60
+
61
+    public void setTitle(String title) {
62
+        this.title = title;
63
+    }
64
+
65
+    public Integer getCommunityId() {
66
+        return communityId;
67
+    }
68
+
69
+    public void setCommunityId(Integer communityId) {
70
+        this.communityId = communityId;
71
+    }
72
+
73
+    public String getBannerDescription() {
74
+        return bannerDescription;
75
+    }
76
+
77
+    public void setBannerDescription(String bannerDescription) {
78
+        this.bannerDescription = bannerDescription == null ? null : bannerDescription.trim();
79
+    }
80
+
81
+    public Integer getSort() {
82
+        return sort;
83
+    }
84
+
85
+    public void setSort(Integer sort) {
86
+        this.sort = sort;
87
+    }
88
+
89
+    public String getBannerCover() {
90
+        return bannerCover;
91
+    }
92
+
93
+    public void setBannerCover(String bannerCover) {
94
+        this.bannerCover = bannerCover == null ? null : bannerCover.trim();
95
+    }
96
+
97
+    public Integer getBannerPosition() {
98
+        return bannerPosition;
99
+    }
100
+
101
+    public void setBannerPosition(Integer bannerPosition) {
102
+        this.bannerPosition = bannerPosition;
103
+    }
104
+
105
+    public Date getEffTime() {
106
+        return effTime;
107
+    }
108
+
109
+    public void setEffTime(Date effTime) {
110
+        this.effTime = effTime;
111
+    }
112
+
113
+    public Date getExpTime() {
114
+        return expTime;
115
+    }
116
+
117
+    public void setExpTime(Date expTime) {
118
+        this.expTime = expTime;
119
+    }
120
+
121
+    public String getBannerType() {
122
+        return bannerType;
123
+    }
124
+
125
+    public void setBannerType(String bannerType) {
126
+        this.bannerType = bannerType == null ? null : bannerType.trim();
127
+    }
128
+
129
+    public String getExternalLink() {
130
+        return externalLink;
131
+    }
132
+
133
+    public void setExternalLink(String externalLink) {
134
+        this.externalLink = externalLink == null ? null : externalLink.trim();
135
+    }
136
+
137
+    public String getBannerTitle() {
138
+        return bannerTitle;
139
+    }
140
+
141
+    public void setBannerTitle(String bannerTitle) {
142
+        this.bannerTitle = bannerTitle == null ? null : bannerTitle.trim();
143
+    }
144
+
145
+    public Integer getCreateUser() {
146
+        return createUser;
147
+    }
148
+
149
+    public void setCreateUser(Integer createUser) {
150
+        this.createUser = createUser;
151
+    }
152
+
153
+    public Date getCreateDate() {
154
+        return createDate;
155
+    }
156
+
157
+    public void setCreateDate(Date createDate) {
158
+        this.createDate = createDate;
159
+    }
160
+
161
+    public Integer getUpdateUser() {
162
+        return updateUser;
163
+    }
164
+
165
+    public void setUpdateUser(Integer updateUser) {
166
+        this.updateUser = updateUser;
167
+    }
168
+
169
+    public Date getUpdateDate() {
170
+        return updateDate;
171
+    }
172
+
173
+    public void setUpdateDate(Date updateDate) {
174
+        this.updateDate = updateDate;
175
+    }
176
+
177
+    public String getBannerContent() {
178
+        return bannerContent;
179
+    }
180
+
181
+    public void setBannerContent(String bannerContent) {
182
+        this.bannerContent = bannerContent == null ? null : bannerContent.trim();
183
+    }
184
+}

+ 103
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToCommunities.java Прегледај датотеку

@@ -0,0 +1,103 @@
1
+package com.community.huiju.model;
2
+
3
+public class ToCommunities {
4
+    private Integer id;
5
+
6
+    private String communityName;
7
+
8
+    private String communityAlias;
9
+
10
+    private Integer provinceId;
11
+
12
+    private Integer cityId;
13
+
14
+    private Integer districtId;
15
+
16
+    private String longitude;
17
+
18
+    private String latitude;
19
+    
20
+    private String userName;
21
+    
22
+    private String loginName;
23
+
24
+    public Integer getId() {
25
+        return id;
26
+    }
27
+
28
+    public void setId(Integer id) {
29
+        this.id = id;
30
+    }
31
+
32
+    public String getCommunityName() {
33
+        return communityName;
34
+    }
35
+
36
+    public void setCommunityName(String communityName) {
37
+        this.communityName = communityName == null ? null : communityName.trim();
38
+    }
39
+
40
+    public String getCommunityAlias() {
41
+        return communityAlias;
42
+    }
43
+
44
+    public void setCommunityAlias(String communityAlias) {
45
+        this.communityAlias = communityAlias == null ? null : communityAlias.trim();
46
+    }
47
+
48
+    public Integer getProvinceId() {
49
+        return provinceId;
50
+    }
51
+
52
+    public void setProvinceId(Integer provinceId) {
53
+        this.provinceId = provinceId;
54
+    }
55
+
56
+    public Integer getCityId() {
57
+        return cityId;
58
+    }
59
+
60
+    public void setCityId(Integer cityId) {
61
+        this.cityId = cityId;
62
+    }
63
+
64
+    public Integer getDistrictId() {
65
+        return districtId;
66
+    }
67
+
68
+    public void setDistrictId(Integer districtId) {
69
+        this.districtId = districtId;
70
+    }
71
+
72
+    public String getLongitude() {
73
+        return longitude;
74
+    }
75
+
76
+    public void setLongitude(String longitude) {
77
+        this.longitude = longitude == null ? null : longitude.trim();
78
+    }
79
+
80
+    public String getLatitude() {
81
+        return latitude;
82
+    }
83
+
84
+    public void setLatitude(String latitude) {
85
+        this.latitude = latitude == null ? null : latitude.trim();
86
+    }
87
+    
88
+    public String getUserName() {
89
+        return userName;
90
+    }
91
+    
92
+    public void setUserName(String userName) {
93
+        this.userName = userName;
94
+    }
95
+    
96
+    public String getLoginName() {
97
+        return loginName;
98
+    }
99
+    
100
+    public void setLoginName(String loginName) {
101
+        this.loginName = loginName;
102
+    }
103
+}

+ 83
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysMenu.java Прегледај датотеку

@@ -0,0 +1,83 @@
1
+package com.community.huiju.model;
2
+
3
+public class ToSysMenu {
4
+    private Integer id;
5
+
6
+    private String menuName;
7
+
8
+    private String menuUrl;
9
+
10
+    private String menuIcon;
11
+
12
+    private Integer parentId;
13
+
14
+    private Integer sort;
15
+
16
+    private String menuType;
17
+
18
+    private String status;
19
+
20
+    public Integer getId() {
21
+        return id;
22
+    }
23
+
24
+    public void setId(Integer id) {
25
+        this.id = id;
26
+    }
27
+
28
+    public String getMenuName() {
29
+        return menuName;
30
+    }
31
+
32
+    public void setMenuName(String menuName) {
33
+        this.menuName = menuName == null ? null : menuName.trim();
34
+    }
35
+
36
+    public String getMenuUrl() {
37
+        return menuUrl;
38
+    }
39
+
40
+    public void setMenuUrl(String menuUrl) {
41
+        this.menuUrl = menuUrl == null ? null : menuUrl.trim();
42
+    }
43
+
44
+    public String getMenuIcon() {
45
+        return menuIcon;
46
+    }
47
+
48
+    public void setMenuIcon(String menuIcon) {
49
+        this.menuIcon = menuIcon == null ? null : menuIcon.trim();
50
+    }
51
+
52
+    public Integer getParentId() {
53
+        return parentId;
54
+    }
55
+
56
+    public void setParentId(Integer parentId) {
57
+        this.parentId = parentId;
58
+    }
59
+
60
+    public Integer getSort() {
61
+        return sort;
62
+    }
63
+
64
+    public void setSort(Integer sort) {
65
+        this.sort = sort;
66
+    }
67
+
68
+    public String getMenuType() {
69
+        return menuType;
70
+    }
71
+
72
+    public void setMenuType(String menuType) {
73
+        this.menuType = menuType == null ? null : menuType.trim();
74
+    }
75
+
76
+    public String getStatus() {
77
+        return status;
78
+    }
79
+
80
+    public void setStatus(String status) {
81
+        this.status = status == null ? null : status.trim();
82
+    }
83
+}

+ 85
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysRole.java Прегледај датотеку

@@ -0,0 +1,85 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class ToSysRole {
6
+    private Integer id;
7
+
8
+    private String roleName;
9
+
10
+    private String description;
11
+
12
+    private String status;
13
+
14
+    private Integer createUser;
15
+
16
+    private Date createDate;
17
+
18
+    private Integer updateUser;
19
+
20
+    private Date updateDate;
21
+
22
+    public Integer getId() {
23
+        return id;
24
+    }
25
+
26
+    public void setId(Integer id) {
27
+        this.id = id;
28
+    }
29
+
30
+    public String getRoleName() {
31
+        return roleName;
32
+    }
33
+
34
+    public void setRoleName(String roleName) {
35
+        this.roleName = roleName == null ? null : roleName.trim();
36
+    }
37
+
38
+    public String getDescription() {
39
+        return description;
40
+    }
41
+
42
+    public void setDescription(String description) {
43
+        this.description = description == null ? null : description.trim();
44
+    }
45
+
46
+    public String getStatus() {
47
+        return status;
48
+    }
49
+
50
+    public void setStatus(String status) {
51
+        this.status = status == null ? null : status.trim();
52
+    }
53
+
54
+    public Integer getCreateUser() {
55
+        return createUser;
56
+    }
57
+
58
+    public void setCreateUser(Integer createUser) {
59
+        this.createUser = createUser;
60
+    }
61
+
62
+    public Date getCreateDate() {
63
+        return createDate;
64
+    }
65
+
66
+    public void setCreateDate(Date createDate) {
67
+        this.createDate = createDate;
68
+    }
69
+
70
+    public Integer getUpdateUser() {
71
+        return updateUser;
72
+    }
73
+
74
+    public void setUpdateUser(Integer updateUser) {
75
+        this.updateUser = updateUser;
76
+    }
77
+
78
+    public Date getUpdateDate() {
79
+        return updateDate;
80
+    }
81
+
82
+    public void setUpdateDate(Date updateDate) {
83
+        this.updateDate = updateDate;
84
+    }
85
+}

+ 33
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysRoleMenu.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.community.huiju.model;
2
+
3
+public class ToSysRoleMenu {
4
+    private Integer id;
5
+
6
+    private Integer roleId;
7
+
8
+    private Integer menuId;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public Integer getRoleId() {
19
+        return roleId;
20
+    }
21
+
22
+    public void setRoleId(Integer roleId) {
23
+        this.roleId = roleId;
24
+    }
25
+
26
+    public Integer getMenuId() {
27
+        return menuId;
28
+    }
29
+
30
+    public void setMenuId(Integer menuId) {
31
+        this.menuId = menuId;
32
+    }
33
+}

+ 33
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToSysUserRole.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.community.huiju.model;
2
+
3
+public class ToSysUserRole {
4
+    private Integer id;
5
+
6
+    private Integer userId;
7
+
8
+    private Integer roleId;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public Integer getUserId() {
19
+        return userId;
20
+    }
21
+
22
+    public void setUserId(Integer userId) {
23
+        this.userId = userId;
24
+    }
25
+
26
+    public Integer getRoleId() {
27
+        return roleId;
28
+    }
29
+
30
+    public void setRoleId(Integer roleId) {
31
+        this.roleId = roleId;
32
+    }
33
+}

+ 125
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/ToUser.java Прегледај датотеку

@@ -0,0 +1,125 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class ToUser {
6
+    private Integer id;
7
+
8
+    private String userName;
9
+
10
+    private String loginName;
11
+
12
+    private String loginPassword;
13
+
14
+    private String email;
15
+
16
+    private String headPortrait;
17
+
18
+    private String remark;
19
+
20
+    private String status;
21
+
22
+    private Integer createUser;
23
+
24
+    private Date createDate;
25
+
26
+    private Integer updateUser;
27
+
28
+    private Date updateDate;
29
+
30
+    public Integer getId() {
31
+        return id;
32
+    }
33
+
34
+    public void setId(Integer id) {
35
+        this.id = id;
36
+    }
37
+
38
+    public String getUserName() {
39
+        return userName;
40
+    }
41
+
42
+    public void setUserName(String userName) {
43
+        this.userName = userName == null ? null : userName.trim();
44
+    }
45
+
46
+    public String getLoginName() {
47
+        return loginName;
48
+    }
49
+
50
+    public void setLoginName(String loginName) {
51
+        this.loginName = loginName == null ? null : loginName.trim();
52
+    }
53
+
54
+    public String getLoginPassword() {
55
+        return loginPassword;
56
+    }
57
+
58
+    public void setLoginPassword(String loginPassword) {
59
+        this.loginPassword = loginPassword == null ? null : loginPassword.trim();
60
+    }
61
+
62
+    public String getEmail() {
63
+        return email;
64
+    }
65
+
66
+    public void setEmail(String email) {
67
+        this.email = email == null ? null : email.trim();
68
+    }
69
+
70
+    public String getHeadPortrait() {
71
+        return headPortrait;
72
+    }
73
+
74
+    public void setHeadPortrait(String headPortrait) {
75
+        this.headPortrait = headPortrait == null ? null : headPortrait.trim();
76
+    }
77
+
78
+    public String getRemark() {
79
+        return remark;
80
+    }
81
+
82
+    public void setRemark(String remark) {
83
+        this.remark = remark == null ? null : remark.trim();
84
+    }
85
+
86
+    public String getStatus() {
87
+        return status;
88
+    }
89
+
90
+    public void setStatus(String status) {
91
+        this.status = status == null ? null : status.trim();
92
+    }
93
+
94
+    public Integer getCreateUser() {
95
+        return createUser;
96
+    }
97
+
98
+    public void setCreateUser(Integer createUser) {
99
+        this.createUser = createUser;
100
+    }
101
+
102
+    public Date getCreateDate() {
103
+        return createDate;
104
+    }
105
+
106
+    public void setCreateDate(Date createDate) {
107
+        this.createDate = createDate;
108
+    }
109
+
110
+    public Integer getUpdateUser() {
111
+        return updateUser;
112
+    }
113
+
114
+    public void setUpdateUser(Integer updateUser) {
115
+        this.updateUser = updateUser;
116
+    }
117
+
118
+    public Date getUpdateDate() {
119
+        return updateDate;
120
+    }
121
+
122
+    public void setUpdateDate(Date updateDate) {
123
+        this.updateDate = updateDate;
124
+    }
125
+}

+ 135
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TpUser.java Прегледај датотеку

@@ -0,0 +1,135 @@
1
+package com.community.huiju.model;
2
+
3
+import java.util.Date;
4
+
5
+public class TpUser {
6
+    private Integer id;
7
+
8
+    private Integer communityId;
9
+
10
+    private String userName;
11
+
12
+    private String loginName;
13
+
14
+    private String loginPassword;
15
+
16
+    private String status;
17
+
18
+    private String remark;
19
+
20
+    private String email;
21
+
22
+    private String headPortrait;
23
+
24
+    private Integer createUser;
25
+
26
+    private Date createDate;
27
+
28
+    private Integer updateUser;
29
+
30
+    private Date updateDate;
31
+
32
+    public Integer getId() {
33
+        return id;
34
+    }
35
+
36
+    public void setId(Integer id) {
37
+        this.id = id;
38
+    }
39
+
40
+    public Integer getCommunityId() {
41
+        return communityId;
42
+    }
43
+
44
+    public void setCommunityId(Integer communityId) {
45
+        this.communityId = communityId;
46
+    }
47
+
48
+    public String getUserName() {
49
+        return userName;
50
+    }
51
+
52
+    public void setUserName(String userName) {
53
+        this.userName = userName == null ? null : userName.trim();
54
+    }
55
+
56
+    public String getLoginName() {
57
+        return loginName;
58
+    }
59
+
60
+    public void setLoginName(String loginName) {
61
+        this.loginName = loginName == null ? null : loginName.trim();
62
+    }
63
+
64
+    public String getLoginPassword() {
65
+        return loginPassword;
66
+    }
67
+
68
+    public void setLoginPassword(String loginPassword) {
69
+        this.loginPassword = loginPassword == null ? null : loginPassword.trim();
70
+    }
71
+
72
+    public String getStatus() {
73
+        return status;
74
+    }
75
+
76
+    public void setStatus(String status) {
77
+        this.status = status == null ? null : status.trim();
78
+    }
79
+
80
+    public String getRemark() {
81
+        return remark;
82
+    }
83
+
84
+    public void setRemark(String remark) {
85
+        this.remark = remark == null ? null : remark.trim();
86
+    }
87
+
88
+    public String getEmail() {
89
+        return email;
90
+    }
91
+
92
+    public void setEmail(String email) {
93
+        this.email = email == null ? null : email.trim();
94
+    }
95
+
96
+    public String getHeadPortrait() {
97
+        return headPortrait;
98
+    }
99
+
100
+    public void setHeadPortrait(String headPortrait) {
101
+        this.headPortrait = headPortrait == null ? null : headPortrait.trim();
102
+    }
103
+
104
+    public Integer getCreateUser() {
105
+        return createUser;
106
+    }
107
+
108
+    public void setCreateUser(Integer createUser) {
109
+        this.createUser = createUser;
110
+    }
111
+
112
+    public Date getCreateDate() {
113
+        return createDate;
114
+    }
115
+
116
+    public void setCreateDate(Date createDate) {
117
+        this.createDate = createDate;
118
+    }
119
+
120
+    public Integer getUpdateUser() {
121
+        return updateUser;
122
+    }
123
+
124
+    public void setUpdateUser(Integer updateUser) {
125
+        this.updateUser = updateUser;
126
+    }
127
+
128
+    public Date getUpdateDate() {
129
+        return updateDate;
130
+    }
131
+
132
+    public void setUpdateDate(Date updateDate) {
133
+        this.updateDate = updateDate;
134
+    }
135
+}

+ 33
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/model/TpUserCommunity.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.community.huiju.model;
2
+
3
+public class TpUserCommunity {
4
+    private Integer id;
5
+
6
+    private Integer communityId;
7
+
8
+    private Integer tpUserId;
9
+
10
+    public Integer getId() {
11
+        return id;
12
+    }
13
+
14
+    public void setId(Integer id) {
15
+        this.id = id;
16
+    }
17
+
18
+    public Integer getCommunityId() {
19
+        return communityId;
20
+    }
21
+
22
+    public void setCommunityId(Integer communityId) {
23
+        this.communityId = communityId;
24
+    }
25
+
26
+    public Integer getTpUserId() {
27
+        return tpUserId;
28
+    }
29
+
30
+    public void setTpUserId(Integer tpUserId) {
31
+        this.tpUserId = tpUserId;
32
+    }
33
+}

+ 38
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/CommunityServiceI.java Прегледај датотеку

@@ -0,0 +1,38 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.huiju.model.ToCommunities;
4
+
5
+import java.util.List;
6
+
7
+public interface CommunityServiceI {
8
+	
9
+	/**
10
+	 * 分页获取小区列表
11
+	 * @param toCommunities
12
+	 * @param pageNum
13
+	 * @param pageSize
14
+	 * @return
15
+	 */
16
+	List<ToCommunities> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize);
17
+	
18
+	/**
19
+	 * 添加新的小区
20
+	 * @param toCommunities
21
+	 * @return
22
+	 */
23
+	Integer addCommunity(ToCommunities toCommunities);
24
+	
25
+	/**
26
+	 * 根据id获取详情数据
27
+	 * @param id
28
+	 * @return
29
+	 */
30
+	ToCommunities getCommunityById(Integer id);
31
+	
32
+	/**
33
+	 * 根据小区id更新数据
34
+	 * @param toCommunities
35
+	 * @return
36
+	 */
37
+	Integer updateCommunityById(ToCommunities toCommunities);
38
+}

+ 48
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToBannerService.java Прегледај датотеку

@@ -0,0 +1,48 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.model.ToBanner;
5
+
6
+/**
7
+ * banner 业务管理
8
+ * @author weiximei
9
+ */
10
+public interface IToBannerService {
11
+
12
+    /**
13
+     * 添加banner
14
+     * @param banner
15
+     * @param currentUserId
16
+     * @return
17
+     */
18
+    ResponseBean addBanner(ToBanner banner,Integer currentUserId);
19
+
20
+    /**
21
+     * 查询banner详情
22
+     * @param bannerId banner的编号
23
+     * @return
24
+     */
25
+    ResponseBean getById(Integer bannerId);
26
+
27
+    /**
28
+     * 修改banner
29
+     * @param banner
30
+     * @param currentUserId
31
+     * @return
32
+     */
33
+    ResponseBean modifyBanner(ToBanner banner,Integer currentUserId);
34
+
35
+    /**
36
+     * 根据条件查询Banner
37
+     *
38
+     * title 标题
39
+     * bannerDescription 跳转描述
40
+     * bannerPosition banner位
41
+     *
42
+     *
43
+     * @param banner
44
+     * @return
45
+     */
46
+    ResponseBean getBanner(ToBanner banner);
47
+
48
+}

+ 19
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/IToUserService.java Прегледај датотеку

@@ -0,0 +1,19 @@
1
+package com.community.huiju.service;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+
5
+/**
6
+ * 用户 业务
7
+ * @author weiximei
8
+ */
9
+public interface IToUserService {
10
+
11
+    /**
12
+     * 用户登录
13
+     * @param loginName
14
+     * @param code 验证码
15
+     * @return
16
+     */
17
+    ResponseBean login(String loginName,String code);
18
+
19
+}

+ 0
- 9
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/ScUserServiceI.java Прегледај датотеку

@@ -1,9 +0,0 @@
1
-package com.community.huiju.service;
2
-
3
-import com.community.huiju.model.ScUser;
4
-
5
-import java.util.List;
6
-
7
-public interface ScUserServiceI {
8
-	List<ScUser> getUser();
9
-}

+ 96
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/CommunityServiceImpl.java Прегледај датотеку

@@ -0,0 +1,96 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.huiju.dao.ToCommunitiesMapper;
5
+import com.community.huiju.dao.TpUserCommunityMapper;
6
+import com.community.huiju.dao.TpUserMapper;
7
+import com.community.huiju.model.ToCommunities;
8
+import com.community.huiju.model.TpUser;
9
+import com.community.huiju.model.TpUserCommunity;
10
+import com.community.huiju.service.CommunityServiceI;
11
+import com.github.pagehelper.PageHelper;
12
+import org.springframework.beans.factory.annotation.Autowired;
13
+import org.springframework.stereotype.Service;
14
+import org.springframework.transaction.annotation.Transactional;
15
+
16
+import java.util.Date;
17
+import java.util.List;
18
+
19
+/**
20
+ * @author FXF
21
+ * @date 2018-10-31
22
+ */
23
+@Service("communityService")
24
+@Transactional
25
+public class CommunityServiceImpl implements CommunityServiceI {
26
+	
27
+	@Autowired
28
+	private ToCommunitiesMapper toCommunitiesMapper;
29
+	
30
+	@Autowired
31
+	private TpUserMapper tpUserMapper;
32
+	
33
+	@Autowired
34
+	private TpUserCommunityMapper tpUserCommunityMapper;
35
+	
36
+	/**
37
+	 * 分页获取小区列表
38
+	 * @param toCommunities
39
+	 * @param pageNum
40
+	 * @param pageSize
41
+	 * @return
42
+	 */
43
+	@Override
44
+	public List<ToCommunities> getCommunitys(ToCommunities toCommunities, Integer pageNum, Integer pageSize) {
45
+		//使用分页插件
46
+		PageHelper.startPage(pageNum, pageSize);
47
+		//获取数据
48
+		List<ToCommunities> list = toCommunitiesMapper.selectByCommunityName(toCommunities);
49
+		return list;
50
+	}
51
+	
52
+	@Override
53
+	public Integer addCommunity(ToCommunities toCommunities) {
54
+		Integer size = toCommunitiesMapper.insertSelective(toCommunities);
55
+		if (size < 1){
56
+			return 0;
57
+		}
58
+		
59
+		//构建用户信息
60
+		TpUser tpUser = new TpUser();
61
+		tpUser.setCommunityId(toCommunities.getId());
62
+		tpUser.setUserName(toCommunities.getUserName());
63
+		tpUser.setLoginName(toCommunities.getLoginName());
64
+		tpUser.setCreateDate(new Date());
65
+		tpUser.setCreateUser(1);
66
+		tpUser.setStatus(Constant.EFFECTIVE);
67
+		//插入用户信息
68
+		tpUserMapper.insertSelective(tpUser);
69
+		//维护住户端用户与社区关系表
70
+		TpUserCommunity tpUserCommunity = new TpUserCommunity();
71
+		tpUserCommunity.setTpUserId(tpUser.getId());
72
+		tpUserCommunity.setCommunityId(tpUser.getCommunityId());
73
+		tpUserCommunityMapper.insertSelective(tpUserCommunity);
74
+		return size;
75
+	}
76
+	
77
+	/**
78
+	 * 根据详情获取小区数据
79
+	 * @param id
80
+	 * @return
81
+	 */
82
+	@Override
83
+	public ToCommunities getCommunityById(Integer id) {
84
+		return toCommunitiesMapper.selectByPrimaryKey(id);
85
+	}
86
+	
87
+	/**
88
+	 * 根据小区id更新数据
89
+	 * @param toCommunities
90
+	 * @return
91
+	 */
92
+	@Override
93
+	public Integer updateCommunityById(ToCommunities toCommunities) {
94
+		return toCommunitiesMapper.updateByPrimaryKeySelective(toCommunities);
95
+	}
96
+}

+ 0
- 25
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ScUserServiceImpl.java Прегледај датотеку

@@ -1,25 +0,0 @@
1
-package com.community.huiju.service.impl;
2
-
3
-import com.community.huiju.dao.ScUserMapper;
4
-import com.community.huiju.model.ScUser;
5
-import com.community.huiju.service.ScUserServiceI;
6
-import org.springframework.beans.factory.annotation.Autowired;
7
-import org.springframework.stereotype.Service;
8
-
9
-import java.util.List;
10
-
11
-/**
12
- * @author FXF
13
- * @date 2018-09-19
14
- */
15
-@Service("scUserService")
16
-public class ScUserServiceImpl implements ScUserServiceI {
17
-	
18
-	@Autowired
19
-	private ScUserMapper scUserMapper;
20
-	
21
-	@Override
22
-	public List<ScUser> getUser() {
23
-		return scUserMapper.find();
24
-	}
25
-}

+ 158
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToBannerServiceImpl.java Прегледај датотеку

@@ -0,0 +1,158 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.constant.Constant;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.dao.SysDictionaryMapper;
6
+import com.community.huiju.dao.ToBannerMapper;
7
+import com.community.huiju.dao.ToCommunitiesMapper;
8
+import com.community.huiju.dao.ToUserMapper;
9
+import com.community.huiju.model.SysDictionary;
10
+import com.community.huiju.model.ToBanner;
11
+import com.community.huiju.model.ToCommunities;
12
+import com.community.huiju.model.ToUser;
13
+import com.community.huiju.service.IToBannerService;
14
+import com.community.huiju.vo.ToBannerVO;
15
+import org.apache.commons.lang.StringUtils;
16
+import org.springframework.beans.BeanUtils;
17
+import org.springframework.beans.factory.annotation.Autowired;
18
+import org.springframework.stereotype.Service;
19
+
20
+import java.util.Date;
21
+import java.util.List;
22
+import java.util.stream.Collectors;
23
+
24
+/**
25
+ * banner 业务
26
+ * @author weiximei
27
+ */
28
+@Service("iToBannerService")
29
+public class ToBannerServiceImpl implements IToBannerService {
30
+
31
+    @Autowired
32
+    private ToBannerMapper toBannerMapper;
33
+
34
+    @Autowired
35
+    private ToUserMapper toUserMapper;
36
+
37
+    @Autowired
38
+    private ToCommunitiesMapper toCommunitiesMapper;
39
+
40
+    @Autowired
41
+    private SysDictionaryMapper sysDictionaryMapper;
42
+
43
+    @Override
44
+    public ResponseBean addBanner(ToBanner banner,Integer currentUserId) {
45
+
46
+        ResponseBean response = new ResponseBean();
47
+        if (!Constant.BANNER_TYPE_ARTICLE.equals(banner.getBannerType())) {
48
+            if (StringUtils.isBlank(banner.getBannerContent())) {
49
+                response.addError("Banner内容不能为空");
50
+                return response;
51
+            }
52
+        }
53
+
54
+        Date effTime = banner.getEffTime();
55
+        Date currentDate = new Date();
56
+        if (effTime.getTime() < currentDate.getTime()) {
57
+            response.addError("生效时间不能小于当前时间!");
58
+            return response;
59
+        }
60
+
61
+        Date expTime = banner.getExpTime();
62
+        if (expTime.getTime() <= effTime.getTime()) {
63
+            response.addError("失效时间不能小于生效时间!");
64
+            return response;
65
+        }
66
+
67
+        ToUser toUser = toUserMapper.selectByPrimaryKey(currentUserId);
68
+
69
+        banner.setCreateDate(new Date());
70
+        banner.setCreateUser(toUser.getId());
71
+        banner.setUpdateDate(new Date());
72
+        banner.setUpdateUser(toUser.getId());
73
+
74
+        int result = toBannerMapper.insertSelective(banner);
75
+        if (result > 0) {
76
+            response.addSuccess("添加成功!");
77
+        }
78
+
79
+        return response;
80
+    }
81
+
82
+
83
+    @Override
84
+    public ResponseBean getById(Integer bannerId) {
85
+
86
+        ResponseBean response = new ResponseBean();
87
+        ToBanner toBanner = toBannerMapper.selectByPrimaryKey(bannerId);
88
+
89
+        response.addSuccess(toBanner);
90
+
91
+        return response;
92
+    }
93
+
94
+    @Override
95
+    public ResponseBean modifyBanner(ToBanner banner,Integer currentUserId) {
96
+        ResponseBean response = new ResponseBean();
97
+        if (!Constant.BANNER_TYPE_ARTICLE.equals(banner.getBannerType())) {
98
+            if (StringUtils.isBlank(banner.getBannerContent())) {
99
+                response.addError("Banner内容不能为空");
100
+                return response;
101
+            }
102
+        }
103
+
104
+        Date effTime = banner.getEffTime();
105
+        Date currentDate = new Date();
106
+        if (effTime.getTime() < currentDate.getTime()) {
107
+            response.addError("生效时间不能小于当前时间!");
108
+            return response;
109
+        }
110
+
111
+        Date expTime = banner.getExpTime();
112
+        if (expTime.getTime() <= effTime.getTime()) {
113
+            response.addError("失效时间不能小于生效时间!");
114
+            return response;
115
+        }
116
+
117
+        ToUser toUser = toUserMapper.selectByPrimaryKey(currentUserId);
118
+
119
+        banner.setUpdateDate(new Date());
120
+        banner.setUpdateUser(toUser.getId());
121
+
122
+        int result = toBannerMapper.updateByPrimaryKeySelective(banner);
123
+        if (result > 0) {
124
+            response.addSuccess("修改成功!");
125
+            return response;
126
+        }
127
+
128
+        return response;
129
+    }
130
+
131
+    @Override
132
+    public ResponseBean getBanner(ToBanner banner) {
133
+
134
+        ResponseBean response = new ResponseBean();
135
+
136
+        List<ToBanner> bannerList = toBannerMapper.selectBanner(banner);
137
+        List<ToBannerVO> bannerVOList = bannerList.stream().map(e->{
138
+            ToBannerVO toBannerVO = new ToBannerVO();
139
+            BeanUtils.copyProperties(e,toBannerVO);
140
+
141
+            ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(e.getCommunityId());
142
+            toBannerVO.setCommunityName(toCommunities.getCommunityName());
143
+
144
+            SysDictionary sysDictionary = sysDictionaryMapper.selectByPrimaryKey(e.getBannerPosition());
145
+            toBannerVO.setBannerPositionName(sysDictionary.getName());
146
+
147
+            ToUser toUser = toUserMapper.selectByPrimaryKey(e.getUpdateUser());
148
+            toBannerVO.setUpdateUserName(toUser.getUserName());
149
+
150
+            return toBannerVO;
151
+
152
+        }).collect(Collectors.toList());
153
+
154
+        response.addSuccess(bannerVOList);
155
+
156
+        return response;
157
+    }
158
+}

+ 55
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/service/impl/ToUserServerImpl.java Прегледај датотеку

@@ -0,0 +1,55 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.commom.utils.AccountValidatorUtil;
5
+import com.community.huiju.common.code.cache.AppkeyCache;
6
+import com.community.huiju.dao.ToUserMapper;
7
+import com.community.huiju.model.ToUser;
8
+import com.community.huiju.service.IToUserService;
9
+import com.community.huiju.vo.ToUserVO;
10
+import lombok.extern.slf4j.Slf4j;
11
+import org.apache.commons.lang.StringUtils;
12
+import org.springframework.beans.BeanUtils;
13
+import org.springframework.beans.factory.annotation.Autowired;
14
+import org.springframework.stereotype.Service;
15
+
16
+@Service("iToUserServer")
17
+@Slf4j
18
+public class ToUserServerImpl implements IToUserService {
19
+
20
+    @Autowired
21
+    private ToUserMapper toUserMapper;
22
+
23
+    @Override
24
+    public ResponseBean login(String loginName, String code) {
25
+
26
+        ResponseBean response = new ResponseBean();
27
+        String phoneCode = (String) AppkeyCache.getCache(loginName);
28
+        if (!phoneCode.equals(code)) {
29
+            response.addError("验证码错误!");
30
+            return response;
31
+        }
32
+        // 设置验证码为null字符
33
+        AppkeyCache.setCache(loginName,"null");
34
+        log.info("{} 手机号校验结果: {}",loginName,AccountValidatorUtil.isPhone(loginName));
35
+        if (!AccountValidatorUtil.isPhone(loginName)){
36
+            response.addError("请输入正取的手机号!");
37
+            return response;
38
+        }
39
+        if (StringUtils.isBlank(code)) {
40
+            response.addError("请输入验证码!");
41
+            return response;
42
+        }
43
+
44
+        ToUser currentUser = toUserMapper.selectByLoginName(loginName);
45
+        if (null == currentUser) {
46
+            response.addError("用户不存在!");
47
+            return response;
48
+        }
49
+
50
+        ToUserVO userVO = new ToUserVO();
51
+        BeanUtils.copyProperties(currentUser,userVO);
52
+        response.addSuccess(userVO);
53
+        return response;
54
+    }
55
+}

+ 55
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToBannerVO.java Прегледај датотеку

@@ -0,0 +1,55 @@
1
+package com.community.huiju.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import javax.validation.constraints.Min;
8
+import javax.validation.constraints.NotBlank;
9
+import java.util.Date;
10
+
11
+/**
12
+ * @author weiximei
13
+ */
14
+@Data
15
+@AllArgsConstructor
16
+@NoArgsConstructor
17
+public class ToBannerVO {
18
+
19
+    /** 编号 **/
20
+    private Integer id;
21
+
22
+    /** 标题 **/
23
+    private String title;
24
+
25
+    /** 社区编号 **/
26
+    private Integer communityId;
27
+
28
+    /** 社区名称 **/
29
+    private String communityName;
30
+
31
+    /** 权重 **/
32
+    private Integer sort;
33
+
34
+    /** banner 位 **/
35
+    private Integer bannerPosition;
36
+
37
+    /** banner 位 的名称 **/
38
+    private String bannerPositionName;
39
+
40
+    /** 生效时间 **/
41
+    private Date effTime;
42
+
43
+    /** 失效时间 **/
44
+    private Date expTime;
45
+
46
+    /** banner 类型 **/
47
+    private String bannerType;
48
+
49
+    /** 修改时间 **/
50
+    private Date updateDate;
51
+
52
+    /** 修改人 **/
53
+    private String updateUserName;
54
+
55
+}

+ 52
- 0
CODE/smart-community/operate-api/src/main/java/com/community/huiju/vo/ToUserVO.java Прегледај датотеку

@@ -0,0 +1,52 @@
1
+package com.community.huiju.vo;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+
7
+import java.util.Date;
8
+
9
+/**
10
+ * @author weiximei
11
+ */
12
+@Data
13
+@AllArgsConstructor
14
+@NoArgsConstructor
15
+public class ToUserVO {
16
+
17
+    private Integer id;
18
+
19
+    /** 用户名称 **/
20
+    private String userName;
21
+
22
+    /** 登陆账号 **/
23
+    private String loginName;
24
+
25
+    /** 邮箱 **/
26
+    private String email;
27
+
28
+    /** 头像 **/
29
+    private String headPortrait;
30
+
31
+    /** 备注 **/
32
+    private String remark;
33
+
34
+    /** 状态 **/
35
+    private String status;
36
+
37
+    /** 创建人 **/
38
+    private Integer createUser;
39
+
40
+    /** 创建时间 **/
41
+    private Date createDate;
42
+
43
+    /** 更新人 **/
44
+    private Integer updateUser;
45
+
46
+    /** 更新时间 **/
47
+    private Date updateDate;
48
+
49
+    /** 用户token **/
50
+    private String token;
51
+
52
+}

+ 13
- 8
CODE/smart-community/operate-api/src/main/resources/application.yml Прегледај датотеку

@@ -5,12 +5,17 @@ management:
5 5
         include: refresh,health,info
6 6
 ## Mybatis
7 7
 mybatis:
8
-  typeAliasesPackage: com.example.huiju.model
8
+  typeAliasesPackage: com.community.huiju.model
9 9
   mapperLocations: classpath:mapper/*.xml
10
-
11
-## ribbon feign
12
-ribbon:
13
-  ConnectTimeout: 500
14
-  ReadTimeout: 5000
15
-  MaxAutoRetriesNextServer: 2
16
-  MaxAutoRetries: 1
10
+  configuration:
11
+    call-setters-on-nulls: true
12
+# 分页配置
13
+pagehelper:
14
+  helper-dialect: mysql
15
+  reasonable: true
16
+  support-methods-arguments: true
17
+  params: count=countSql
18
+# 打印sql
19
+logging:
20
+  level:
21
+    com.community.huiju.dao: debug

+ 1
- 7
CODE/smart-community/operate-api/src/main/resources/bootstrap.yml Прегледај датотеку

@@ -2,23 +2,17 @@ server:
2 2
   port: 8083
3 3
 spring:
4 4
   application:
5
-    name: eureka-client1
5
+    name: operate-api
6 6
   cloud:
7 7
     config:
8 8
       name: application
9 9
       profile: dev
10 10
       label: master
11
-#      uri: http://localhost:7001/
12 11
       discovery:
13 12
         enabled: true
14 13
         serviceId: config-server
15 14
   session:
16 15
     store-type: jdbc
17
-  datasource:
18
-    url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/smart_community?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
19
-    username: root
20
-    password: DQ@0lW##kBb2+-jPZC1s$Ma0h5$9W((q
21
-    driver-class-name: com.mysql.jdbc.Driver
22 16
 eureka:
23 17
   client:
24 18
     service-url:

+ 0
- 16
CODE/smart-community/operate-api/src/main/resources/mapper/ScUserMapper.xml Прегледај датотеку

@@ -1,16 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8"?>
2
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
-<mapper namespace="ScUserMapper">
4
-
5
-    <parameterMap id="paramMap" type="ScUser"></parameterMap>
6
-
7
-    <resultMap id="resultMap" type="ScUser">
8
-        <id property="id" column="id"/>
9
-        <result property="userName" column="user_name"/>
10
-        <result property="userPassword" column="user_password"/>
11
-    </resultMap>
12
-
13
-    <select id="find" resultMap="resultMap">
14
-        select * from sc_user
15
-    </select>
16
-</mapper>

+ 93
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/SysDictionaryMapper.xml Прегледај датотеку

@@ -0,0 +1,93 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.SysDictionaryMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.SysDictionary" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="code" property="code" jdbcType="VARCHAR" />
7
+    <result column="name" property="name" jdbcType="VARCHAR" />
8
+    <result column="group_id" property="groupId" jdbcType="VARCHAR" />
9
+    <result column="sort" property="sort" jdbcType="INTEGER" />
10
+  </resultMap>
11
+  <sql id="Base_Column_List" >
12
+    id, code, name, group_id, sort
13
+  </sql>
14
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
15
+    select 
16
+    <include refid="Base_Column_List" />
17
+    from sys_dictionary
18
+    where id = #{id,jdbcType=INTEGER}
19
+  </select>
20
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
21
+    delete from sys_dictionary
22
+    where id = #{id,jdbcType=INTEGER}
23
+  </delete>
24
+  <insert id="insert" parameterType="com.community.huiju.model.SysDictionary" >
25
+    insert into sys_dictionary (id, code, name, 
26
+      group_id, sort)
27
+    values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
28
+      #{groupId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER})
29
+  </insert>
30
+  <insert id="insertSelective" parameterType="com.community.huiju.model.SysDictionary" >
31
+    insert into sys_dictionary
32
+    <trim prefix="(" suffix=")" suffixOverrides="," >
33
+      <if test="id != null" >
34
+        id,
35
+      </if>
36
+      <if test="code != null" >
37
+        code,
38
+      </if>
39
+      <if test="name != null" >
40
+        name,
41
+      </if>
42
+      <if test="groupId != null" >
43
+        group_id,
44
+      </if>
45
+      <if test="sort != null" >
46
+        sort,
47
+      </if>
48
+    </trim>
49
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
50
+      <if test="id != null" >
51
+        #{id,jdbcType=INTEGER},
52
+      </if>
53
+      <if test="code != null" >
54
+        #{code,jdbcType=VARCHAR},
55
+      </if>
56
+      <if test="name != null" >
57
+        #{name,jdbcType=VARCHAR},
58
+      </if>
59
+      <if test="groupId != null" >
60
+        #{groupId,jdbcType=VARCHAR},
61
+      </if>
62
+      <if test="sort != null" >
63
+        #{sort,jdbcType=INTEGER},
64
+      </if>
65
+    </trim>
66
+  </insert>
67
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.SysDictionary" >
68
+    update sys_dictionary
69
+    <set >
70
+      <if test="code != null" >
71
+        code = #{code,jdbcType=VARCHAR},
72
+      </if>
73
+      <if test="name != null" >
74
+        name = #{name,jdbcType=VARCHAR},
75
+      </if>
76
+      <if test="groupId != null" >
77
+        group_id = #{groupId,jdbcType=VARCHAR},
78
+      </if>
79
+      <if test="sort != null" >
80
+        sort = #{sort,jdbcType=INTEGER},
81
+      </if>
82
+    </set>
83
+    where id = #{id,jdbcType=INTEGER}
84
+  </update>
85
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.SysDictionary" >
86
+    update sys_dictionary
87
+    set code = #{code,jdbcType=VARCHAR},
88
+      name = #{name,jdbcType=VARCHAR},
89
+      group_id = #{groupId,jdbcType=VARCHAR},
90
+      sort = #{sort,jdbcType=INTEGER}
91
+    where id = #{id,jdbcType=INTEGER}
92
+  </update>
93
+</mapper>

+ 280
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml Прегледај датотеку

@@ -0,0 +1,280 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToBannerMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToBanner" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="title" property="title" jdbcType="VARCHAR" />
8
+    <result column="banner_description" property="bannerDescription" jdbcType="VARCHAR" />
9
+    <result column="sort" property="sort" jdbcType="INTEGER" />
10
+    <result column="banner_cover" property="bannerCover" jdbcType="VARCHAR" />
11
+    <result column="banner_position" property="bannerPosition" jdbcType="INTEGER" />
12
+    <result column="eff_time" property="effTime" jdbcType="TIMESTAMP" />
13
+    <result column="exp_time" property="expTime" jdbcType="TIMESTAMP" />
14
+    <result column="banner_type" property="bannerType" jdbcType="CHAR" />
15
+    <result column="external_link" property="externalLink" jdbcType="VARCHAR" />
16
+    <result column="banner_title" property="bannerTitle" jdbcType="VARCHAR" />
17
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
18
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
19
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
20
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
21
+  </resultMap>
22
+  <resultMap id="ResultMapWithBLOBs" type="com.community.huiju.model.ToBanner" extends="BaseResultMap" >
23
+    <result column="banner_content" property="bannerContent" jdbcType="LONGVARCHAR" />
24
+  </resultMap>
25
+  <sql id="Base_Column_List" >
26
+    id, community_id, title, banner_description, sort, banner_cover, banner_position,
27
+    eff_time, exp_time, banner_type, external_link, banner_title, create_user, create_date,
28
+    update_user, update_date
29
+  </sql>
30
+  <sql id="Blob_Column_List" >
31
+    banner_content
32
+  </sql>
33
+  <select id="selectByPrimaryKey" resultMap="ResultMapWithBLOBs" parameterType="java.lang.Integer" >
34
+    select
35
+    <include refid="Base_Column_List" />
36
+    ,
37
+    <include refid="Blob_Column_List" />
38
+    from to_banner
39
+    where id = #{id,jdbcType=INTEGER}
40
+  </select>
41
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
42
+    delete from to_banner
43
+    where id = #{id,jdbcType=INTEGER}
44
+  </delete>
45
+  <insert id="insert" parameterType="com.community.huiju.model.ToBanner" >
46
+    insert into to_banner (id, community_id, title,
47
+      banner_description, sort, banner_cover,
48
+      banner_position, eff_time, exp_time,
49
+      banner_type, external_link, banner_title,
50
+      create_user, create_date, update_user,
51
+      update_date, banner_content)
52
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
53
+      #{bannerDescription,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{bannerCover,jdbcType=VARCHAR},
54
+      #{bannerPosition,jdbcType=INTEGER}, #{effTime,jdbcType=TIMESTAMP}, #{expTime,jdbcType=TIMESTAMP},
55
+      #{bannerType,jdbcType=CHAR}, #{externalLink,jdbcType=VARCHAR}, #{bannerTitle,jdbcType=VARCHAR},
56
+      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
57
+      #{updateDate,jdbcType=TIMESTAMP}, #{bannerContent,jdbcType=LONGVARCHAR})
58
+  </insert>
59
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToBanner" >
60
+    insert into to_banner
61
+    <trim prefix="(" suffix=")" suffixOverrides="," >
62
+      <if test="id != null" >
63
+        id,
64
+      </if>
65
+      <if test="communityId != null" >
66
+        community_id,
67
+      </if>
68
+      <if test="title != null" >
69
+        title,
70
+      </if>
71
+      <if test="bannerDescription != null" >
72
+        banner_description,
73
+      </if>
74
+      <if test="sort != null" >
75
+        sort,
76
+      </if>
77
+      <if test="bannerCover != null" >
78
+        banner_cover,
79
+      </if>
80
+      <if test="bannerPosition != null" >
81
+        banner_position,
82
+      </if>
83
+      <if test="effTime != null" >
84
+        eff_time,
85
+      </if>
86
+      <if test="expTime != null" >
87
+        exp_time,
88
+      </if>
89
+      <if test="bannerType != null" >
90
+        banner_type,
91
+      </if>
92
+      <if test="externalLink != null" >
93
+        external_link,
94
+      </if>
95
+      <if test="bannerTitle != null" >
96
+        banner_title,
97
+      </if>
98
+      <if test="createUser != null" >
99
+        create_user,
100
+      </if>
101
+      <if test="createDate != null" >
102
+        create_date,
103
+      </if>
104
+      <if test="updateUser != null" >
105
+        update_user,
106
+      </if>
107
+      <if test="updateDate != null" >
108
+        update_date,
109
+      </if>
110
+      <if test="bannerContent != null" >
111
+        banner_content,
112
+      </if>
113
+    </trim>
114
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
115
+      <if test="id != null" >
116
+        #{id,jdbcType=INTEGER},
117
+      </if>
118
+      <if test="communityId != null" >
119
+        #{communityId,jdbcType=INTEGER},
120
+      </if>
121
+      <if test="title != null" >
122
+        #{title,jdbcType=VARCHAR},
123
+      </if>
124
+      <if test="bannerDescription != null" >
125
+        #{bannerDescription,jdbcType=VARCHAR},
126
+      </if>
127
+      <if test="sort != null" >
128
+        #{sort,jdbcType=INTEGER},
129
+      </if>
130
+      <if test="bannerCover != null" >
131
+        #{bannerCover,jdbcType=VARCHAR},
132
+      </if>
133
+      <if test="bannerPosition != null" >
134
+        #{bannerPosition,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="effTime != null" >
137
+        #{effTime,jdbcType=TIMESTAMP},
138
+      </if>
139
+      <if test="expTime != null" >
140
+        #{expTime,jdbcType=TIMESTAMP},
141
+      </if>
142
+      <if test="bannerType != null" >
143
+        #{bannerType,jdbcType=CHAR},
144
+      </if>
145
+      <if test="externalLink != null" >
146
+        #{externalLink,jdbcType=VARCHAR},
147
+      </if>
148
+      <if test="bannerTitle != null" >
149
+        #{bannerTitle,jdbcType=VARCHAR},
150
+      </if>
151
+      <if test="createUser != null" >
152
+        #{createUser,jdbcType=INTEGER},
153
+      </if>
154
+      <if test="createDate != null" >
155
+        #{createDate,jdbcType=TIMESTAMP},
156
+      </if>
157
+      <if test="updateUser != null" >
158
+        #{updateUser,jdbcType=INTEGER},
159
+      </if>
160
+      <if test="updateDate != null" >
161
+        #{updateDate,jdbcType=TIMESTAMP},
162
+      </if>
163
+      <if test="bannerContent != null" >
164
+        #{bannerContent,jdbcType=LONGVARCHAR},
165
+      </if>
166
+    </trim>
167
+  </insert>
168
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToBanner" >
169
+    update to_banner
170
+    <set >
171
+      <if test="communityId != null" >
172
+        community_id = #{communityId,jdbcType=INTEGER},
173
+      </if>
174
+      <if test="title != null" >
175
+        title = #{title,jdbcType=VARCHAR},
176
+      </if>
177
+      <if test="bannerDescription != null" >
178
+        banner_description = #{bannerDescription,jdbcType=VARCHAR},
179
+      </if>
180
+      <if test="sort != null" >
181
+        sort = #{sort,jdbcType=INTEGER},
182
+      </if>
183
+      <if test="bannerCover != null" >
184
+        banner_cover = #{bannerCover,jdbcType=VARCHAR},
185
+      </if>
186
+      <if test="bannerPosition != null" >
187
+        banner_position = #{bannerPosition,jdbcType=INTEGER},
188
+      </if>
189
+      <if test="effTime != null" >
190
+        eff_time = #{effTime,jdbcType=TIMESTAMP},
191
+      </if>
192
+      <if test="expTime != null" >
193
+        exp_time = #{expTime,jdbcType=TIMESTAMP},
194
+      </if>
195
+      <if test="bannerType != null" >
196
+        banner_type = #{bannerType,jdbcType=CHAR},
197
+      </if>
198
+      <if test="externalLink != null" >
199
+        external_link = #{externalLink,jdbcType=VARCHAR},
200
+      </if>
201
+      <if test="bannerTitle != null" >
202
+        banner_title = #{bannerTitle,jdbcType=VARCHAR},
203
+      </if>
204
+      <if test="createUser != null" >
205
+        create_user = #{createUser,jdbcType=INTEGER},
206
+      </if>
207
+      <if test="createDate != null" >
208
+        create_date = #{createDate,jdbcType=TIMESTAMP},
209
+      </if>
210
+      <if test="updateUser != null" >
211
+        update_user = #{updateUser,jdbcType=INTEGER},
212
+      </if>
213
+      <if test="updateDate != null" >
214
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
215
+      </if>
216
+      <if test="bannerContent != null" >
217
+        banner_content = #{bannerContent,jdbcType=LONGVARCHAR},
218
+      </if>
219
+    </set>
220
+    where id = #{id,jdbcType=INTEGER}
221
+  </update>
222
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.community.huiju.model.ToBanner" >
223
+    update to_banner
224
+    set community_id = #{communityId,jdbcType=INTEGER},
225
+      title = #{title,jdbcType=VARCHAR},
226
+      banner_description = #{bannerDescription,jdbcType=VARCHAR},
227
+      sort = #{sort,jdbcType=INTEGER},
228
+      banner_cover = #{bannerCover,jdbcType=VARCHAR},
229
+      banner_position = #{bannerPosition,jdbcType=INTEGER},
230
+      eff_time = #{effTime,jdbcType=TIMESTAMP},
231
+      exp_time = #{expTime,jdbcType=TIMESTAMP},
232
+      banner_type = #{bannerType,jdbcType=CHAR},
233
+      external_link = #{externalLink,jdbcType=VARCHAR},
234
+      banner_title = #{bannerTitle,jdbcType=VARCHAR},
235
+      create_user = #{createUser,jdbcType=INTEGER},
236
+      create_date = #{createDate,jdbcType=TIMESTAMP},
237
+      update_user = #{updateUser,jdbcType=INTEGER},
238
+      update_date = #{updateDate,jdbcType=TIMESTAMP},
239
+      banner_content = #{bannerContent,jdbcType=LONGVARCHAR}
240
+    where id = #{id,jdbcType=INTEGER}
241
+  </update>
242
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToBanner" >
243
+    update to_banner
244
+    set community_id = #{communityId,jdbcType=INTEGER},
245
+      title = #{title,jdbcType=VARCHAR},
246
+      banner_description = #{bannerDescription,jdbcType=VARCHAR},
247
+      sort = #{sort,jdbcType=INTEGER},
248
+      banner_cover = #{bannerCover,jdbcType=VARCHAR},
249
+      banner_position = #{bannerPosition,jdbcType=INTEGER},
250
+      eff_time = #{effTime,jdbcType=TIMESTAMP},
251
+      exp_time = #{expTime,jdbcType=TIMESTAMP},
252
+      banner_type = #{bannerType,jdbcType=CHAR},
253
+      external_link = #{externalLink,jdbcType=VARCHAR},
254
+      banner_title = #{bannerTitle,jdbcType=VARCHAR},
255
+      create_user = #{createUser,jdbcType=INTEGER},
256
+      create_date = #{createDate,jdbcType=TIMESTAMP},
257
+      update_user = #{updateUser,jdbcType=INTEGER},
258
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
259
+    where id = #{id,jdbcType=INTEGER}
260
+  </update>
261
+
262
+  <select id="selectBanner" parameterType="com.community.huiju.model.ToBanner" resultMap="BaseResultMap" >
263
+    select
264
+    <include refid="Base_Column_List" />
265
+    ,
266
+    <include refid="Blob_Column_List" />
267
+    from to_banner
268
+    <trim prefix="where" prefixOverrides="and">
269
+      <if test="title != null">
270
+       and title = #{title,jdbcType=VARCHAR}
271
+      </if>
272
+      <if test="bannerDescription != null">
273
+       and banner_description = #{bannerDescription,jdbcType=VARCHAR}
274
+      </if>
275
+      <if test="bannerPosition != null">
276
+       and banner_position = #{bannerPosition,jdbcType=INTEGER}
277
+      </if>
278
+    </trim>
279
+  </select>
280
+</mapper>

+ 165
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToCommunitiesMapper.xml Прегледај датотеку

@@ -0,0 +1,165 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToCommunitiesMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToCommunities" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_name" property="communityName" jdbcType="VARCHAR" />
7
+    <result column="community_alias" property="communityAlias" jdbcType="VARCHAR" />
8
+    <result column="province_id" property="provinceId" jdbcType="INTEGER" />
9
+    <result column="city_id" property="cityId" jdbcType="INTEGER" />
10
+    <result column="district_id" property="districtId" jdbcType="INTEGER" />
11
+    <result column="longitude" property="longitude" jdbcType="VARCHAR" />
12
+    <result column="latitude" property="latitude" jdbcType="VARCHAR" />
13
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
14
+    <result column="login_name" property="loginName" jdbcType="VARCHAR" />
15
+  </resultMap>
16
+  <sql id="Base_Column_List" >
17
+    id, community_name, community_alias, province_id, city_id, district_id, longitude, 
18
+    latitude,user_name,login_name
19
+  </sql>
20
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
21
+    select 
22
+    <include refid="Base_Column_List" />
23
+    from to_communities
24
+    where id = #{id,jdbcType=INTEGER}
25
+  </select>
26
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
27
+    delete from to_communities
28
+    where id = #{id,jdbcType=INTEGER}
29
+  </delete>
30
+  <insert id="insert" parameterType="com.community.huiju.model.ToCommunities" >
31
+    insert into to_communities (id, community_name, community_alias, 
32
+      province_id, city_id, district_id, 
33
+      longitude, latitude)
34
+    values (#{id,jdbcType=INTEGER}, #{communityName,jdbcType=VARCHAR}, #{communityAlias,jdbcType=VARCHAR}, 
35
+      #{provinceId,jdbcType=INTEGER}, #{cityId,jdbcType=INTEGER}, #{districtId,jdbcType=INTEGER}, 
36
+      #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR})
37
+  </insert>
38
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToCommunities" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
39
+    insert into to_communities
40
+    <trim prefix="(" suffix=")" suffixOverrides="," >
41
+      <if test="id != null" >
42
+        id,
43
+      </if>
44
+      <if test="communityName != null" >
45
+        community_name,
46
+      </if>
47
+      <if test="communityAlias != null" >
48
+        community_alias,
49
+      </if>
50
+      <if test="provinceId != null" >
51
+        province_id,
52
+      </if>
53
+      <if test="cityId != null" >
54
+        city_id,
55
+      </if>
56
+      <if test="districtId != null" >
57
+        district_id,
58
+      </if>
59
+      <if test="longitude != null" >
60
+        longitude,
61
+      </if>
62
+      <if test="latitude != null" >
63
+        latitude,
64
+      </if>
65
+      <if test="userName != null" >
66
+        user_name,
67
+      </if>
68
+      <if test="loginName != null" >
69
+        login_name,
70
+      </if>
71
+    </trim>
72
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
73
+      <if test="id != null" >
74
+        #{id,jdbcType=INTEGER},
75
+      </if>
76
+      <if test="communityName != null" >
77
+        #{communityName,jdbcType=VARCHAR},
78
+      </if>
79
+      <if test="communityAlias != null" >
80
+        #{communityAlias,jdbcType=VARCHAR},
81
+      </if>
82
+      <if test="provinceId != null" >
83
+        #{provinceId,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="cityId != null" >
86
+        #{cityId,jdbcType=INTEGER},
87
+      </if>
88
+      <if test="districtId != null" >
89
+        #{districtId,jdbcType=INTEGER},
90
+      </if>
91
+      <if test="longitude != null" >
92
+        #{longitude,jdbcType=VARCHAR},
93
+      </if>
94
+      <if test="latitude != null" >
95
+        #{latitude,jdbcType=VARCHAR},
96
+      </if>
97
+      <if test="userName != null" >
98
+        #{userName,jdbcType=VARCHAR},
99
+      </if>
100
+      <if test="loginName != null" >
101
+        #{loginName,jdbcType=VARCHAR},
102
+      </if>
103
+    </trim>
104
+  </insert>
105
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToCommunities" >
106
+    update to_communities
107
+    <set >
108
+      <if test="communityName != null" >
109
+        community_name = #{communityName,jdbcType=VARCHAR},
110
+      </if>
111
+      <if test="communityAlias != null" >
112
+        community_alias = #{communityAlias,jdbcType=VARCHAR},
113
+      </if>
114
+      <if test="provinceId != null" >
115
+        province_id = #{provinceId,jdbcType=INTEGER},
116
+      </if>
117
+      <if test="cityId != null" >
118
+        city_id = #{cityId,jdbcType=INTEGER},
119
+      </if>
120
+      <if test="districtId != null" >
121
+        district_id = #{districtId,jdbcType=INTEGER},
122
+      </if>
123
+      <if test="longitude != null" >
124
+        longitude = #{longitude,jdbcType=VARCHAR},
125
+      </if>
126
+      <if test="latitude != null" >
127
+        latitude = #{latitude,jdbcType=VARCHAR},
128
+      </if>
129
+    </set>
130
+    where id = #{id,jdbcType=INTEGER}
131
+  </update>
132
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToCommunities" >
133
+    update to_communities
134
+    set community_name = #{communityName,jdbcType=VARCHAR},
135
+      community_alias = #{communityAlias,jdbcType=VARCHAR},
136
+      province_id = #{provinceId,jdbcType=INTEGER},
137
+      city_id = #{cityId,jdbcType=INTEGER},
138
+      district_id = #{districtId,jdbcType=INTEGER},
139
+      longitude = #{longitude,jdbcType=VARCHAR},
140
+      latitude = #{latitude,jdbcType=VARCHAR}
141
+    where id = #{id,jdbcType=INTEGER}
142
+  </update>
143
+
144
+  <select id="selectByCommunityName" resultMap="BaseResultMap" parameterType="com.community.huiju.model.ToCommunities" >
145
+    select
146
+    <include refid="Base_Column_List" />
147
+    from to_communities
148
+    where 1=1
149
+    <if test="communityName != null and communityName != ''" >
150
+      and community_name like concat('%',#{communityName,jdbcType=VARCHAR},'%')
151
+    </if>
152
+    <if test="id != null and id != ''" >
153
+      and id = #{id,jdbcType=INTEGER}
154
+    </if>
155
+    <if test="provinceId != null and provinceId != ''" >
156
+      and province_id = #{provinceId,jdbcType=INTEGER}
157
+    </if>
158
+    <if test="cityId != null and cityId != ''" >
159
+      and city_id = #{cityId,jdbcType=INTEGER}
160
+    </if>
161
+    <if test="districtId != null and districtId != ''" >
162
+      and district_id = #{districtId,jdbcType=INTEGER}
163
+    </if>
164
+  </select>
165
+</mapper>

+ 128
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToSysMenuMapper.xml Прегледај датотеку

@@ -0,0 +1,128 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToSysMenuMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToSysMenu" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="menu_name" property="menuName" jdbcType="VARCHAR" />
7
+    <result column="menu_url" property="menuUrl" jdbcType="VARCHAR" />
8
+    <result column="menu_icon" property="menuIcon" jdbcType="VARCHAR" />
9
+    <result column="parent_id" property="parentId" jdbcType="INTEGER" />
10
+    <result column="sort" property="sort" jdbcType="INTEGER" />
11
+    <result column="menu_type" property="menuType" jdbcType="CHAR" />
12
+    <result column="status" property="status" jdbcType="CHAR" />
13
+  </resultMap>
14
+  <sql id="Base_Column_List" >
15
+    id, menu_name, menu_url, menu_icon, parent_id, sort, menu_type, status
16
+  </sql>
17
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
18
+    select 
19
+    <include refid="Base_Column_List" />
20
+    from to_sys_menu
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </select>
23
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
24
+    delete from to_sys_menu
25
+    where id = #{id,jdbcType=INTEGER}
26
+  </delete>
27
+  <insert id="insert" parameterType="com.community.huiju.model.ToSysMenu" >
28
+    insert into to_sys_menu (id, menu_name, menu_url, 
29
+      menu_icon, parent_id, sort, 
30
+      menu_type, status)
31
+    values (#{id,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{menuUrl,jdbcType=VARCHAR}, 
32
+      #{menuIcon,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, 
33
+      #{menuType,jdbcType=CHAR}, #{status,jdbcType=CHAR})
34
+  </insert>
35
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToSysMenu" >
36
+    insert into to_sys_menu
37
+    <trim prefix="(" suffix=")" suffixOverrides="," >
38
+      <if test="id != null" >
39
+        id,
40
+      </if>
41
+      <if test="menuName != null" >
42
+        menu_name,
43
+      </if>
44
+      <if test="menuUrl != null" >
45
+        menu_url,
46
+      </if>
47
+      <if test="menuIcon != null" >
48
+        menu_icon,
49
+      </if>
50
+      <if test="parentId != null" >
51
+        parent_id,
52
+      </if>
53
+      <if test="sort != null" >
54
+        sort,
55
+      </if>
56
+      <if test="menuType != null" >
57
+        menu_type,
58
+      </if>
59
+      <if test="status != null" >
60
+        status,
61
+      </if>
62
+    </trim>
63
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
64
+      <if test="id != null" >
65
+        #{id,jdbcType=INTEGER},
66
+      </if>
67
+      <if test="menuName != null" >
68
+        #{menuName,jdbcType=VARCHAR},
69
+      </if>
70
+      <if test="menuUrl != null" >
71
+        #{menuUrl,jdbcType=VARCHAR},
72
+      </if>
73
+      <if test="menuIcon != null" >
74
+        #{menuIcon,jdbcType=VARCHAR},
75
+      </if>
76
+      <if test="parentId != null" >
77
+        #{parentId,jdbcType=INTEGER},
78
+      </if>
79
+      <if test="sort != null" >
80
+        #{sort,jdbcType=INTEGER},
81
+      </if>
82
+      <if test="menuType != null" >
83
+        #{menuType,jdbcType=CHAR},
84
+      </if>
85
+      <if test="status != null" >
86
+        #{status,jdbcType=CHAR},
87
+      </if>
88
+    </trim>
89
+  </insert>
90
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToSysMenu" >
91
+    update to_sys_menu
92
+    <set >
93
+      <if test="menuName != null" >
94
+        menu_name = #{menuName,jdbcType=VARCHAR},
95
+      </if>
96
+      <if test="menuUrl != null" >
97
+        menu_url = #{menuUrl,jdbcType=VARCHAR},
98
+      </if>
99
+      <if test="menuIcon != null" >
100
+        menu_icon = #{menuIcon,jdbcType=VARCHAR},
101
+      </if>
102
+      <if test="parentId != null" >
103
+        parent_id = #{parentId,jdbcType=INTEGER},
104
+      </if>
105
+      <if test="sort != null" >
106
+        sort = #{sort,jdbcType=INTEGER},
107
+      </if>
108
+      <if test="menuType != null" >
109
+        menu_type = #{menuType,jdbcType=CHAR},
110
+      </if>
111
+      <if test="status != null" >
112
+        status = #{status,jdbcType=CHAR},
113
+      </if>
114
+    </set>
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToSysMenu" >
118
+    update to_sys_menu
119
+    set menu_name = #{menuName,jdbcType=VARCHAR},
120
+      menu_url = #{menuUrl,jdbcType=VARCHAR},
121
+      menu_icon = #{menuIcon,jdbcType=VARCHAR},
122
+      parent_id = #{parentId,jdbcType=INTEGER},
123
+      sort = #{sort,jdbcType=INTEGER},
124
+      menu_type = #{menuType,jdbcType=CHAR},
125
+      status = #{status,jdbcType=CHAR}
126
+    where id = #{id,jdbcType=INTEGER}
127
+  </update>
128
+</mapper>

+ 128
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMapper.xml Прегледај датотеку

@@ -0,0 +1,128 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToSysRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToSysRole" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="role_name" property="roleName" jdbcType="VARCHAR" />
7
+    <result column="description" property="description" jdbcType="VARCHAR" />
8
+    <result column="status" property="status" jdbcType="CHAR" />
9
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
10
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
11
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
12
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
13
+  </resultMap>
14
+  <sql id="Base_Column_List" >
15
+    id, role_name, description, status, create_user, create_date, update_user, update_date
16
+  </sql>
17
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
18
+    select 
19
+    <include refid="Base_Column_List" />
20
+    from to_sys_role
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </select>
23
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
24
+    delete from to_sys_role
25
+    where id = #{id,jdbcType=INTEGER}
26
+  </delete>
27
+  <insert id="insert" parameterType="com.community.huiju.model.ToSysRole" >
28
+    insert into to_sys_role (id, role_name, description, 
29
+      status, create_user, create_date, 
30
+      update_user, update_date)
31
+    values (#{id,jdbcType=INTEGER}, #{roleName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, 
32
+      #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
33
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
34
+  </insert>
35
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToSysRole" >
36
+    insert into to_sys_role
37
+    <trim prefix="(" suffix=")" suffixOverrides="," >
38
+      <if test="id != null" >
39
+        id,
40
+      </if>
41
+      <if test="roleName != null" >
42
+        role_name,
43
+      </if>
44
+      <if test="description != null" >
45
+        description,
46
+      </if>
47
+      <if test="status != null" >
48
+        status,
49
+      </if>
50
+      <if test="createUser != null" >
51
+        create_user,
52
+      </if>
53
+      <if test="createDate != null" >
54
+        create_date,
55
+      </if>
56
+      <if test="updateUser != null" >
57
+        update_user,
58
+      </if>
59
+      <if test="updateDate != null" >
60
+        update_date,
61
+      </if>
62
+    </trim>
63
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
64
+      <if test="id != null" >
65
+        #{id,jdbcType=INTEGER},
66
+      </if>
67
+      <if test="roleName != null" >
68
+        #{roleName,jdbcType=VARCHAR},
69
+      </if>
70
+      <if test="description != null" >
71
+        #{description,jdbcType=VARCHAR},
72
+      </if>
73
+      <if test="status != null" >
74
+        #{status,jdbcType=CHAR},
75
+      </if>
76
+      <if test="createUser != null" >
77
+        #{createUser,jdbcType=INTEGER},
78
+      </if>
79
+      <if test="createDate != null" >
80
+        #{createDate,jdbcType=TIMESTAMP},
81
+      </if>
82
+      <if test="updateUser != null" >
83
+        #{updateUser,jdbcType=INTEGER},
84
+      </if>
85
+      <if test="updateDate != null" >
86
+        #{updateDate,jdbcType=TIMESTAMP},
87
+      </if>
88
+    </trim>
89
+  </insert>
90
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToSysRole" >
91
+    update to_sys_role
92
+    <set >
93
+      <if test="roleName != null" >
94
+        role_name = #{roleName,jdbcType=VARCHAR},
95
+      </if>
96
+      <if test="description != null" >
97
+        description = #{description,jdbcType=VARCHAR},
98
+      </if>
99
+      <if test="status != null" >
100
+        status = #{status,jdbcType=CHAR},
101
+      </if>
102
+      <if test="createUser != null" >
103
+        create_user = #{createUser,jdbcType=INTEGER},
104
+      </if>
105
+      <if test="createDate != null" >
106
+        create_date = #{createDate,jdbcType=TIMESTAMP},
107
+      </if>
108
+      <if test="updateUser != null" >
109
+        update_user = #{updateUser,jdbcType=INTEGER},
110
+      </if>
111
+      <if test="updateDate != null" >
112
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
113
+      </if>
114
+    </set>
115
+    where id = #{id,jdbcType=INTEGER}
116
+  </update>
117
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToSysRole" >
118
+    update to_sys_role
119
+    set role_name = #{roleName,jdbcType=VARCHAR},
120
+      description = #{description,jdbcType=VARCHAR},
121
+      status = #{status,jdbcType=CHAR},
122
+      create_user = #{createUser,jdbcType=INTEGER},
123
+      create_date = #{createDate,jdbcType=TIMESTAMP},
124
+      update_user = #{updateUser,jdbcType=INTEGER},
125
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
126
+    where id = #{id,jdbcType=INTEGER}
127
+  </update>
128
+</mapper>

+ 71
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToSysRoleMenuMapper.xml Прегледај датотеку

@@ -0,0 +1,71 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToSysRoleMenuMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToSysRoleMenu" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="role_id" property="roleId" jdbcType="INTEGER" />
7
+    <result column="menu_id" property="menuId" jdbcType="INTEGER" />
8
+  </resultMap>
9
+  <sql id="Base_Column_List" >
10
+    id, role_id, menu_id
11
+  </sql>
12
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
13
+    select 
14
+    <include refid="Base_Column_List" />
15
+    from to_sys_role_menu
16
+    where id = #{id,jdbcType=INTEGER}
17
+  </select>
18
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
19
+    delete from to_sys_role_menu
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </delete>
22
+  <insert id="insert" parameterType="com.community.huiju.model.ToSysRoleMenu" >
23
+    insert into to_sys_role_menu (id, role_id, menu_id
24
+      )
25
+    values (#{id,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}, #{menuId,jdbcType=INTEGER}
26
+      )
27
+  </insert>
28
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToSysRoleMenu" >
29
+    insert into to_sys_role_menu
30
+    <trim prefix="(" suffix=")" suffixOverrides="," >
31
+      <if test="id != null" >
32
+        id,
33
+      </if>
34
+      <if test="roleId != null" >
35
+        role_id,
36
+      </if>
37
+      <if test="menuId != null" >
38
+        menu_id,
39
+      </if>
40
+    </trim>
41
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        #{id,jdbcType=INTEGER},
44
+      </if>
45
+      <if test="roleId != null" >
46
+        #{roleId,jdbcType=INTEGER},
47
+      </if>
48
+      <if test="menuId != null" >
49
+        #{menuId,jdbcType=INTEGER},
50
+      </if>
51
+    </trim>
52
+  </insert>
53
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToSysRoleMenu" >
54
+    update to_sys_role_menu
55
+    <set >
56
+      <if test="roleId != null" >
57
+        role_id = #{roleId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="menuId != null" >
60
+        menu_id = #{menuId,jdbcType=INTEGER},
61
+      </if>
62
+    </set>
63
+    where id = #{id,jdbcType=INTEGER}
64
+  </update>
65
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToSysRoleMenu" >
66
+    update to_sys_role_menu
67
+    set role_id = #{roleId,jdbcType=INTEGER},
68
+      menu_id = #{menuId,jdbcType=INTEGER}
69
+    where id = #{id,jdbcType=INTEGER}
70
+  </update>
71
+</mapper>

+ 71
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToSysUserRoleMapper.xml Прегледај датотеку

@@ -0,0 +1,71 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToSysUserRoleMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToSysUserRole" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="user_id" property="userId" jdbcType="INTEGER" />
7
+    <result column="role_id" property="roleId" jdbcType="INTEGER" />
8
+  </resultMap>
9
+  <sql id="Base_Column_List" >
10
+    id, user_id, role_id
11
+  </sql>
12
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
13
+    select 
14
+    <include refid="Base_Column_List" />
15
+    from to_sys_user_role
16
+    where id = #{id,jdbcType=INTEGER}
17
+  </select>
18
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
19
+    delete from to_sys_user_role
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </delete>
22
+  <insert id="insert" parameterType="com.community.huiju.model.ToSysUserRole" >
23
+    insert into to_sys_user_role (id, user_id, role_id
24
+      )
25
+    values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}
26
+      )
27
+  </insert>
28
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToSysUserRole" >
29
+    insert into to_sys_user_role
30
+    <trim prefix="(" suffix=")" suffixOverrides="," >
31
+      <if test="id != null" >
32
+        id,
33
+      </if>
34
+      <if test="userId != null" >
35
+        user_id,
36
+      </if>
37
+      <if test="roleId != null" >
38
+        role_id,
39
+      </if>
40
+    </trim>
41
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        #{id,jdbcType=INTEGER},
44
+      </if>
45
+      <if test="userId != null" >
46
+        #{userId,jdbcType=INTEGER},
47
+      </if>
48
+      <if test="roleId != null" >
49
+        #{roleId,jdbcType=INTEGER},
50
+      </if>
51
+    </trim>
52
+  </insert>
53
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToSysUserRole" >
54
+    update to_sys_user_role
55
+    <set >
56
+      <if test="userId != null" >
57
+        user_id = #{userId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="roleId != null" >
60
+        role_id = #{roleId,jdbcType=INTEGER},
61
+      </if>
62
+    </set>
63
+    where id = #{id,jdbcType=INTEGER}
64
+  </update>
65
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToSysUserRole" >
66
+    update to_sys_user_role
67
+    set user_id = #{userId,jdbcType=INTEGER},
68
+      role_id = #{roleId,jdbcType=INTEGER}
69
+    where id = #{id,jdbcType=INTEGER}
70
+  </update>
71
+</mapper>

+ 184
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/ToUserMapper.xml Прегледај датотеку

@@ -0,0 +1,184 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.ToUserMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.ToUser" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
7
+    <result column="login_name" property="loginName" jdbcType="VARCHAR" />
8
+    <result column="login_password" property="loginPassword" jdbcType="VARCHAR" />
9
+    <result column="email" property="email" jdbcType="VARCHAR" />
10
+    <result column="head_portrait" property="headPortrait" jdbcType="VARCHAR" />
11
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
12
+    <result column="status" property="status" jdbcType="CHAR" />
13
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
14
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
15
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
16
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
17
+  </resultMap>
18
+  <sql id="Base_Column_List" >
19
+    id, user_name, login_name, login_password, email, head_portrait, remark, status, 
20
+    create_user, create_date, update_user, update_date
21
+  </sql>
22
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
23
+    select 
24
+    <include refid="Base_Column_List" />
25
+    from to_user
26
+    where id = #{id,jdbcType=INTEGER}
27
+  </select>
28
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
29
+    delete from to_user
30
+    where id = #{id,jdbcType=INTEGER}
31
+  </delete>
32
+  <insert id="insert" parameterType="com.community.huiju.model.ToUser" >
33
+    insert into to_user (id, user_name, login_name, 
34
+      login_password, email, head_portrait, 
35
+      remark, status, create_user, 
36
+      create_date, update_user, update_date
37
+      )
38
+    values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, #{loginName,jdbcType=VARCHAR}, 
39
+      #{loginPassword,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{headPortrait,jdbcType=VARCHAR}, 
40
+      #{remark,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, 
41
+      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}
42
+      )
43
+  </insert>
44
+  <insert id="insertSelective" parameterType="com.community.huiju.model.ToUser" >
45
+    insert into to_user
46
+    <trim prefix="(" suffix=")" suffixOverrides="," >
47
+      <if test="id != null" >
48
+        id,
49
+      </if>
50
+      <if test="userName != null" >
51
+        user_name,
52
+      </if>
53
+      <if test="loginName != null" >
54
+        login_name,
55
+      </if>
56
+      <if test="loginPassword != null" >
57
+        login_password,
58
+      </if>
59
+      <if test="email != null" >
60
+        email,
61
+      </if>
62
+      <if test="headPortrait != null" >
63
+        head_portrait,
64
+      </if>
65
+      <if test="remark != null" >
66
+        remark,
67
+      </if>
68
+      <if test="status != null" >
69
+        status,
70
+      </if>
71
+      <if test="createUser != null" >
72
+        create_user,
73
+      </if>
74
+      <if test="createDate != null" >
75
+        create_date,
76
+      </if>
77
+      <if test="updateUser != null" >
78
+        update_user,
79
+      </if>
80
+      <if test="updateDate != null" >
81
+        update_date,
82
+      </if>
83
+    </trim>
84
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
85
+      <if test="id != null" >
86
+        #{id,jdbcType=INTEGER},
87
+      </if>
88
+      <if test="userName != null" >
89
+        #{userName,jdbcType=VARCHAR},
90
+      </if>
91
+      <if test="loginName != null" >
92
+        #{loginName,jdbcType=VARCHAR},
93
+      </if>
94
+      <if test="loginPassword != null" >
95
+        #{loginPassword,jdbcType=VARCHAR},
96
+      </if>
97
+      <if test="email != null" >
98
+        #{email,jdbcType=VARCHAR},
99
+      </if>
100
+      <if test="headPortrait != null" >
101
+        #{headPortrait,jdbcType=VARCHAR},
102
+      </if>
103
+      <if test="remark != null" >
104
+        #{remark,jdbcType=VARCHAR},
105
+      </if>
106
+      <if test="status != null" >
107
+        #{status,jdbcType=CHAR},
108
+      </if>
109
+      <if test="createUser != null" >
110
+        #{createUser,jdbcType=INTEGER},
111
+      </if>
112
+      <if test="createDate != null" >
113
+        #{createDate,jdbcType=TIMESTAMP},
114
+      </if>
115
+      <if test="updateUser != null" >
116
+        #{updateUser,jdbcType=INTEGER},
117
+      </if>
118
+      <if test="updateDate != null" >
119
+        #{updateDate,jdbcType=TIMESTAMP},
120
+      </if>
121
+    </trim>
122
+  </insert>
123
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.ToUser" >
124
+    update to_user
125
+    <set >
126
+      <if test="userName != null" >
127
+        user_name = #{userName,jdbcType=VARCHAR},
128
+      </if>
129
+      <if test="loginName != null" >
130
+        login_name = #{loginName,jdbcType=VARCHAR},
131
+      </if>
132
+      <if test="loginPassword != null" >
133
+        login_password = #{loginPassword,jdbcType=VARCHAR},
134
+      </if>
135
+      <if test="email != null" >
136
+        email = #{email,jdbcType=VARCHAR},
137
+      </if>
138
+      <if test="headPortrait != null" >
139
+        head_portrait = #{headPortrait,jdbcType=VARCHAR},
140
+      </if>
141
+      <if test="remark != null" >
142
+        remark = #{remark,jdbcType=VARCHAR},
143
+      </if>
144
+      <if test="status != null" >
145
+        status = #{status,jdbcType=CHAR},
146
+      </if>
147
+      <if test="createUser != null" >
148
+        create_user = #{createUser,jdbcType=INTEGER},
149
+      </if>
150
+      <if test="createDate != null" >
151
+        create_date = #{createDate,jdbcType=TIMESTAMP},
152
+      </if>
153
+      <if test="updateUser != null" >
154
+        update_user = #{updateUser,jdbcType=INTEGER},
155
+      </if>
156
+      <if test="updateDate != null" >
157
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
158
+      </if>
159
+    </set>
160
+    where id = #{id,jdbcType=INTEGER}
161
+  </update>
162
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.ToUser" >
163
+    update to_user
164
+    set user_name = #{userName,jdbcType=VARCHAR},
165
+      login_name = #{loginName,jdbcType=VARCHAR},
166
+      login_password = #{loginPassword,jdbcType=VARCHAR},
167
+      email = #{email,jdbcType=VARCHAR},
168
+      head_portrait = #{headPortrait,jdbcType=VARCHAR},
169
+      remark = #{remark,jdbcType=VARCHAR},
170
+      status = #{status,jdbcType=CHAR},
171
+      create_user = #{createUser,jdbcType=INTEGER},
172
+      create_date = #{createDate,jdbcType=TIMESTAMP},
173
+      update_user = #{updateUser,jdbcType=INTEGER},
174
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
175
+    where id = #{id,jdbcType=INTEGER}
176
+  </update>
177
+
178
+  <select id="selectByLoginName" parameterType="string" resultMap="BaseResultMap" >
179
+    select
180
+    <include refid="Base_Column_List"/>
181
+    from to_user where login_name = #{loginName,jdbcType=VARCHAR}
182
+  </select>
183
+
184
+</mapper>

+ 71
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/TpUserCommunityMapper.xml Прегледај датотеку

@@ -0,0 +1,71 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpUserCommunityMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpUserCommunity" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="tp_user_id" property="tpUserId" jdbcType="INTEGER" />
8
+  </resultMap>
9
+  <sql id="Base_Column_List" >
10
+    id, community_id, tp_user_id
11
+  </sql>
12
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
13
+    select 
14
+    <include refid="Base_Column_List" />
15
+    from tp_user_community
16
+    where id = #{id,jdbcType=INTEGER}
17
+  </select>
18
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
19
+    delete from tp_user_community
20
+    where id = #{id,jdbcType=INTEGER}
21
+  </delete>
22
+  <insert id="insert" parameterType="com.community.huiju.model.TpUserCommunity" >
23
+    insert into tp_user_community (id, community_id, tp_user_id
24
+      )
25
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tpUserId,jdbcType=INTEGER}
26
+      )
27
+  </insert>
28
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpUserCommunity" >
29
+    insert into tp_user_community
30
+    <trim prefix="(" suffix=")" suffixOverrides="," >
31
+      <if test="id != null" >
32
+        id,
33
+      </if>
34
+      <if test="communityId != null" >
35
+        community_id,
36
+      </if>
37
+      <if test="tpUserId != null" >
38
+        tp_user_id,
39
+      </if>
40
+    </trim>
41
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
42
+      <if test="id != null" >
43
+        #{id,jdbcType=INTEGER},
44
+      </if>
45
+      <if test="communityId != null" >
46
+        #{communityId,jdbcType=INTEGER},
47
+      </if>
48
+      <if test="tpUserId != null" >
49
+        #{tpUserId,jdbcType=INTEGER},
50
+      </if>
51
+    </trim>
52
+  </insert>
53
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpUserCommunity" >
54
+    update tp_user_community
55
+    <set >
56
+      <if test="communityId != null" >
57
+        community_id = #{communityId,jdbcType=INTEGER},
58
+      </if>
59
+      <if test="tpUserId != null" >
60
+        tp_user_id = #{tpUserId,jdbcType=INTEGER},
61
+      </if>
62
+    </set>
63
+    where id = #{id,jdbcType=INTEGER}
64
+  </update>
65
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpUserCommunity" >
66
+    update tp_user_community
67
+    set community_id = #{communityId,jdbcType=INTEGER},
68
+      tp_user_id = #{tpUserId,jdbcType=INTEGER}
69
+    where id = #{id,jdbcType=INTEGER}
70
+  </update>
71
+</mapper>

+ 188
- 0
CODE/smart-community/operate-api/src/main/resources/mapper/TpUserMapper.xml Прегледај датотеку

@@ -0,0 +1,188 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3
+<mapper namespace="com.community.huiju.dao.TpUserMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpUser" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
8
+    <result column="login_name" property="loginName" jdbcType="VARCHAR" />
9
+    <result column="login_password" property="loginPassword" jdbcType="VARCHAR" />
10
+    <result column="status" property="status" jdbcType="CHAR" />
11
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
12
+    <result column="email" property="email" jdbcType="VARCHAR" />
13
+    <result column="head_portrait" property="headPortrait" jdbcType="VARCHAR" />
14
+    <result column="create_user" property="createUser" jdbcType="INTEGER" />
15
+    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
16
+    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
17
+    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
18
+  </resultMap>
19
+  <sql id="Base_Column_List" >
20
+    id, community_id, user_name, login_name, login_password, status, remark, email, head_portrait, 
21
+    create_user, create_date, update_user, update_date
22
+  </sql>
23
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
24
+    select 
25
+    <include refid="Base_Column_List" />
26
+    from tp_user
27
+    where id = #{id,jdbcType=INTEGER}
28
+  </select>
29
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
30
+    delete from tp_user
31
+    where id = #{id,jdbcType=INTEGER}
32
+  </delete>
33
+  <insert id="insert" parameterType="com.community.huiju.model.TpUser" >
34
+    insert into tp_user (id, community_id, user_name, 
35
+      login_name, login_password, status, 
36
+      remark, email, head_portrait, 
37
+      create_user, create_date, update_user, 
38
+      update_date)
39
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, 
40
+      #{loginName,jdbcType=VARCHAR}, #{loginPassword,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, 
41
+      #{remark,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, #{headPortrait,jdbcType=VARCHAR}, 
42
+      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, 
43
+      #{updateDate,jdbcType=TIMESTAMP})
44
+  </insert>
45
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpUser" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
46
+    insert into tp_user
47
+    <trim prefix="(" suffix=")" suffixOverrides="," >
48
+      <if test="id != null" >
49
+        id,
50
+      </if>
51
+      <if test="communityId != null" >
52
+        community_id,
53
+      </if>
54
+      <if test="userName != null" >
55
+        user_name,
56
+      </if>
57
+      <if test="loginName != null" >
58
+        login_name,
59
+      </if>
60
+      <if test="loginPassword != null" >
61
+        login_password,
62
+      </if>
63
+      <if test="status != null" >
64
+        status,
65
+      </if>
66
+      <if test="remark != null" >
67
+        remark,
68
+      </if>
69
+      <if test="email != null" >
70
+        email,
71
+      </if>
72
+      <if test="headPortrait != null" >
73
+        head_portrait,
74
+      </if>
75
+      <if test="createUser != null" >
76
+        create_user,
77
+      </if>
78
+      <if test="createDate != null" >
79
+        create_date,
80
+      </if>
81
+      <if test="updateUser != null" >
82
+        update_user,
83
+      </if>
84
+      <if test="updateDate != null" >
85
+        update_date,
86
+      </if>
87
+    </trim>
88
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
89
+      <if test="id != null" >
90
+        #{id,jdbcType=INTEGER},
91
+      </if>
92
+      <if test="communityId != null" >
93
+        #{communityId,jdbcType=INTEGER},
94
+      </if>
95
+      <if test="userName != null" >
96
+        #{userName,jdbcType=VARCHAR},
97
+      </if>
98
+      <if test="loginName != null" >
99
+        #{loginName,jdbcType=VARCHAR},
100
+      </if>
101
+      <if test="loginPassword != null" >
102
+        #{loginPassword,jdbcType=VARCHAR},
103
+      </if>
104
+      <if test="status != null" >
105
+        #{status,jdbcType=CHAR},
106
+      </if>
107
+      <if test="remark != null" >
108
+        #{remark,jdbcType=VARCHAR},
109
+      </if>
110
+      <if test="email != null" >
111
+        #{email,jdbcType=VARCHAR},
112
+      </if>
113
+      <if test="headPortrait != null" >
114
+        #{headPortrait,jdbcType=VARCHAR},
115
+      </if>
116
+      <if test="createUser != null" >
117
+        #{createUser,jdbcType=INTEGER},
118
+      </if>
119
+      <if test="createDate != null" >
120
+        #{createDate,jdbcType=TIMESTAMP},
121
+      </if>
122
+      <if test="updateUser != null" >
123
+        #{updateUser,jdbcType=INTEGER},
124
+      </if>
125
+      <if test="updateDate != null" >
126
+        #{updateDate,jdbcType=TIMESTAMP},
127
+      </if>
128
+    </trim>
129
+  </insert>
130
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpUser" >
131
+    update tp_user
132
+    <set >
133
+      <if test="communityId != null" >
134
+        community_id = #{communityId,jdbcType=INTEGER},
135
+      </if>
136
+      <if test="userName != null" >
137
+        user_name = #{userName,jdbcType=VARCHAR},
138
+      </if>
139
+      <if test="loginName != null" >
140
+        login_name = #{loginName,jdbcType=VARCHAR},
141
+      </if>
142
+      <if test="loginPassword != null" >
143
+        login_password = #{loginPassword,jdbcType=VARCHAR},
144
+      </if>
145
+      <if test="status != null" >
146
+        status = #{status,jdbcType=CHAR},
147
+      </if>
148
+      <if test="remark != null" >
149
+        remark = #{remark,jdbcType=VARCHAR},
150
+      </if>
151
+      <if test="email != null" >
152
+        email = #{email,jdbcType=VARCHAR},
153
+      </if>
154
+      <if test="headPortrait != null" >
155
+        head_portrait = #{headPortrait,jdbcType=VARCHAR},
156
+      </if>
157
+      <if test="createUser != null" >
158
+        create_user = #{createUser,jdbcType=INTEGER},
159
+      </if>
160
+      <if test="createDate != null" >
161
+        create_date = #{createDate,jdbcType=TIMESTAMP},
162
+      </if>
163
+      <if test="updateUser != null" >
164
+        update_user = #{updateUser,jdbcType=INTEGER},
165
+      </if>
166
+      <if test="updateDate != null" >
167
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
168
+      </if>
169
+    </set>
170
+    where id = #{id,jdbcType=INTEGER}
171
+  </update>
172
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpUser" >
173
+    update tp_user
174
+    set community_id = #{communityId,jdbcType=INTEGER},
175
+      user_name = #{userName,jdbcType=VARCHAR},
176
+      login_name = #{loginName,jdbcType=VARCHAR},
177
+      login_password = #{loginPassword,jdbcType=VARCHAR},
178
+      status = #{status,jdbcType=CHAR},
179
+      remark = #{remark,jdbcType=VARCHAR},
180
+      email = #{email,jdbcType=VARCHAR},
181
+      head_portrait = #{headPortrait,jdbcType=VARCHAR},
182
+      create_user = #{createUser,jdbcType=INTEGER},
183
+      create_date = #{createDate,jdbcType=TIMESTAMP},
184
+      update_user = #{updateUser,jdbcType=INTEGER},
185
+      update_date = #{updateDate,jdbcType=TIMESTAMP}
186
+    where id = #{id,jdbcType=INTEGER}
187
+  </update>
188
+</mapper>

+ 0
- 33
CODE/smart-community/zuul/src/main/java/com/community/huiju/config/entity/UserElement.java Прегледај датотеку

@@ -1,33 +0,0 @@
1
-package com.community.huiju.config.entity;
2
-
3
-import lombok.AllArgsConstructor;
4
-import lombok.Data;
5
-import lombok.NoArgsConstructor;
6
-
7
-import java.io.Serializable;
8
-
9
-/**
10
- * session 基础类
11
- */
12
-@Data
13
-@AllArgsConstructor
14
-@NoArgsConstructor
15
-public class UserElement implements Serializable {
16
-
17
-    /** 用户唯一标识符 **/
18
-    private Integer id;
19
-
20
-    /** 用户名 **/
21
-    private String userName;
22
-
23
-    /** 登陆名 **/
24
-    private String loginName;
25
-
26
-    /** 邮箱 **/
27
-    private String email;
28
-
29
-    /** 用户状态 **/
30
-    private String status;
31
-
32
-
33
-}

+ 1
- 1
CODE/smart-community/zuul/src/main/java/com/community/huiju/constant/Status.java Прегледај датотеку

@@ -7,7 +7,7 @@ public enum Status {
7 7
 
8 8
     RESPONSE_STATUS_400("400","请求无法被理解!"),
9 9
 
10
-    RESPONSE_STATUS_401("401","无访问权限!"),
10
+    RESPONSE_STATUS_888("888","无访问权限!"),
11 11
 
12 12
     RESPONSE_STATUS_500("500","服务器错误!"),
13 13
 

+ 4
- 2
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestAuthenticationEntryPoint.java Прегледај датотеку

@@ -31,11 +31,13 @@ public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
31 31
             if (Status.RESPONSE_STATUS_800.getValue().equals(headerError)) {
32 32
                 result.addError(Status.RESPONSE_STATUS_800.getValue(),Status.RESPONSE_STATUS_800.getComment());
33 33
             } else if (Status.RESPONSE_STATUS_801.getValue().equals(headerError)) {
34
-                result.addError("401","请您登陆!");
34
+                result.addError(Status.RESPONSE_STATUS_801.getValue(),Status.RESPONSE_STATUS_801.getComment());
35
+            }else if (Status.RESPONSE_STATUS_803.getValue().equals(headerError)) {
36
+                result.addError(Status.RESPONSE_STATUS_803.getValue(),Status.RESPONSE_STATUS_803.getComment());
35 37
             }
36 38
         }
37 39
 //        else {
38
-//            result.addError("403",Status.RESPONSE_STATUS_401.getComment());
40
+//            result.addError(Status.RESPONSE_STATUS_888.getValue(),Status.RESPONSE_STATUS_888.getComment());
39 41
 //        }
40 42
 
41 43
         try {

+ 0
- 30
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateManager.java Прегледај датотеку

@@ -1,30 +0,0 @@
1
-package com.community.huiju.security;
2
-
3
-import com.community.huiju.exception.WisdomSecurityException;
4
-import org.springframework.security.authentication.AuthenticationManager;
5
-import org.springframework.security.core.Authentication;
6
-import org.springframework.security.core.AuthenticationException;
7
-import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
8
-import org.springframework.stereotype.Component;
9
-
10
-public class RestPreAuthenticateManager implements AuthenticationManager {
11
-
12
-    @Override
13
-    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
14
-        if (authentication instanceof PreAuthenticatedAuthenticationToken) {
15
-            PreAuthenticatedAuthenticationToken preAuthrentication = (PreAuthenticatedAuthenticationToken) authentication;
16
-            if (null != preAuthrentication.getAuthorities() && preAuthrentication.getAuthorities().size() > 0) {
17
-                preAuthrentication.setAuthenticated(true);
18
-                return preAuthrentication;
19
-            }
20
-        } else if (authentication instanceof  TokenAuthrentication) {
21
-            TokenAuthrentication tokenAuthrentication = (TokenAuthrentication) authentication;
22
-            if (null != tokenAuthrentication.getAuthorities() && tokenAuthrentication.getAuthorities().size() > 0) {
23
-                tokenAuthrentication.setAuthenticated(true);
24
-                return tokenAuthrentication;
25
-            }
26
-        }
27
-
28
-        throw new WisdomSecurityException("没有授权角色!");
29
-    }
30
-}

+ 8
- 12
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticateProvider.java Прегледај датотеку

@@ -8,6 +8,7 @@ import org.springframework.security.web.authentication.preauth.PreAuthenticatedA
8 8
 
9 9
 /**
10 10
  * 授权过程
11
+ *
11 12
  * @author weiximei
12 13
  */
13 14
 public class RestPreAuthenticateProvider implements AuthenticationProvider {
@@ -15,25 +16,20 @@ public class RestPreAuthenticateProvider implements AuthenticationProvider {
15 16
     @Override
16 17
     public Authentication authenticate(Authentication authentication) throws AuthenticationException {
17 18
 
18
-        if (authentication instanceof  PreAuthenticatedAuthenticationToken) {
19
-            PreAuthenticatedAuthenticationToken preAuthrentication = (PreAuthenticatedAuthenticationToken) authentication;
20
-            if (null != preAuthrentication.getAuthorities() && preAuthrentication.getAuthorities().size() > 0) {
21
-                preAuthrentication.setAuthenticated(true);
22
-                return preAuthrentication;
23
-            }
24
-        } else if (authentication instanceof  TokenAuthrentication) {
25
-            TokenAuthrentication tokenAuthrentication = (TokenAuthrentication) authentication;
26
-            if (null != tokenAuthrentication.getAuthorities() && tokenAuthrentication.getAuthorities().size() > 0) {
27
-                tokenAuthrentication.setAuthenticated(true);
28
-                return tokenAuthrentication;
29
-            }
19
+
20
+        TokenAuthrentication tokenAuthrentication = (TokenAuthrentication) authentication.getPrincipal();
21
+        if (null != tokenAuthrentication.getAuthorities() && tokenAuthrentication.getAuthorities().size() > 0) {
22
+            tokenAuthrentication.setAuthenticated(true);
23
+            return tokenAuthrentication;
30 24
         }
31 25
 
26
+
32 27
         throw new WisdomSecurityException("没有授权角色!");
33 28
     }
34 29
 
35 30
     /**
36 31
      * 是否授权过程
32
+     *
37 33
      * @param authentication
38 34
      * @return
39 35
      */

+ 4
- 1
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/RestPreAuthenticatedProcessingFilter.java Прегледај датотеку

@@ -1,7 +1,7 @@
1 1
 package com.community.huiju.security;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4
-import com.community.huiju.config.entity.UserElement;
4
+import com.community.commom.session.UserElement;
5 5
 import com.community.huiju.constant.Header;
6 6
 import com.community.huiju.constant.Status;
7 7
 import com.community.huiju.dto.RoleDTO;
@@ -68,6 +68,9 @@ public class RestPreAuthenticatedProcessingFilter extends AbstractPreAuthenticat
68 68
         if (null == request.getAttribute(Header.HEADER_ERROR.getValue())){
69 69
             try {
70 70
                 UserElement userElement = getUserElement(loginType, request);
71
+                if (null == userElement) {
72
+                    request.setAttribute(Header.HEADER_ERROR.getValue(), Status.RESPONSE_STATUS_803.getValue());
73
+                }
71 74
                 List<RoleDTO> roleDTOList = Lists.newArrayList();
72 75
                 if (Constant.APP_LOGIN_TYPE.equals(loginType)) {
73 76
                     roleDTOList = iRoleService.getAppUserRoleByUserId(userElement.getId());

+ 2
- 14
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/WisdomSecurityConfig.java Прегледај датотеку

@@ -36,21 +36,9 @@ public class WisdomSecurityConfig extends WebSecurityConfigurerAdapter {
36 36
     private RestPreAuthenticatedProcessingFilter getPreAuthenticatedProcessingFilter() throws Exception {
37 37
         RestPreAuthenticatedProcessingFilter filter = new RestPreAuthenticatedProcessingFilter(parametes.getNoneSercurityPath(),iRoleService);
38 38
         filter.setAuthenticationManager(this.authenticationManagerBean());
39
-        //filter.setAuthenticationManager(new RestPreAuthenticateManager());
40 39
         return filter;
41 40
     }
42 41
 
43
-    /**
44
-     * user-detail服务
45
-     * @param auth
46
-     * @throws Exception
47
-     */
48
-    @Override
49
-    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
50
-        auth.authenticationProvider(new RestPreAuthenticateProvider());
51
-        //super.configure(auth);
52
-    }
53
-
54 42
     /**
55 43
      * 安全策略
56 44
      * @param http
@@ -60,7 +48,7 @@ public class WisdomSecurityConfig extends WebSecurityConfigurerAdapter {
60 48
     protected void configure(HttpSecurity http) throws Exception {
61 49
 
62 50
         http.csrf().disable();
63
-        http
51
+        http.authenticationProvider(new RestPreAuthenticateProvider())
64 52
                 .authorizeRequests()
65 53
                 .antMatchers(parametes.getNoneSercurityPath().toArray(new String[parametes.getNoneSercurityPath().size()])).permitAll() // 不要授权
66 54
                 .anyRequest()// 任何请求需要授权
@@ -70,7 +58,7 @@ public class WisdomSecurityConfig extends WebSecurityConfigurerAdapter {
70 58
 //                .antMatchers(parametes.getAppSercurityPath().get(2).split("=")[1]).hasRole(parametes.getAppSercurityPath().get(2).split("=")[0])
71 59
                 .antMatchers("/app-api/tickets/**").hasRole("OWNER")
72 60
                .and()
73
-                .sessionManagement()
61
+                .sessionManagement().sessionFixation().none()
74 62
                 .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
75 63
                .and()
76 64
                 .httpBasic().authenticationEntryPoint(new RestAuthenticationEntryPoint())

+ 0
- 88
CODE/smart-community/zuul/src/main/java/com/community/huiju/security/dome/TokenAuthrentication.java Прегледај датотеку

@@ -1,88 +0,0 @@
1
-package com.community.huiju.security.dome;
2
-
3
-import org.springframework.security.authentication.AbstractAuthenticationToken;
4
-import org.springframework.security.core.GrantedAuthority;
5
-import org.springframework.security.core.SpringSecurityCoreVersion;
6
-
7
-import java.util.Collection;
8
-
9
-/**
10
- * 认证
11
- * @author weiximei
12
- */
13
-public class TokenAuthrentication extends AbstractAuthenticationToken {
14
-
15
-    private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
16
-
17
-    // ~ Instance fields
18
-    // ================================================================================================
19
-
20
-    private final Object principal; // 存储认证信息的
21
-    //private Object credentials; // 存放密码
22
-
23
-    // ~ Constructors
24
-    // ===================================================================================================
25
-
26
-    /**
27
-     * This constructor can be safely used by any code that wishes to create a
28
-     * <code>SmsCodeAuthenticationToken</code>, as the {@link #isAuthenticated()}
29
-     * will return <code>false</code>.
30
-     *
31
-     */
32
-    public TokenAuthrentication(String token) {
33
-        super(null);
34
-        this.principal = token; // 存放token
35
-        //this.credentials = credentials;
36
-        // 是否认证
37
-        setAuthenticated(false);
38
-    }
39
-
40
-    /**
41
-     * This constructor should only be used by <code>AuthenticationManager</code> or
42
-     * <code>AuthenticationProvider</code> implementations that are satisfied with
43
-     * producing a trusted (i.e. {@link #isAuthenticated()} = <code>true</code>)
44
-     * authentication token.
45
-     *
46
-     * @param principal
47
-     * @param authorities
48
-     */
49
-    // principal 用户认证信息,authorities用户的权限
50
-    public TokenAuthrentication(Object principal,
51
-                                      Collection<? extends GrantedAuthority> authorities) {
52
-        super(authorities);
53
-        this.principal = principal; // 登录成功,存放用户信息
54
-        // this.credentials = credentials;
55
-        // 是否认证
56
-        super.setAuthenticated(true); // must use super, as we override
57
-    }
58
-
59
-    // ~ Methods
60
-    // ========================================================================================================
61
-    @Override
62
-    public Object getCredentials() {
63
-        //return this.credentials;
64
-        return null;
65
-    }
66
-
67
-    @Override
68
-    public Object getPrincipal() {
69
-        return this.principal;
70
-    }
71
-
72
-    @Override
73
-    public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException {
74
-        if (isAuthenticated) {
75
-            throw new IllegalArgumentException(
76
-                    "Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead");
77
-        }
78
-
79
-        super.setAuthenticated(false);
80
-    }
81
-
82
-    @Override
83
-    public void eraseCredentials() {
84
-        super.eraseCredentials();
85
-        // credentials = null;
86
-    }
87
-
88
-}

+ 1334
- 626
文档/MYSQL/smartCommunity.pdb
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 1330
- 622
文档/MYSQL/smartCommunity.pdm
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


BIN
文档/需求/APP需求补充接口.xlsx Прегледај датотеку