张延森 4 年前
父节点
当前提交
90c97def8b
共有 84 个文件被更改,包括 3233 次插入69 次删除
  1. 7
    4
      pom.xml
  2. 4
    0
      src/main/java/com/yunzhi/liyuanhui/common/BaseController.java
  3. 17
    0
      src/main/java/com/yunzhi/liyuanhui/common/EncryptUtils.java
  4. 59
    59
      src/main/java/com/yunzhi/liyuanhui/common/JWTUtils.java
  5. 67
    0
      src/main/java/com/yunzhi/liyuanhui/common/ResponseBean.java
  6. 2
    4
      src/main/java/com/yunzhi/liyuanhui/common/WxUtils.java
  7. 1
    1
      src/main/java/com/yunzhi/liyuanhui/config/BaseConfig.java
  8. 60
    0
      src/main/java/com/yunzhi/liyuanhui/controller/LoginController.java
  9. 111
    0
      src/main/java/com/yunzhi/liyuanhui/controller/SysModuleController.java
  10. 113
    0
      src/main/java/com/yunzhi/liyuanhui/controller/SysUserController.java
  11. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaActivityController.java
  12. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaActivityEnrollController.java
  13. 113
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaActivityVoteController.java
  14. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaGalleryController.java
  15. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaNewsController.java
  16. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaPersonController.java
  17. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaRecommendSettingController.java
  18. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TaRecommenderController.java
  19. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TdActivityTypeController.java
  20. 112
    0
      src/main/java/com/yunzhi/liyuanhui/controller/TdNewsTypeController.java
  21. 44
    0
      src/main/java/com/yunzhi/liyuanhui/entity/SysModule.java
  22. 59
    0
      src/main/java/com/yunzhi/liyuanhui/entity/SysUser.java
  23. 143
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaActivity.java
  24. 88
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaActivityEnroll.java
  25. 78
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaActivityVote.java
  26. 63
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaGallery.java
  27. 83
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaNews.java
  28. 83
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaPerson.java
  29. 47
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaRecommendSetting.java
  30. 68
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TaRecommender.java
  31. 62
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TdActivityType.java
  32. 62
    0
      src/main/java/com/yunzhi/liyuanhui/entity/TdNewsType.java
  33. 19
    0
      src/main/java/com/yunzhi/liyuanhui/exception/GlobalExceptionHandler.java
  34. 45
    0
      src/main/java/com/yunzhi/liyuanhui/interceptor/PermissionInterceptor.java
  35. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/SysModuleMapper.java
  36. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/SysUserMapper.java
  37. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityEnrollMapper.java
  38. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityMapper.java
  39. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityVoteMapper.java
  40. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaGalleryMapper.java
  41. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaNewsMapper.java
  42. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaPersonMapper.java
  43. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaRecommendSettingMapper.java
  44. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TaRecommenderMapper.java
  45. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TdActivityTypeMapper.java
  46. 18
    0
      src/main/java/com/yunzhi/liyuanhui/mapper/TdNewsTypeMapper.java
  47. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ISysModuleService.java
  48. 19
    0
      src/main/java/com/yunzhi/liyuanhui/service/ISysUserService.java
  49. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaActivityEnrollService.java
  50. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaActivityService.java
  51. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaActivityVoteService.java
  52. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaGalleryService.java
  53. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaNewsService.java
  54. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaPersonService.java
  55. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaRecommendSettingService.java
  56. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITaRecommenderService.java
  57. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITdActivityTypeService.java
  58. 16
    0
      src/main/java/com/yunzhi/liyuanhui/service/ITdNewsTypeService.java
  59. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/SysModuleServiceImpl.java
  60. 30
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/SysUserServiceImpl.java
  61. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityEnrollServiceImpl.java
  62. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityServiceImpl.java
  63. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityVoteServiceImpl.java
  64. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaGalleryServiceImpl.java
  65. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaNewsServiceImpl.java
  66. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaPersonServiceImpl.java
  67. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaRecommendSettingServiceImpl.java
  68. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TaRecommenderServiceImpl.java
  69. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TdActivityTypeServiceImpl.java
  70. 20
    0
      src/main/java/com/yunzhi/liyuanhui/service/impl/TdNewsTypeServiceImpl.java
  71. 5
    0
      src/main/resources/application-dev.yml
  72. 1
    1
      src/main/resources/application.yml
  73. 5
    0
      src/main/resources/mapper/SysModuleMapper.xml
  74. 5
    0
      src/main/resources/mapper/SysUserMapper.xml
  75. 5
    0
      src/main/resources/mapper/TaActivityEnrollMapper.xml
  76. 5
    0
      src/main/resources/mapper/TaActivityMapper.xml
  77. 5
    0
      src/main/resources/mapper/TaActivityVoteMapper.xml
  78. 5
    0
      src/main/resources/mapper/TaGalleryMapper.xml
  79. 5
    0
      src/main/resources/mapper/TaNewsMapper.xml
  80. 5
    0
      src/main/resources/mapper/TaPersonMapper.xml
  81. 5
    0
      src/main/resources/mapper/TaRecommendSettingMapper.xml
  82. 5
    0
      src/main/resources/mapper/TaRecommenderMapper.xml
  83. 5
    0
      src/main/resources/mapper/TdActivityTypeMapper.xml
  84. 5
    0
      src/main/resources/mapper/TdNewsTypeMapper.xml

+ 7
- 4
pom.xml 查看文件

@@ -40,23 +40,25 @@
40 40
 			<artifactId>fastjson</artifactId>
41 41
 			<version>1.2.56</version>
42 42
 		</dependency>
43
+
43 44
 		<dependency>
44 45
 			<groupId>io.jsonwebtoken</groupId>
45 46
 			<artifactId>jjwt-api</artifactId>
46
-			<version>0.10.5</version>
47
+			<version>0.11.2</version>
47 48
 		</dependency>
48 49
 		<dependency>
49 50
 			<groupId>io.jsonwebtoken</groupId>
50 51
 			<artifactId>jjwt-impl</artifactId>
51
-			<version>0.10.5</version>
52
+			<version>0.11.2</version>
52 53
 			<scope>runtime</scope>
53 54
 		</dependency>
54 55
 		<dependency>
55 56
 			<groupId>io.jsonwebtoken</groupId>
56
-			<artifactId>jjwt-jackson</artifactId>
57
-			<version>0.10.5</version>
57
+			<artifactId>jjwt-jackson</artifactId> <!-- or jjwt-gson if Gson is preferred -->
58
+			<version>0.11.2</version>
58 59
 			<scope>runtime</scope>
59 60
 		</dependency>
61
+
60 62
 		<dependency>
61 63
 			<groupId>com.aliyun.oss</groupId>
62 64
 			<artifactId>aliyun-sdk-oss</artifactId>
@@ -121,6 +123,7 @@
121 123
 				<includes>
122 124
 					<include>application.yml</include>
123 125
 					<include>application-${profileActive}.yml</include>
126
+					<include>mapper/**/*.xml</include>
124 127
 				</includes>
125 128
 			</resource>
126 129
 		</resources>

+ 4
- 0
src/main/java/com/yunzhi/liyuanhui/common/BaseController.java 查看文件

@@ -0,0 +1,4 @@
1
+package com.yunzhi.liyuanhui.common;
2
+
3
+public class BaseController {
4
+}

+ 17
- 0
src/main/java/com/yunzhi/liyuanhui/common/EncryptUtils.java 查看文件

@@ -0,0 +1,17 @@
1
+package com.yunzhi.liyuanhui.common;
2
+
3
+import org.springframework.util.DigestUtils;
4
+
5
+public class EncryptUtils {
6
+
7
+    public static String md5(String str, String ...slats) {
8
+        String slat = "";
9
+        if (null != slats && slats.length > 0) {
10
+            slat = slats[0];
11
+        }
12
+
13
+        String base = str + slat;
14
+        String md5 = DigestUtils.md5DigestAsHex(base.getBytes());
15
+        return md5;
16
+    }
17
+}

+ 59
- 59
src/main/java/com/yunzhi/liyuanhui/common/JWTUtils.java 查看文件

@@ -1,11 +1,17 @@
1 1
 package com.yunzhi.liyuanhui.common;
2 2
 
3
+import io.jsonwebtoken.Claims;
4
+import io.jsonwebtoken.Jws;
3 5
 import io.jsonwebtoken.Jwts;
4 6
 import io.jsonwebtoken.security.Keys;
7
+import lombok.extern.slf4j.Slf4j;
5 8
 
9
+import javax.crypto.SecretKey;
6 10
 import javax.servlet.http.HttpServletRequest;
7
-import java.security.Key;
8
-import java.util.Calendar;
11
+import javax.servlet.http.HttpServletResponse;
12
+import java.time.LocalDateTime;
13
+import java.time.ZoneId;
14
+import java.util.Base64;
9 15
 import java.util.Date;
10 16
 import java.util.Map;
11 17
 
@@ -14,80 +20,74 @@ import java.util.Map;
14 20
  * jwt 辅助类
15 21
  * https://github.com/jwtk/jjwt
16 22
  */
23
+@Slf4j
17 24
 public class JWTUtils {
18
-    // 直接定义常量是不安全的
19
-    public final static Key key = Keys.hmacShaKeyFor("yansenisahero,2019-5-17 16:18:14".getBytes());
20 25
 
21
-    public final static String HeaderName = "x-authorization";
22
-    
26
+    // 过期时间 5 分钟
27
+    static final long EXPIRE_TIME = 5 * 60;
28
+
29
+    // 私钥
30
+    static final SecretKey SECRET_KEY = Keys.hmacShaKeyFor(Base64.getEncoder().encode("Yansen is so handsome. He is a good man. Everyone like him !!!".getBytes()));
31
+
32
+    // 请求头
33
+    public static final String AUTH_HEADER = "X-Authorization-JWT";
34
+
23 35
     /**
24
-     * getSubject 获取 jwt subject
25
-     * @param request
36
+     * 生成 token, claims 里必须要有 userId
37
+     * @param claims
26 38
      * @return
27 39
      */
28
-    public static String getSubject(HttpServletRequest request) {
29
-        String jws = getToken(request);
30
-        if (null == jws || "".equals(jws.trim())) return null;
40
+    public static String encode(Map<String, Object> claims) {
41
+        Date[] datePair = getDatePair();
42
+        Date iat = datePair[0];
43
+        Date exp = datePair[1];
31 44
 
32
-        try {
33
-            return Jwts.parser().setSigningKey(key).parseClaimsJws(jws.trim()).getBody().getSubject();
34
-        } catch (Exception e) {
35
-            e.printStackTrace();
36
-        }
45
+        return Jwts.builder().setIssuer(claims.get("userId").toString()).setIssuedAt(iat).setExpiration(exp).addClaims(claims).signWith(SECRET_KEY).compact();
46
+    }
37 47
 
38
-        return null;
48
+    public static Map<String, Object> decode(String token) throws Exception {
49
+        return parse(token);
39 50
     }
40
-    
41
-    /**
42
-     * getSubject 获取 jwt subject
43
-     * @param request
44
-     * @return
45
-     */
46
-    public static Map getUserIdAndOrgId(HttpServletRequest request) {
47
-        String jws = getToken(request);
48
-        if (null == jws || "".equals(jws.trim())) return null;
49
-        
51
+
52
+    public static String refresh(String token) {
50 53
         try {
51
-            return Jwts.parser().setSigningKey(key).parseClaimsJws(jws.trim()).getBody();
54
+            Claims claims = parse(token);
55
+            return encode(claims);
52 56
         } catch (Exception e) {
53
-            e.printStackTrace();
57
+            log.error("解析 JWT Token 失败: {}", e.getMessage());
54 58
         }
55
-        
56 59
         return null;
57 60
     }
58
-    
59
-    /**
60
-     * getSubject 获取 jwt subject
61
-     * @param request
62
-     * @return
63
-     */
61
+
62
+    public static void refresh(String jws, HttpServletResponse response) {
63
+        if (!StringUtils.isEmpty(jws)) {
64
+            String token =  refresh(jws);
65
+            response.addHeader(AUTH_HEADER, token);
66
+        }
67
+    }
68
+
64 69
     public static String getToken(HttpServletRequest request) {
65
-        return request.getHeader(HeaderName);
70
+        return request.getHeader(AUTH_HEADER);
66 71
     }
67 72
 
68
-    /**
69
-     * newToken 生成新的 token
70
-     * @param subject
71
-     * @return
72
-     */
73
-    public static String newToken(String subject) {
74
-        // 有效期 7 天
75
-        Calendar calendar = Calendar.getInstance();
76
-        calendar.setTime(new Date());
77
-        calendar.set(Calendar.DAY_OF_MONTH,calendar.get(Calendar.DAY_OF_MONTH)+7);
78
-        return Jwts.builder().setSubject(subject).setExpiration(calendar.getTime()).signWith(key).compact();
73
+    public static void verify(String token) throws Exception {
74
+        parse(token);
79 75
     }
80
-    
81
-    /**
82
-     * newToken 生成新的 token
83
-     * @param subject
84
-     * @return
85
-     */
86
-    public static String newTokenByMap(Map subject) {
87
-        // 有效期 30 分钟
88
-        Calendar calendar = Calendar.getInstance();
89
-        calendar.add(Calendar.MINUTE, 30);
90 76
 
91
-        return Jwts.builder().setClaims(subject).setExpiration(calendar.getTime()).signWith(key).compact();
77
+    private static Date[] getDatePair() {
78
+        LocalDateTime now = LocalDateTime.now();
79
+        Date iat = Date.from(now.atZone(ZoneId.systemDefault()).toInstant());
80
+        Date exp = Date.from(now.plusSeconds(EXPIRE_TIME).atZone(ZoneId.systemDefault()).toInstant());
81
+        return new Date[]{iat, exp};
82
+    }
83
+
84
+    private static Claims parse(String token) throws Exception {
85
+        if (token == null || "".equals(token)) {
86
+            throw new Exception("Token 不能为空");
87
+        }
88
+
89
+        long skew = 5;
90
+        Jws<Claims> claimsJws = Jwts.parserBuilder().setAllowedClockSkewSeconds(skew).setSigningKey(SECRET_KEY).build().parseClaimsJws(token);
91
+        return claimsJws.getBody();
92 92
     }
93 93
 }

+ 67
- 0
src/main/java/com/yunzhi/liyuanhui/common/ResponseBean.java 查看文件

@@ -0,0 +1,67 @@
1
+package com.yunzhi.liyuanhui.common;
2
+
3
+import java.io.Serializable;
4
+
5
+/**
6
+ * 接口统一状态返回BEAN.
7
+ */
8
+public class ResponseBean<T> implements Serializable {
9
+
10
+    private static final long serialVersionUID = 3593827217136880822L;
11
+
12
+    public static final int CODE_SUCCESS = 1000;
13
+    public static final int ERROR_AUTH_FAIL = 1001;
14
+    public static final int ERROR_AUTH_EXPIRED = 1002;
15
+    public static final int ERROR_MISSING_PARAMS = 1003;
16
+    public static final int ERROR_ILLEGAL_PARAMS = 1004;
17
+    public static final int ERROR_UNAVAILABLE = 1005;
18
+
19
+    private int code;
20
+    private String message;
21
+    private T data;
22
+
23
+    public ResponseBean() {
24
+        code = ResponseBean.CODE_SUCCESS;
25
+    }
26
+
27
+    public static <T> ResponseBean success(T data, String ...msgs) {
28
+        ResponseBean responseBean = new ResponseBean();
29
+        responseBean.code = ResponseBean.CODE_SUCCESS;
30
+        responseBean.data = data;
31
+
32
+        if (null != msgs && msgs.length > 0) {
33
+            responseBean.message = msgs[0];
34
+        }
35
+
36
+        return responseBean;
37
+    }
38
+
39
+    public static <T> ResponseBean error(String msg, int code, T ...datas) {
40
+        ResponseBean responseBean = new ResponseBean();
41
+        responseBean.code = code;
42
+        responseBean.message = msg;
43
+
44
+        if (null != datas && datas.length > 0) {
45
+            responseBean.data = datas[0];
46
+        }
47
+
48
+        return responseBean;
49
+    }
50
+
51
+    public int getCode() {
52
+        return code;
53
+    }
54
+
55
+    public String getMessage() {
56
+        return message;
57
+    }
58
+
59
+    public T getData() {
60
+        return data;
61
+    }
62
+    
63
+    @Override
64
+    public String toString() {
65
+        return  "{ code: "+code+", message: "+message+", data: <T> }";
66
+    }
67
+}

+ 2
- 4
src/main/java/com/yunzhi/liyuanhui/common/WxUtils.java 查看文件

@@ -9,12 +9,10 @@ import org.springframework.stereotype.Component;
9 9
 
10 10
 @Component
11 11
 public class WxUtils {
12
-    @Autowired
13
-    private WeixinConfig config;
14
-
15 12
     private static WxMaService service;
16 13
 
17
-    public WxUtils() {
14
+    @Autowired
15
+    public WxUtils(WeixinConfig config) {
18 16
         setService(config);
19 17
     }
20 18
 

+ 1
- 1
src/main/java/com/yunzhi/liyuanhui/config/BaseConfig.java 查看文件

@@ -14,7 +14,7 @@ import javax.annotation.Resource;
14 14
 @Configuration
15 15
 public class BaseConfig implements WebMvcConfigurer {
16 16
 
17
-    @Resource
17
+    @Autowired
18 18
     private PermissionInterceptor permissionInterceptor;
19 19
 
20 20
     @Autowired

+ 60
- 0
src/main/java/com/yunzhi/liyuanhui/controller/LoginController.java 查看文件

@@ -0,0 +1,60 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.yunzhi.liyuanhui.common.*;
4
+import com.yunzhi.liyuanhui.entity.SysUser;
5
+import com.yunzhi.liyuanhui.service.ISysUserService;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.RequestBody;
9
+import org.springframework.web.bind.annotation.RestController;
10
+
11
+import java.util.HashMap;
12
+import java.util.Map;
13
+
14
+@RestController
15
+public class LoginController extends BaseController {
16
+
17
+    @Autowired
18
+    ISysUserService iSysUserService;
19
+
20
+    @PostMapping("/login")
21
+    public ResponseBean login(@RequestBody Map<String, String> loginParam) throws Exception {
22
+        if (null == loginParam) {
23
+            return ResponseBean.error("账户或密码不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
24
+        }
25
+
26
+        String userName = loginParam.get("userName");
27
+        String password = loginParam.get("password");
28
+
29
+        if (StringUtils.isEmpty(userName) || StringUtils.isEmpty(password)) {
30
+            return ResponseBean.error("账户或密码不能为空", ResponseBean.ERROR_ILLEGAL_PARAMS);
31
+        }
32
+
33
+        SysUser sysUser = iSysUserService.getLoginUser(userName);
34
+        if (null == sysUser) {
35
+            return ResponseBean.error("账户或密码不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
36
+        }
37
+
38
+        if (!checkPassword(password, sysUser.getPassword(), sysUser.getUserId().toString())) {
39
+            return ResponseBean.error("账户或密码不正确", ResponseBean.ERROR_ILLEGAL_PARAMS);
40
+        }
41
+
42
+        if (!iSysUserService.checkStatus(sysUser)) {
43
+            return ResponseBean.error("用户状态不正确, 请联系管理人员", ResponseBean.ERROR_UNAVAILABLE);
44
+        }
45
+
46
+        // 生成 token
47
+        Map<String, Object> claims = new HashMap<String, Object>(){{
48
+            put("userId", sysUser.getUserId());
49
+        }};
50
+        String jws = JWTUtils.encode(claims);
51
+        sysUser.setPassword(null);
52
+        sysUser.setToken(jws);
53
+
54
+        return ResponseBean.success(sysUser);
55
+    }
56
+
57
+    private boolean checkPassword(String src, String targ, String salt) {
58
+        return EncryptUtils.md5(src, salt).equals(targ);
59
+    }
60
+}

+ 111
- 0
src/main/java/com/yunzhi/liyuanhui/controller/SysModuleController.java 查看文件

@@ -0,0 +1,111 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ISysModuleService;
18
+import com.yunzhi.liyuanhui.entity.SysModule;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 模块 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class SysModuleController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(SysModuleController.class);
34
+
35
+    @Autowired
36
+    public ISysModuleService iSysModuleService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/sysModule",method= RequestMethod.GET)
46
+    public ResponseBean sysModuleList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                      @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<SysModule> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<SysModule> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<SysModule> result = iSysModuleService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param sysModule 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/sysModule",method= RequestMethod.POST)
63
+    public ResponseBean sysModuleAdd(@RequestBody SysModule sysModule) throws Exception{
64
+        if (iSysModuleService.save(sysModule)){
65
+            return ResponseBean.success(sysModule);
66
+        }else {
67
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
68
+        }
69
+    }
70
+
71
+    /**
72
+     * 根据id删除对象
73
+     * @param id  实体ID
74
+     */
75
+    @ResponseBody
76
+    @RequestMapping(value="/sysModule/{id}", method= RequestMethod.DELETE)
77
+    public ResponseBean sysModuleDelete(@PathVariable Integer id) throws Exception{
78
+
79
+        if(iSysModuleService.removeById(id)){
80
+            return ResponseBean.success("success");
81
+        }else {
82
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
83
+        }
84
+    }
85
+
86
+    /**
87
+     * 修改对象
88
+     * @param id  实体ID
89
+     * @param sysModule 实体对象
90
+     * @return
91
+     */
92
+    @RequestMapping(value="/sysModule/{id}",method= RequestMethod.PUT)
93
+    public ResponseBean sysModuleUpdate(@PathVariable Integer id,
94
+                                        @RequestBody SysModule sysModule) throws Exception{
95
+
96
+        if (iSysModuleService.updateById(sysModule)){
97
+            return ResponseBean.success(sysModule);
98
+        }else {
99
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
100
+        }
101
+    }
102
+
103
+    /**
104
+     * 根据id查询对象
105
+     * @param id  实体ID
106
+     */
107
+    @RequestMapping(value="/sysModule/{id}",method= RequestMethod.GET)
108
+    public ResponseBean sysModuleGet(@PathVariable Integer id) throws Exception{
109
+        return ResponseBean.success(iSysModuleService.getById(id));
110
+    }
111
+}

+ 113
- 0
src/main/java/com/yunzhi/liyuanhui/controller/SysUserController.java 查看文件

@@ -0,0 +1,113 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ISysUserService;
18
+import com.yunzhi.liyuanhui.entity.SysUser;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 系统用户 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class SysUserController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(SysUserController.class);
34
+
35
+    @Autowired
36
+    public ISysUserService iSysUserService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/sysUser",method= RequestMethod.GET)
46
+    public ResponseBean sysUserList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                    @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception {
48
+
49
+        //使用分页插件
50
+        IPage<SysUser> pg = new Page<>(pageNum, pageSize);
51
+        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
52
+        queryWrapper.orderByDesc("create_date");
53
+
54
+        IPage<SysUser> result = iSysUserService.page(pg, queryWrapper);
55
+        return ResponseBean.success(result);
56
+    }
57
+
58
+    /**
59
+     * 保存对象
60
+     * @param sysUser 实体对象
61
+     * @return
62
+     */
63
+    @RequestMapping(value="/sysUser",method= RequestMethod.POST)
64
+    public ResponseBean sysUserAdd(@RequestBody SysUser sysUser) throws Exception{
65
+
66
+        if (iSysUserService.save(sysUser)){
67
+            return ResponseBean.success(sysUser);
68
+        }else {
69
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
70
+        }
71
+    }
72
+
73
+    /**
74
+     * 根据id删除对象
75
+     * @param id  实体ID
76
+     */
77
+    @ResponseBody
78
+    @RequestMapping(value="/sysUser/{id}", method= RequestMethod.DELETE)
79
+    public ResponseBean sysUserDelete(@PathVariable Integer id) throws Exception {
80
+
81
+        if(iSysUserService.removeById(id)){
82
+            return ResponseBean.success("success");
83
+        }else {
84
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
85
+        }
86
+    }
87
+
88
+    /**
89
+     * 修改对象
90
+     * @param id  实体ID
91
+     * @param sysUser 实体对象
92
+     * @return
93
+     */
94
+    @RequestMapping(value="/sysUser/{id}",method= RequestMethod.PUT)
95
+    public ResponseBean sysUserUpdate(@PathVariable Integer id,
96
+                                        @RequestBody SysUser sysUser) throws Exception{
97
+
98
+        if (iSysUserService.updateById(sysUser)){
99
+            return ResponseBean.success(sysUser);
100
+        }else {
101
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
102
+        }
103
+    }
104
+
105
+    /**
106
+     * 根据id查询对象
107
+     * @param id  实体ID
108
+     */
109
+    @RequestMapping(value="/sysUser/{id}",method= RequestMethod.GET)
110
+    public ResponseBean sysUserGet(@PathVariable Integer id) throws Exception{
111
+        return ResponseBean.success(iSysUserService.getById(id));
112
+    }
113
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaActivityController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaActivityService;
18
+import com.yunzhi.liyuanhui.entity.TaActivity;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 活动 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaActivityController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaActivityController.class);
34
+
35
+    @Autowired
36
+    public ITaActivityService iTaActivityService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taActivity",method= RequestMethod.GET)
46
+    public ResponseBean taActivityList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                       @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaActivity> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaActivity> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaActivity> result = iTaActivityService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taActivity 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taActivity",method= RequestMethod.POST)
63
+    public ResponseBean taActivityAdd(@RequestBody TaActivity taActivity) throws Exception{
64
+
65
+        if (iTaActivityService.save(taActivity)){
66
+            return ResponseBean.success(taActivity);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taActivity/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taActivityDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaActivityService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taActivity 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taActivity/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taActivityUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaActivity taActivity) throws Exception{
96
+
97
+        if (iTaActivityService.updateById(taActivity)){
98
+            return ResponseBean.success(taActivity);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taActivity/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taActivityGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaActivityService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaActivityEnrollController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaActivityEnrollService;
18
+import com.yunzhi.liyuanhui.entity.TaActivityEnroll;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 活动报名 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaActivityEnrollController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaActivityEnrollController.class);
34
+
35
+    @Autowired
36
+    public ITaActivityEnrollService iTaActivityEnrollService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taActivityEnroll",method= RequestMethod.GET)
46
+    public ResponseBean taActivityEnrollList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                             @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaActivityEnroll> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaActivityEnroll> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaActivityEnroll> result = iTaActivityEnrollService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taActivityEnroll 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taActivityEnroll",method= RequestMethod.POST)
63
+    public ResponseBean taActivityEnrollAdd(@RequestBody TaActivityEnroll taActivityEnroll) throws Exception{
64
+
65
+        if (iTaActivityEnrollService.save(taActivityEnroll)){
66
+            return ResponseBean.success(taActivityEnroll);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taActivityEnroll/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taActivityEnrollDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaActivityEnrollService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taActivityEnroll 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taActivityEnroll/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taActivityEnrollUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaActivityEnroll taActivityEnroll) throws Exception{
96
+
97
+        if (iTaActivityEnrollService.updateById(taActivityEnroll)){
98
+            return ResponseBean.success(taActivityEnroll);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taActivityEnroll/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taActivityEnrollGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaActivityEnrollService.getById(id));
111
+    }
112
+}

+ 113
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaActivityVoteController.java 查看文件

@@ -0,0 +1,113 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.api.R;
6
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
7
+import com.yunzhi.liyuanhui.common.BaseController;
8
+import com.yunzhi.liyuanhui.common.ResponseBean;
9
+import org.slf4j.Logger;
10
+import org.slf4j.LoggerFactory;
11
+import org.springframework.beans.factory.annotation.Autowired;
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.ResponseBody;
18
+import com.yunzhi.liyuanhui.service.ITaActivityVoteService;
19
+import com.yunzhi.liyuanhui.entity.TaActivityVote;
20
+import org.springframework.web.bind.annotation.RestController;
21
+
22
+/**
23
+ * <p>
24
+    * 活动投票 前端控制器
25
+    * </p>
26
+ *
27
+ * @author yansen
28
+ * @since 2020-08-08
29
+ */
30
+@RestController
31
+@RequestMapping("/")
32
+public class TaActivityVoteController extends BaseController {
33
+
34
+    private final Logger logger = LoggerFactory.getLogger(TaActivityVoteController.class);
35
+
36
+    @Autowired
37
+    public ITaActivityVoteService iTaActivityVoteService;
38
+
39
+
40
+    /**
41
+     * 分页查询列表
42
+     * @param pageNum
43
+     * @param pageSize
44
+     * @return
45
+     */
46
+    @RequestMapping(value="/taActivityVote",method= RequestMethod.GET)
47
+    public ResponseBean taActivityVoteList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
48
+                                           @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
49
+
50
+        IPage<TaActivityVote> pg = new Page<>(pageNum, pageSize);
51
+        QueryWrapper<TaActivityVote> queryWrapper = new QueryWrapper<>();
52
+        queryWrapper.orderByDesc("create_date");
53
+
54
+        IPage<TaActivityVote> result = iTaActivityVoteService.page(pg, queryWrapper);
55
+        return ResponseBean.success(result);
56
+    }
57
+
58
+    /**
59
+     * 保存对象
60
+     * @param taActivityVote 实体对象
61
+     * @return
62
+     */
63
+    @RequestMapping(value="/taActivityVote",method= RequestMethod.POST)
64
+    public ResponseBean taActivityVoteAdd(@RequestBody TaActivityVote taActivityVote) throws Exception{
65
+
66
+        if (iTaActivityVoteService.save(taActivityVote)){
67
+            return ResponseBean.success(taActivityVote);
68
+        }else {
69
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
70
+        }
71
+    }
72
+
73
+    /**
74
+     * 根据id删除对象
75
+     * @param id  实体ID
76
+     */
77
+    @ResponseBody
78
+    @RequestMapping(value="/taActivityVote/{id}", method= RequestMethod.DELETE)
79
+    public ResponseBean taActivityVoteDelete(@PathVariable Integer id) throws Exception{
80
+
81
+        if(iTaActivityVoteService.removeById(id)){
82
+            return ResponseBean.success("success");
83
+        }else {
84
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
85
+        }
86
+    }
87
+
88
+    /**
89
+     * 修改对象
90
+     * @param id  实体ID
91
+     * @param taActivityVote 实体对象
92
+     * @return
93
+     */
94
+    @RequestMapping(value="/taActivityVote/{id}",method= RequestMethod.PUT)
95
+    public ResponseBean taActivityVoteUpdate(@PathVariable Integer id,
96
+                                        @RequestBody TaActivityVote taActivityVote) throws Exception{
97
+
98
+        if (iTaActivityVoteService.updateById(taActivityVote)){
99
+            return ResponseBean.success(taActivityVote);
100
+        }else {
101
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
102
+        }
103
+    }
104
+
105
+    /**
106
+     * 根据id查询对象
107
+     * @param id  实体ID
108
+     */
109
+    @RequestMapping(value="/taActivityVote/{id}",method= RequestMethod.GET)
110
+    public ResponseBean taActivityVoteGet(@PathVariable Integer id) throws Exception{
111
+        return ResponseBean.success(iTaActivityVoteService.getById(id));
112
+    }
113
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaGalleryController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaGalleryService;
18
+import com.yunzhi.liyuanhui.entity.TaGallery;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 照片墙 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaGalleryController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaGalleryController.class);
34
+
35
+    @Autowired
36
+    public ITaGalleryService iTaGalleryService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taGallery",method= RequestMethod.GET)
46
+    public ResponseBean taGalleryList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                      @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaGallery> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaGallery> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaGallery> result = iTaGalleryService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taGallery 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taGallery",method= RequestMethod.POST)
63
+    public ResponseBean taGalleryAdd(@RequestBody TaGallery taGallery) throws Exception{
64
+
65
+        if (iTaGalleryService.save(taGallery)){
66
+            return ResponseBean.success(taGallery);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taGallery/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taGalleryDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaGalleryService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taGallery 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taGallery/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taGalleryUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaGallery taGallery) throws Exception{
96
+
97
+        if (iTaGalleryService.updateById(taGallery)){
98
+            return ResponseBean.success(taGallery);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taGallery/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taGalleryGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaGalleryService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaNewsController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaNewsService;
18
+import com.yunzhi.liyuanhui.entity.TaNews;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 资讯 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaNewsController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaNewsController.class);
34
+
35
+    @Autowired
36
+    public ITaNewsService iTaNewsService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taNews",method= RequestMethod.GET)
46
+    public ResponseBean taNewsList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                   @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaNews> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaNews> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaNews> result = iTaNewsService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taNews 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taNews",method= RequestMethod.POST)
63
+    public ResponseBean taNewsAdd(@RequestBody TaNews taNews) throws Exception{
64
+
65
+        if (iTaNewsService.save(taNews)){
66
+            return ResponseBean.success(taNews);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taNews/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taNewsDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaNewsService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taNews 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taNews/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taNewsUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaNews taNews) throws Exception{
96
+
97
+        if (iTaNewsService.updateById(taNews)){
98
+            return ResponseBean.success(taNews);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taNews/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taNewsGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaNewsService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaPersonController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaPersonService;
18
+import com.yunzhi.liyuanhui.entity.TaPerson;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 用户 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaPersonController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaPersonController.class);
34
+
35
+    @Autowired
36
+    public ITaPersonService iTaPersonService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taPerson",method= RequestMethod.GET)
46
+    public ResponseBean taPersonList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                     @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaPerson> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaPerson> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaPerson> result = iTaPersonService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taPerson 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taPerson",method= RequestMethod.POST)
63
+    public ResponseBean taPersonAdd(@RequestBody TaPerson taPerson) throws Exception{
64
+
65
+        if (iTaPersonService.save(taPerson)){
66
+            return ResponseBean.success(taPerson);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taPerson/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taPersonDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaPersonService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taPerson 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taPerson/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taPersonUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaPerson taPerson) throws Exception{
96
+
97
+        if (iTaPersonService.updateById(taPerson)){
98
+            return ResponseBean.success(taPerson);
99
+        }else {
100
+            return ResponseBean.error("修改失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taPerson/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taPersonGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaPersonService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaRecommendSettingController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaRecommendSettingService;
18
+import com.yunzhi.liyuanhui.entity.TaRecommendSetting;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 推荐设置 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaRecommendSettingController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaRecommendSettingController.class);
34
+
35
+    @Autowired
36
+    public ITaRecommendSettingService iTaRecommendSettingService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taRecommendSetting",method= RequestMethod.GET)
46
+    public ResponseBean taRecommendSettingList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                               @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaRecommendSetting> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaRecommendSetting> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaRecommendSetting> result = iTaRecommendSettingService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taRecommendSetting 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taRecommendSetting",method= RequestMethod.POST)
63
+    public ResponseBean taRecommendSettingAdd(@RequestBody TaRecommendSetting taRecommendSetting) throws Exception{
64
+
65
+        if (iTaRecommendSettingService.save(taRecommendSetting)){
66
+            return ResponseBean.success(taRecommendSetting);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taRecommendSetting/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taRecommendSettingDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaRecommendSettingService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taRecommendSetting 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taRecommendSetting/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taRecommendSettingUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaRecommendSetting taRecommendSetting) throws Exception{
96
+
97
+        if (iTaRecommendSettingService.updateById(taRecommendSetting)){
98
+            return ResponseBean.success(taRecommendSetting);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taRecommendSetting/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taRecommendSettingGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaRecommendSettingService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TaRecommenderController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITaRecommenderService;
18
+import com.yunzhi.liyuanhui.entity.TaRecommender;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 推荐表 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TaRecommenderController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TaRecommenderController.class);
34
+
35
+    @Autowired
36
+    public ITaRecommenderService iTaRecommenderService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/taRecommender",method= RequestMethod.GET)
46
+    public ResponseBean taRecommenderList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                          @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TaRecommender> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TaRecommender> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TaRecommender> result = iTaRecommenderService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param taRecommender 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/taRecommender",method= RequestMethod.POST)
63
+    public ResponseBean taRecommenderAdd(@RequestBody TaRecommender taRecommender) throws Exception{
64
+
65
+        if (iTaRecommenderService.save(taRecommender)){
66
+            return ResponseBean.success(taRecommender);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/taRecommender/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean taRecommenderDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTaRecommenderService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param taRecommender 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/taRecommender/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean taRecommenderUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TaRecommender taRecommender) throws Exception{
96
+
97
+        if (iTaRecommenderService.updateById(taRecommender)){
98
+            return ResponseBean.success(taRecommender);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/taRecommender/{id}",method= RequestMethod.GET)
109
+    public ResponseBean taRecommenderGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTaRecommenderService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TdActivityTypeController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITdActivityTypeService;
18
+import com.yunzhi.liyuanhui.entity.TdActivityType;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 活动类型 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TdActivityTypeController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TdActivityTypeController.class);
34
+
35
+    @Autowired
36
+    public ITdActivityTypeService iTdActivityTypeService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/tdActivityType",method= RequestMethod.GET)
46
+    public ResponseBean tdActivityTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+                                           @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TdActivityType> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TdActivityType> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TdActivityType> result = iTdActivityTypeService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param tdActivityType 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/tdActivityType",method= RequestMethod.POST)
63
+    public ResponseBean tdActivityTypeAdd(@RequestBody TdActivityType tdActivityType) throws Exception{
64
+
65
+        if (iTdActivityTypeService.save(tdActivityType)){
66
+            return ResponseBean.success(tdActivityType);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/tdActivityType/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean tdActivityTypeDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTdActivityTypeService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param tdActivityType 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/tdActivityType/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean tdActivityTypeUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TdActivityType tdActivityType) throws Exception{
96
+
97
+        if (iTdActivityTypeService.updateById(tdActivityType)){
98
+            return ResponseBean.success(tdActivityType);
99
+        }else {
100
+            return ResponseBean.error("修改失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/tdActivityType/{id}",method= RequestMethod.GET)
109
+    public ResponseBean tdActivityTypeGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTdActivityTypeService.getById(id));
111
+    }
112
+}

+ 112
- 0
src/main/java/com/yunzhi/liyuanhui/controller/TdNewsTypeController.java 查看文件

@@ -0,0 +1,112 @@
1
+package com.yunzhi.liyuanhui.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.yunzhi.liyuanhui.common.BaseController;
7
+import com.yunzhi.liyuanhui.common.ResponseBean;
8
+import org.slf4j.Logger;
9
+import org.slf4j.LoggerFactory;
10
+import org.springframework.beans.factory.annotation.Autowired;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RequestParam;
16
+import org.springframework.web.bind.annotation.ResponseBody;
17
+import com.yunzhi.liyuanhui.service.ITdNewsTypeService;
18
+import com.yunzhi.liyuanhui.entity.TdNewsType;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
21
+/**
22
+ * <p>
23
+    * 资讯类型 前端控制器
24
+    * </p>
25
+ *
26
+ * @author yansen
27
+ * @since 2020-08-08
28
+ */
29
+@RestController
30
+@RequestMapping("/")
31
+public class TdNewsTypeController extends BaseController {
32
+
33
+    private final Logger logger = LoggerFactory.getLogger(TdNewsTypeController.class);
34
+
35
+    @Autowired
36
+    public ITdNewsTypeService iTdNewsTypeService;
37
+
38
+
39
+    /**
40
+     * 分页查询列表
41
+     * @param pageNum
42
+     * @param pageSize
43
+     * @return
44
+     */
45
+    @RequestMapping(value="/tdNewsType",method= RequestMethod.GET)
46
+    public ResponseBean tdNewsTypeList(@RequestParam(value ="pageNum",defaultValue = "1") Integer pageNum,
47
+									 @RequestParam(value ="pageSize",defaultValue = "10") Integer pageSize) throws Exception{
48
+
49
+        IPage<TdNewsType> pg = new Page<>(pageNum, pageSize);
50
+        QueryWrapper<TdNewsType> queryWrapper = new QueryWrapper<>();
51
+        queryWrapper.orderByDesc("create_date");
52
+
53
+        IPage<TdNewsType> result = iTdNewsTypeService.page(pg, queryWrapper);
54
+        return ResponseBean.success(result);
55
+    }
56
+
57
+    /**
58
+     * 保存对象
59
+     * @param tdNewsType 实体对象
60
+     * @return
61
+     */
62
+    @RequestMapping(value="/tdNewsType",method= RequestMethod.POST)
63
+    public ResponseBean tdNewsTypeAdd(@RequestBody TdNewsType tdNewsType) throws Exception{
64
+
65
+        if (iTdNewsTypeService.save(tdNewsType)){
66
+            return ResponseBean.success(tdNewsType);
67
+        }else {
68
+            return ResponseBean.error("保存失败", ResponseBean.ERROR_UNAVAILABLE);
69
+        }
70
+    }
71
+
72
+    /**
73
+     * 根据id删除对象
74
+     * @param id  实体ID
75
+     */
76
+    @ResponseBody
77
+    @RequestMapping(value="/tdNewsType/{id}", method= RequestMethod.DELETE)
78
+    public ResponseBean tdNewsTypeDelete(@PathVariable Integer id) throws Exception{
79
+
80
+        if(iTdNewsTypeService.removeById(id)){
81
+            return ResponseBean.success("success");
82
+        }else {
83
+            return ResponseBean.error("删除失败", ResponseBean.ERROR_UNAVAILABLE);
84
+        }
85
+    }
86
+
87
+    /**
88
+     * 修改对象
89
+     * @param id  实体ID
90
+     * @param tdNewsType 实体对象
91
+     * @return
92
+     */
93
+    @RequestMapping(value="/tdNewsType/{id}",method= RequestMethod.PUT)
94
+    public ResponseBean tdNewsTypeUpdate(@PathVariable Integer id,
95
+                                        @RequestBody TdNewsType tdNewsType) throws Exception{
96
+
97
+        if (iTdNewsTypeService.updateById(tdNewsType)){
98
+            return ResponseBean.success(tdNewsType);
99
+        }else {
100
+            return ResponseBean.error("更新失败", ResponseBean.ERROR_UNAVAILABLE);
101
+        }
102
+    }
103
+
104
+    /**
105
+     * 根据id查询对象
106
+     * @param id  实体ID
107
+     */
108
+    @RequestMapping(value="/tdNewsType/{id}",method= RequestMethod.GET)
109
+    public ResponseBean tdNewsTypeGet(@PathVariable Integer id) throws Exception{
110
+        return ResponseBean.success(iTdNewsTypeService.getById(id));
111
+    }
112
+}

+ 44
- 0
src/main/java/com/yunzhi/liyuanhui/entity/SysModule.java 查看文件

@@ -0,0 +1,44 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import java.io.Serializable;
4
+import lombok.Data;
5
+import lombok.EqualsAndHashCode;
6
+import lombok.experimental.Accessors;
7
+
8
+/**
9
+ * <p>
10
+ * 模块
11
+ * </p>
12
+ *
13
+ * @author yansen
14
+ * @since 2020-08-08
15
+ */
16
+@Data
17
+@EqualsAndHashCode(callSuper = false)
18
+@Accessors(chain = true)
19
+public class SysModule implements Serializable {
20
+
21
+    private static final long serialVersionUID = 1L;
22
+
23
+    /**
24
+     * 模块编码
25
+     */
26
+    private String moduleCode;
27
+
28
+    /**
29
+     * 名称
30
+     */
31
+    private String name;
32
+
33
+    /**
34
+     * 图标
35
+     */
36
+    private String icon;
37
+
38
+    /**
39
+     * 状态
40
+     */
41
+    private Integer status;
42
+
43
+
44
+}

+ 59
- 0
src/main/java/com/yunzhi/liyuanhui/entity/SysUser.java 查看文件

@@ -0,0 +1,59 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
5
+import com.baomidou.mybatisplus.annotation.TableId;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 系统用户
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class SysUser implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 用户ID
28
+     */
29
+    @TableId(value = "user_id", type = IdType.AUTO)
30
+    private Integer userId;
31
+
32
+    /**
33
+     * 用户名
34
+     */
35
+    private String name;
36
+
37
+    /**
38
+     * 登录名
39
+     */
40
+    private String loginName;
41
+
42
+    /**
43
+     * 登录密码
44
+     */
45
+    private String password;
46
+
47
+    /**
48
+     * 头像
49
+     */
50
+    private String avatar;
51
+
52
+    /**
53
+     * 状态
54
+     */
55
+    private Integer status;
56
+
57
+    @TableField(exist = false)
58
+    private String token;
59
+}

+ 143
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaActivity.java 查看文件

@@ -0,0 +1,143 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 活动
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaActivity implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 活动ID
28
+     */
29
+    @TableId(value = "activity_id", type = IdType.AUTO)
30
+    private Integer activityId;
31
+
32
+    /**
33
+     * 名称
34
+     */
35
+    private String name;
36
+
37
+    /**
38
+     * 活动类型ID
39
+     */
40
+    private Integer typeId;
41
+
42
+    /**
43
+     * 活动类型名称
44
+     */
45
+    private String typeName;
46
+
47
+    /**
48
+     * 简述
49
+     */
50
+    private String summary;
51
+
52
+    /**
53
+     * 开始时间
54
+     */
55
+    private LocalDateTime startDate;
56
+
57
+    /**
58
+     * 结束时间
59
+     */
60
+    private LocalDateTime endDate;
61
+
62
+    /**
63
+     * 地点
64
+     */
65
+    private String address;
66
+
67
+    /**
68
+     * 报名开始
69
+     */
70
+    private LocalDateTime enrollStart;
71
+
72
+    /**
73
+     * 报名截止
74
+     */
75
+    private LocalDateTime enrollEnd;
76
+
77
+    /**
78
+     * 投票开始
79
+     */
80
+    private LocalDateTime voteStart;
81
+
82
+    /**
83
+     * 投票结束
84
+     */
85
+    private LocalDateTime voteEnd;
86
+
87
+    /**
88
+     * 创建时间
89
+     */
90
+    private LocalDateTime createDate;
91
+
92
+    /**
93
+     * 状态
94
+     */
95
+    private Integer status;
96
+
97
+    /**
98
+     * 封面
99
+     */
100
+    private String thumb;
101
+
102
+    /**
103
+     * 详情
104
+     */
105
+    private String detail;
106
+
107
+    /**
108
+     * 是否暖场
109
+     */
110
+    private Boolean isWarm;
111
+
112
+    /**
113
+     * 是否投票
114
+     */
115
+    private Boolean isVote;
116
+
117
+    /**
118
+     * 票数
119
+     */
120
+    private Integer voteNum;
121
+
122
+    /**
123
+     * 报名人数
124
+     */
125
+    private Integer enrollNum;
126
+
127
+    /**
128
+     * 分享图
129
+     */
130
+    private String shareImg;
131
+
132
+    /**
133
+     * 分享标题
134
+     */
135
+    private String shareTitle;
136
+
137
+    /**
138
+     * 权重
139
+     */
140
+    private Integer weight;
141
+
142
+
143
+}

+ 88
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaActivityEnroll.java 查看文件

@@ -0,0 +1,88 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 活动报名
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaActivityEnroll implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 序号
28
+     */
29
+    @TableId(value = "serial_no", type = IdType.AUTO)
30
+    private Integer serialNo;
31
+
32
+    /**
33
+     * 活动ID
34
+     */
35
+    private Integer activityId;
36
+
37
+    /**
38
+     * 活动名称
39
+     */
40
+    private String activityName;
41
+
42
+    /**
43
+     * 活动封面
44
+     */
45
+    private String activityThumb;
46
+
47
+    /**
48
+     * 活动类型ID
49
+     */
50
+    private Integer activityTypeId;
51
+
52
+    /**
53
+     * 活动类型名称
54
+     */
55
+    private String activityTypeName;
56
+
57
+    /**
58
+     * 报名人
59
+     */
60
+    private Integer personId;
61
+
62
+    /**
63
+     * 名称
64
+     */
65
+    private String personName;
66
+
67
+    /**
68
+     * 昵称
69
+     */
70
+    private String personNickname;
71
+
72
+    /**
73
+     * 头像
74
+     */
75
+    private String personAvatar;
76
+
77
+    /**
78
+     * 手机号
79
+     */
80
+    private String phone;
81
+
82
+    /**
83
+     * 报名时间
84
+     */
85
+    private LocalDateTime createDate;
86
+
87
+
88
+}

+ 78
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaActivityVote.java 查看文件

@@ -0,0 +1,78 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 活动投票
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaActivityVote implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 序号
28
+     */
29
+    @TableId(value = "serial_no", type = IdType.AUTO)
30
+    private Integer serialNo;
31
+
32
+    /**
33
+     * 活动ID
34
+     */
35
+    private Integer activityId;
36
+
37
+    /**
38
+     * 活动名称
39
+     */
40
+    private String activityName;
41
+
42
+    /**
43
+     * 活动封面
44
+     */
45
+    private String activityThumb;
46
+
47
+    /**
48
+     * 报名人
49
+     */
50
+    private Integer personId;
51
+
52
+    /**
53
+     * 名称
54
+     */
55
+    private String personName;
56
+
57
+    /**
58
+     * 昵称
59
+     */
60
+    private String personNickname;
61
+
62
+    /**
63
+     * 头像
64
+     */
65
+    private String personAvatar;
66
+
67
+    /**
68
+     * 手机号
69
+     */
70
+    private String phone;
71
+
72
+    /**
73
+     * 投票时间
74
+     */
75
+    private LocalDateTime createDate;
76
+
77
+
78
+}

+ 63
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaGallery.java 查看文件

@@ -0,0 +1,63 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 照片墙
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaGallery implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 照片ID
28
+     */
29
+    @TableId(value = "img_id", type = IdType.AUTO)
30
+    private Integer imgId;
31
+
32
+    /**
33
+     * 描述
34
+     */
35
+    private String desc;
36
+
37
+    /**
38
+     * 关联活动
39
+     */
40
+    private String activityId;
41
+
42
+    /**
43
+     * 分类
44
+     */
45
+    private String imgType;
46
+
47
+    /**
48
+     * 排序
49
+     */
50
+    private Integer sortNo;
51
+
52
+    /**
53
+     * 状态
54
+     */
55
+    private Integer status;
56
+
57
+    /**
58
+     * 上传日期
59
+     */
60
+    private LocalDateTime createDate;
61
+
62
+
63
+}

+ 83
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaNews.java 查看文件

@@ -0,0 +1,83 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 资讯
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaNews implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 资讯ID
28
+     */
29
+    @TableId(value = "news_id", type = IdType.AUTO)
30
+    private Integer newsId;
31
+
32
+    /**
33
+     * 标题
34
+     */
35
+    private String title;
36
+
37
+    /**
38
+     * 发布人
39
+     */
40
+    private String publisher;
41
+
42
+    /**
43
+     * 发布时间
44
+     */
45
+    private String publishDate;
46
+
47
+    /**
48
+     * 封面
49
+     */
50
+    private String thumb;
51
+
52
+    /**
53
+     * 内容
54
+     */
55
+    private String content;
56
+
57
+    /**
58
+     * 状态
59
+     */
60
+    private Integer status;
61
+
62
+    /**
63
+     * 权重
64
+     */
65
+    private Integer weight;
66
+
67
+    /**
68
+     * 创建时间
69
+     */
70
+    private LocalDateTime createDate;
71
+
72
+    /**
73
+     * 所属分类
74
+     */
75
+    private Integer typeId;
76
+
77
+    /**
78
+     * 分类名称
79
+     */
80
+    private String typeName;
81
+
82
+
83
+}

+ 83
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaPerson.java 查看文件

@@ -0,0 +1,83 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 用户
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaPerson implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 人员ID
28
+     */
29
+    @TableId(value = "person_id", type = IdType.AUTO)
30
+    private Integer personId;
31
+
32
+    /**
33
+     * openid
34
+     */
35
+    private String openid;
36
+
37
+    /**
38
+     * 姓名
39
+     */
40
+    private String name;
41
+
42
+    /**
43
+     * 昵称
44
+     */
45
+    private String nickname;
46
+
47
+    /**
48
+     * 头像
49
+     */
50
+    private String avatar;
51
+
52
+    /**
53
+     * 电话
54
+     */
55
+    private String phone;
56
+
57
+    /**
58
+     * 性别
59
+     */
60
+    private Integer sex;
61
+
62
+    /**
63
+     * 创建时间
64
+     */
65
+    private LocalDateTime createDate;
66
+
67
+    /**
68
+     * 推荐人
69
+     */
70
+    private Integer recommender;
71
+
72
+    /**
73
+     * 推荐时间
74
+     */
75
+    private LocalDateTime recDate;
76
+
77
+    /**
78
+     * 状态
79
+     */
80
+    private Integer status;
81
+
82
+
83
+}

+ 47
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaRecommendSetting.java 查看文件

@@ -0,0 +1,47 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 推荐设置
13
+ * </p>
14
+ *
15
+ * @author yansen
16
+ * @since 2020-08-08
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+public class TaRecommendSetting implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 序号
27
+     */
28
+    @TableId(value = "serial_no", type = IdType.AUTO)
29
+    private Integer serialNo;
30
+
31
+    /**
32
+     * 名称
33
+     */
34
+    private String name;
35
+
36
+    /**
37
+     * 宣传图片
38
+     */
39
+    private String adImg;
40
+
41
+    /**
42
+     * 宣传说明
43
+     */
44
+    private String desc;
45
+
46
+
47
+}

+ 68
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TaRecommender.java 查看文件

@@ -0,0 +1,68 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.time.LocalDateTime;
6
+import java.io.Serializable;
7
+import lombok.Data;
8
+import lombok.EqualsAndHashCode;
9
+import lombok.experimental.Accessors;
10
+
11
+/**
12
+ * <p>
13
+ * 推荐表
14
+ * </p>
15
+ *
16
+ * @author yansen
17
+ * @since 2020-08-08
18
+ */
19
+@Data
20
+@EqualsAndHashCode(callSuper = false)
21
+@Accessors(chain = true)
22
+public class TaRecommender implements Serializable {
23
+
24
+    private static final long serialVersionUID = 1L;
25
+
26
+    /**
27
+     * 序号
28
+     */
29
+    @TableId(value = "serial_no", type = IdType.AUTO)
30
+    private Integer serialNo;
31
+
32
+    /**
33
+     * 推荐人
34
+     */
35
+    private Integer personId;
36
+
37
+    /**
38
+     * 名称
39
+     */
40
+    private String name;
41
+
42
+    /**
43
+     * 电话
44
+     */
45
+    private String phone;
46
+
47
+    /**
48
+     * 性别
49
+     */
50
+    private String sex;
51
+
52
+    /**
53
+     * 备注
54
+     */
55
+    private String remark;
56
+
57
+    /**
58
+     * 推荐时间
59
+     */
60
+    private LocalDateTime createDate;
61
+
62
+    /**
63
+     * 状态
64
+     */
65
+    private Integer status;
66
+
67
+
68
+}

+ 62
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TdActivityType.java 查看文件

@@ -0,0 +1,62 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 活动类型
13
+ * </p>
14
+ *
15
+ * @author yansen
16
+ * @since 2020-08-08
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+public class TdActivityType implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 类型ID
27
+     */
28
+    @TableId(value = "type_id", type = IdType.AUTO)
29
+    private Integer typeId;
30
+
31
+    /**
32
+     * 名称
33
+     */
34
+    private String name;
35
+
36
+    /**
37
+     * 描述
38
+     */
39
+    private String desc;
40
+
41
+    /**
42
+     * 图标
43
+     */
44
+    private String icon;
45
+
46
+    /**
47
+     * 状态
48
+     */
49
+    private Integer status;
50
+
51
+    /**
52
+     * 排序
53
+     */
54
+    private Integer sortNo;
55
+
56
+    /**
57
+     * 所属模块
58
+     */
59
+    private String moduleCode;
60
+
61
+
62
+}

+ 62
- 0
src/main/java/com/yunzhi/liyuanhui/entity/TdNewsType.java 查看文件

@@ -0,0 +1,62 @@
1
+package com.yunzhi.liyuanhui.entity;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import java.io.Serializable;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+/**
11
+ * <p>
12
+ * 资讯类型
13
+ * </p>
14
+ *
15
+ * @author yansen
16
+ * @since 2020-08-08
17
+ */
18
+@Data
19
+@EqualsAndHashCode(callSuper = false)
20
+@Accessors(chain = true)
21
+public class TdNewsType implements Serializable {
22
+
23
+    private static final long serialVersionUID = 1L;
24
+
25
+    /**
26
+     * 类型ID
27
+     */
28
+    @TableId(value = "type_id", type = IdType.AUTO)
29
+    private Integer typeId;
30
+
31
+    /**
32
+     * 名称
33
+     */
34
+    private String name;
35
+
36
+    /**
37
+     * 描述
38
+     */
39
+    private String desc;
40
+
41
+    /**
42
+     * 图标
43
+     */
44
+    private String icon;
45
+
46
+    /**
47
+     * 状态
48
+     */
49
+    private Integer status;
50
+
51
+    /**
52
+     * 排序
53
+     */
54
+    private Integer sortNo;
55
+
56
+    /**
57
+     * 所属模块
58
+     */
59
+    private String moduleCode;
60
+
61
+
62
+}

+ 19
- 0
src/main/java/com/yunzhi/liyuanhui/exception/GlobalExceptionHandler.java 查看文件

@@ -0,0 +1,19 @@
1
+package com.yunzhi.liyuanhui.exception;
2
+
3
+import com.yunzhi.liyuanhui.common.ResponseBean;
4
+import lombok.extern.slf4j.Slf4j;
5
+import org.springframework.web.bind.annotation.ExceptionHandler;
6
+import org.springframework.web.bind.annotation.ResponseBody;
7
+import org.springframework.web.bind.annotation.RestControllerAdvice;
8
+
9
+@Slf4j
10
+@RestControllerAdvice
11
+public class GlobalExceptionHandler {
12
+
13
+    @ResponseBody
14
+    @ExceptionHandler(Exception.class)
15
+    public ResponseBean handleException(Exception e){
16
+        log.error(e.getMessage(),e);
17
+        return ResponseBean.error(e.getMessage(), ResponseBean.ERROR_UNAVAILABLE);
18
+    }
19
+}

+ 45
- 0
src/main/java/com/yunzhi/liyuanhui/interceptor/PermissionInterceptor.java 查看文件

@@ -1,12 +1,57 @@
1 1
 package com.yunzhi.liyuanhui.interceptor;
2 2
 
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.yunzhi.liyuanhui.common.JWTUtils;
5
+import com.yunzhi.liyuanhui.common.ResponseBean;
6
+import com.yunzhi.liyuanhui.common.StringUtils;
3 7
 import lombok.extern.slf4j.Slf4j;
4 8
 import org.springframework.stereotype.Component;
5 9
 import org.springframework.web.servlet.HandlerInterceptor;
10
+import org.springframework.web.servlet.ModelAndView;
11
+
12
+import javax.servlet.http.HttpServletRequest;
13
+import javax.servlet.http.HttpServletResponse;
14
+import java.io.IOException;
6 15
 
7 16
 
8 17
 @Slf4j
9 18
 @Component
10 19
 public class PermissionInterceptor implements HandlerInterceptor {
11 20
 
21
+    @Override
22
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception {
23
+        log.info("Request URI: {}", request.getRequestURI());
24
+
25
+        // JWT
26
+        String jws = JWTUtils.getToken(request);
27
+        if (StringUtils.isEmpty(jws)) {
28
+            responseTokenError(response, "鉴权失败, 请先进行登录操作");
29
+            return false;
30
+        }
31
+
32
+        try {
33
+            JWTUtils.verify(jws);
34
+        } catch (Exception e) {
35
+            log.error("鉴权失败: {}", e.getMessage());
36
+            responseTokenError(response, "鉴权失败, 请重新登录");
37
+            return false;
38
+        }
39
+
40
+        return true;
41
+    }
42
+
43
+    @Override
44
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object obj, ModelAndView mv) throws Exception {
45
+        // 刷新 TOKEN
46
+        String jws = JWTUtils.getToken(request);
47
+        JWTUtils.refresh(jws, response);
48
+    }
49
+
50
+    private void responseTokenError(HttpServletResponse response, String error) throws IOException {
51
+        response.addHeader("Content-type", "application/json");
52
+        response.getOutputStream().write(
53
+                JSONObject.toJSONBytes(
54
+                        ResponseBean.error(error, ResponseBean.ERROR_AUTH_FAIL)
55
+                ));
56
+    }
12 57
 }

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/SysModuleMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.SysModule;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 模块 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface SysModuleMapper extends BaseMapper<SysModule> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/SysUserMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.SysUser;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 系统用户 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface SysUserMapper extends BaseMapper<SysUser> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityEnrollMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityEnroll;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 活动报名 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaActivityEnrollMapper extends BaseMapper<TaActivityEnroll> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivity;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 活动 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaActivityMapper extends BaseMapper<TaActivity> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaActivityVoteMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityVote;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 活动投票 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaActivityVoteMapper extends BaseMapper<TaActivityVote> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaGalleryMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaGallery;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 照片墙 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaGalleryMapper extends BaseMapper<TaGallery> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaNewsMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaNews;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 资讯 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaNewsMapper extends BaseMapper<TaNews> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaPersonMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaPerson;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 用户 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaPersonMapper extends BaseMapper<TaPerson> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaRecommendSettingMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommendSetting;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 推荐设置 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaRecommendSettingMapper extends BaseMapper<TaRecommendSetting> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TaRecommenderMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommender;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 推荐表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TaRecommenderMapper extends BaseMapper<TaRecommender> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TdActivityTypeMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdActivityType;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 活动类型 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TdActivityTypeMapper extends BaseMapper<TdActivityType> {
17
+
18
+}

+ 18
- 0
src/main/java/com/yunzhi/liyuanhui/mapper/TdNewsTypeMapper.java 查看文件

@@ -0,0 +1,18 @@
1
+package com.yunzhi.liyuanhui.mapper;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdNewsType;
4
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 资讯类型 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author yansen
13
+ * @since 2020-08-08
14
+ */
15
+@Mapper
16
+public interface TdNewsTypeMapper extends BaseMapper<TdNewsType> {
17
+
18
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ISysModuleService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.SysModule;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 模块 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ISysModuleService extends IService<SysModule> {
15
+
16
+}

+ 19
- 0
src/main/java/com/yunzhi/liyuanhui/service/ISysUserService.java 查看文件

@@ -0,0 +1,19 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.SysUser;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 系统用户 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ISysUserService extends IService<SysUser> {
15
+
16
+    SysUser getLoginUser(String userName);
17
+
18
+    boolean checkStatus(SysUser sysUser);
19
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaActivityEnrollService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityEnroll;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 活动报名 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaActivityEnrollService extends IService<TaActivityEnroll> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaActivityService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivity;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 活动 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaActivityService extends IService<TaActivity> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaActivityVoteService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityVote;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 活动投票 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaActivityVoteService extends IService<TaActivityVote> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaGalleryService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaGallery;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 照片墙 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaGalleryService extends IService<TaGallery> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaNewsService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaNews;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 资讯 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaNewsService extends IService<TaNews> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaPersonService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaPerson;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 用户 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaPersonService extends IService<TaPerson> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaRecommendSettingService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommendSetting;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 推荐设置 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaRecommendSettingService extends IService<TaRecommendSetting> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITaRecommenderService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommender;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 推荐表 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITaRecommenderService extends IService<TaRecommender> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITdActivityTypeService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdActivityType;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 活动类型 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITdActivityTypeService extends IService<TdActivityType> {
15
+
16
+}

+ 16
- 0
src/main/java/com/yunzhi/liyuanhui/service/ITdNewsTypeService.java 查看文件

@@ -0,0 +1,16 @@
1
+package com.yunzhi.liyuanhui.service;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdNewsType;
4
+import com.baomidou.mybatisplus.extension.service.IService;
5
+
6
+/**
7
+ * <p>
8
+ * 资讯类型 服务类
9
+ * </p>
10
+ *
11
+ * @author yansen
12
+ * @since 2020-08-08
13
+ */
14
+public interface ITdNewsTypeService extends IService<TdNewsType> {
15
+
16
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/SysModuleServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.SysModule;
4
+import com.yunzhi.liyuanhui.mapper.SysModuleMapper;
5
+import com.yunzhi.liyuanhui.service.ISysModuleService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 模块 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class SysModuleServiceImpl extends ServiceImpl<SysModuleMapper, SysModule> implements ISysModuleService {
19
+
20
+}

+ 30
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/SysUserServiceImpl.java 查看文件

@@ -0,0 +1,30 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.yunzhi.liyuanhui.entity.SysUser;
5
+import com.yunzhi.liyuanhui.mapper.SysUserMapper;
6
+import com.yunzhi.liyuanhui.service.ISysUserService;
7
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
+import org.springframework.stereotype.Service;
9
+
10
+/**
11
+ * <p>
12
+ * 系统用户 服务实现类
13
+ * </p>
14
+ *
15
+ * @author yansen
16
+ * @since 2020-08-08
17
+ */
18
+@Service
19
+public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
20
+
21
+    @Override
22
+    public SysUser getLoginUser(String userName) {
23
+        return getOne(new QueryWrapper<SysUser>(new SysUser().setLoginName(userName)));
24
+    }
25
+
26
+    @Override
27
+    public boolean checkStatus(SysUser sysUser) {
28
+        return Integer.valueOf(1).equals(sysUser.getStatus());
29
+    }
30
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityEnrollServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityEnroll;
4
+import com.yunzhi.liyuanhui.mapper.TaActivityEnrollMapper;
5
+import com.yunzhi.liyuanhui.service.ITaActivityEnrollService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 活动报名 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaActivityEnrollServiceImpl extends ServiceImpl<TaActivityEnrollMapper, TaActivityEnroll> implements ITaActivityEnrollService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivity;
4
+import com.yunzhi.liyuanhui.mapper.TaActivityMapper;
5
+import com.yunzhi.liyuanhui.service.ITaActivityService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 活动 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaActivityServiceImpl extends ServiceImpl<TaActivityMapper, TaActivity> implements ITaActivityService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaActivityVoteServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaActivityVote;
4
+import com.yunzhi.liyuanhui.mapper.TaActivityVoteMapper;
5
+import com.yunzhi.liyuanhui.service.ITaActivityVoteService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 活动投票 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaActivityVoteServiceImpl extends ServiceImpl<TaActivityVoteMapper, TaActivityVote> implements ITaActivityVoteService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaGalleryServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaGallery;
4
+import com.yunzhi.liyuanhui.mapper.TaGalleryMapper;
5
+import com.yunzhi.liyuanhui.service.ITaGalleryService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 照片墙 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaGalleryServiceImpl extends ServiceImpl<TaGalleryMapper, TaGallery> implements ITaGalleryService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaNewsServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaNews;
4
+import com.yunzhi.liyuanhui.mapper.TaNewsMapper;
5
+import com.yunzhi.liyuanhui.service.ITaNewsService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 资讯 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaNewsServiceImpl extends ServiceImpl<TaNewsMapper, TaNews> implements ITaNewsService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaPersonServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaPerson;
4
+import com.yunzhi.liyuanhui.mapper.TaPersonMapper;
5
+import com.yunzhi.liyuanhui.service.ITaPersonService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 用户 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaPersonServiceImpl extends ServiceImpl<TaPersonMapper, TaPerson> implements ITaPersonService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaRecommendSettingServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommendSetting;
4
+import com.yunzhi.liyuanhui.mapper.TaRecommendSettingMapper;
5
+import com.yunzhi.liyuanhui.service.ITaRecommendSettingService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 推荐设置 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaRecommendSettingServiceImpl extends ServiceImpl<TaRecommendSettingMapper, TaRecommendSetting> implements ITaRecommendSettingService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TaRecommenderServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TaRecommender;
4
+import com.yunzhi.liyuanhui.mapper.TaRecommenderMapper;
5
+import com.yunzhi.liyuanhui.service.ITaRecommenderService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 推荐表 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TaRecommenderServiceImpl extends ServiceImpl<TaRecommenderMapper, TaRecommender> implements ITaRecommenderService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TdActivityTypeServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdActivityType;
4
+import com.yunzhi.liyuanhui.mapper.TdActivityTypeMapper;
5
+import com.yunzhi.liyuanhui.service.ITdActivityTypeService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 活动类型 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TdActivityTypeServiceImpl extends ServiceImpl<TdActivityTypeMapper, TdActivityType> implements ITdActivityTypeService {
19
+
20
+}

+ 20
- 0
src/main/java/com/yunzhi/liyuanhui/service/impl/TdNewsTypeServiceImpl.java 查看文件

@@ -0,0 +1,20 @@
1
+package com.yunzhi.liyuanhui.service.impl;
2
+
3
+import com.yunzhi.liyuanhui.entity.TdNewsType;
4
+import com.yunzhi.liyuanhui.mapper.TdNewsTypeMapper;
5
+import com.yunzhi.liyuanhui.service.ITdNewsTypeService;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import org.springframework.stereotype.Service;
8
+
9
+/**
10
+ * <p>
11
+ * 资讯类型 服务实现类
12
+ * </p>
13
+ *
14
+ * @author yansen
15
+ * @since 2020-08-08
16
+ */
17
+@Service
18
+public class TdNewsTypeServiceImpl extends ServiceImpl<TdNewsTypeMapper, TdNewsType> implements ITdNewsTypeService {
19
+
20
+}

+ 5
- 0
src/main/resources/application-dev.yml 查看文件

@@ -4,3 +4,8 @@ spring:
4 4
     url: jdbc:mysql://rm-uf6z3z6jq11x653d77o.mysql.rds.aliyuncs.com:3306/liyuanhui?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
5 5
     username: liyuanhui
6 6
     password: abcd@123456
7
+
8
+###
9
+logging:
10
+  level:
11
+    root: info

+ 1
- 1
src/main/resources/application.yml 查看文件

@@ -7,7 +7,7 @@ server:
7 7
 ###
8 8
 interceptor:
9 9
   permission:
10
-    enable: false
10
+    enable: true
11 11
     include-paths: /**
12 12
     exclude-paths: /login
13 13
 

+ 5
- 0
src/main/resources/mapper/SysModuleMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.SysModuleMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/SysUserMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.SysUserMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaActivityEnrollMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaActivityEnrollMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaActivityMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaActivityMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaActivityVoteMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaActivityVoteMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaGalleryMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaGalleryMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaNewsMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaNewsMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaPersonMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaPersonMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaRecommendSettingMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaRecommendSettingMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TaRecommenderMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TaRecommenderMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TdActivityTypeMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TdActivityTypeMapper">
4
+
5
+</mapper>

+ 5
- 0
src/main/resources/mapper/TdNewsTypeMapper.xml 查看文件

@@ -0,0 +1,5 @@
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.yunzhi.liyuanhui.mapper.TdNewsTypeMapper">
4
+
5
+</mapper>