├── .gitattributes
├── .gitignore
├── Jenkinsfile
├── README.md
├── build-resource
├── 201808022Dump.sql
├── proxy-cors.js
└── sauims20190502.sql
├── pom.xml
└── src
└── main
├── java
├── com
│ └── fekpal
│ │ ├── api
│ │ ├── AccountAccessService.java
│ │ ├── AccountSecureService.java
│ │ ├── AnniversaryAuditService.java
│ │ ├── ClubAuditService.java
│ │ ├── ClubLikeService.java
│ │ ├── ClubService.java
│ │ ├── LikeOrgService.java
│ │ ├── MemberOrgService.java
│ │ ├── MessageReceiveService.java
│ │ ├── MessageSendService.java
│ │ ├── OrgMemberAuditService.java
│ │ ├── OrgMemberService.java
│ │ ├── OrgService.java
│ │ ├── PersonService.java
│ │ ├── RegisterService.java
│ │ ├── SauAuditService.java
│ │ ├── SauService.java
│ │ └── UserService.java
│ │ ├── common
│ │ ├── base
│ │ │ ├── BaseMapper.java
│ │ │ ├── BaseModel.java
│ │ │ ├── BaseService.java
│ │ │ ├── BaseServiceImpl.java
│ │ │ ├── CRUDException.java
│ │ │ └── ExampleWrapper.java
│ │ ├── constant
│ │ │ ├── AuditState.java
│ │ │ ├── AvailableState.java
│ │ │ ├── ClubRole.java
│ │ │ ├── DefaultField.java
│ │ │ ├── FIleDefaultPath.java
│ │ │ ├── MemberState.java
│ │ │ ├── MessageType.java
│ │ │ ├── Operation.java
│ │ │ ├── Register.java
│ │ │ ├── ResponseCode.java
│ │ │ ├── SystemRole.java
│ │ │ └── WebAppPath.java
│ │ ├── exception
│ │ │ └── BusinessException.java
│ │ ├── json
│ │ │ └── JsonResult.java
│ │ ├── session
│ │ │ ├── SessionContent.java
│ │ │ └── SessionLocal.java
│ │ └── utils
│ │ │ ├── FileUtil.java
│ │ │ ├── IPUtil.java
│ │ │ ├── ImageFileUtil.java
│ │ │ ├── MD5Util.java
│ │ │ ├── RandomUtil.java
│ │ │ ├── RedisCache.java
│ │ │ ├── StringUtil.java
│ │ │ ├── TimeUtil.java
│ │ │ ├── WordFileUtil.java
│ │ │ ├── captcha
│ │ │ ├── Captcha.java
│ │ │ ├── CaptchaImgFont.java
│ │ │ └── CaptchaUtil.java
│ │ │ └── msg
│ │ │ ├── email
│ │ │ ├── EmailMsg.java
│ │ │ ├── EmailSender.java
│ │ │ └── EmailUtil.java
│ │ │ └── phone
│ │ │ ├── PhoneSender.java
│ │ │ └── PhoneUtils.java
│ │ ├── dao
│ │ ├── mapper
│ │ │ ├── AnniversaryAuditMapper.java
│ │ │ ├── AuditsViewMapper.java
│ │ │ ├── ClubAuditMapper.java
│ │ │ ├── LikeOrgMapper.java
│ │ │ ├── MemberMapper.java
│ │ │ ├── MemberOrgMapper.java
│ │ │ ├── MessageMapper.java
│ │ │ ├── MessageReceiveMapper.java
│ │ │ ├── OrgMapper.java
│ │ │ ├── OrgMemberMapper.java
│ │ │ ├── PersonMapper.java
│ │ │ ├── SauAuditMapper.java
│ │ │ └── UserMapper.java
│ │ └── model
│ │ │ ├── AnniversaryAudit.java
│ │ │ ├── AuditsView.java
│ │ │ ├── ClubAudit.java
│ │ │ ├── LikeOrg.java
│ │ │ ├── Member.java
│ │ │ ├── MemberOrg.java
│ │ │ ├── Message.java
│ │ │ ├── MessageReceive.java
│ │ │ ├── Org.java
│ │ │ ├── OrgMember.java
│ │ │ ├── Person.java
│ │ │ ├── PersonOrgView.java
│ │ │ ├── SauAuditRegister.java
│ │ │ ├── UniqueMsg.java
│ │ │ └── User.java
│ │ ├── service
│ │ ├── dao
│ │ │ └── mapper
│ │ │ │ ├── AnniversaryAuditMapper.xml
│ │ │ │ ├── AuditsViewMapper.xml
│ │ │ │ ├── ClubAuditMapper.xml
│ │ │ │ ├── LikeOrgMapper.xml
│ │ │ │ ├── MemberMapper.xml
│ │ │ │ ├── MemberOrgMapper.xml
│ │ │ │ ├── MessageMapper.xml
│ │ │ │ ├── MessageReceiveMapper.xml
│ │ │ │ ├── OrgMapper.xml
│ │ │ │ ├── OrgMemberMapper.xml
│ │ │ │ ├── PersonMapper.xml
│ │ │ │ ├── SauAuditMapper.xml
│ │ │ │ └── UserMapper.xml
│ │ ├── impl
│ │ │ ├── AccountAccessServiceImpl.java
│ │ │ ├── AccountSecureServiceImpl.java
│ │ │ ├── AnniversaryAuditServiceImpl.java
│ │ │ ├── ClubAuditServiceImpl.java
│ │ │ ├── ClubServiceImpl.java
│ │ │ ├── LikeOrgServiceImpl.java
│ │ │ ├── MemberOrgServiceImpl.java
│ │ │ ├── MessageReceiveServiceImpl.java
│ │ │ ├── MessageSendServiceImpl.java
│ │ │ ├── OrgMemberAuditServiceImpl.java
│ │ │ ├── OrgMemberServiceImpl.java
│ │ │ ├── OrgServiceImpl.java
│ │ │ ├── PersonServiceImpl.java
│ │ │ ├── RegisterServiceImpl.java
│ │ │ ├── SauAuditServiceImpl.java
│ │ │ ├── SauServiceImpl.java
│ │ │ ├── TestSessionImpl.java
│ │ │ └── UserServiceImpl.java
│ │ └── model
│ │ │ └── domain
│ │ │ ├── ClubMsg.java
│ │ │ ├── ClubReg.java
│ │ │ ├── LoginResult.java
│ │ │ ├── PersonMsg.java
│ │ │ ├── PersonReg.java
│ │ │ ├── SRMsgRecord.java
│ │ │ ├── SauMsg.java
│ │ │ ├── SauReg.java
│ │ │ └── SecureMsg.java
│ │ └── web
│ │ ├── controller
│ │ ├── IndexPageController.java
│ │ ├── LoginController.java
│ │ ├── ReceiveMsgController.java
│ │ ├── RegisterController.java
│ │ ├── SecurityController.java
│ │ ├── club
│ │ │ ├── ClubAnnRegisterController.java
│ │ │ ├── ClubAuditRegController.java
│ │ │ ├── ClubCenterController.java
│ │ │ ├── ClubOrgMsgController.java
│ │ │ └── ClubSendPublishMsgController.java
│ │ ├── member
│ │ │ ├── MemberCenterController.java
│ │ │ └── MemberOrgMsgController.java
│ │ └── sau
│ │ │ ├── SauAnnAuditController.java
│ │ │ ├── SauAuditRegController.java
│ │ │ ├── SauCenterController.java
│ │ │ ├── SauOrgMsgController.java
│ │ │ └── SauSendPublishMsgController.java
│ │ ├── filter
│ │ ├── CorsFilter.java
│ │ └── EncodingFilter.java
│ │ ├── handler
│ │ └── GlobalExceptionHandler.java
│ │ ├── interceptor
│ │ ├── CommonErrorHandle.java
│ │ ├── LoginInterceptor.java
│ │ └── PermissionInterceptor.java
│ │ └── model
│ │ ├── AnnAuditListModel.java
│ │ ├── AuditResult.java
│ │ ├── CaptchaMsg.java
│ │ ├── ClubAnnAuditDetail.java
│ │ ├── ClubAuditListMsg.java
│ │ ├── ClubAuditResultMsg.java
│ │ ├── ClubCustomSendObj.java
│ │ ├── ClubPublishedNewMsg.java
│ │ ├── ClubRegisterAuditListMsg.java
│ │ ├── ClubSubmitAnnMsg.java
│ │ ├── DeleteMsgIdsModel.java
│ │ ├── MemberClubDetail.java
│ │ ├── MemberOrgDetail.java
│ │ ├── NewMsgDetail.java
│ │ ├── NewMsgListDomain.java
│ │ ├── OldPublishMsg.java
│ │ ├── OrgDetail.java
│ │ ├── OrgListMsg.java
│ │ ├── PageList.java
│ │ ├── PersonDetail.java
│ │ ├── PersonJoinAuditDetail.java
│ │ ├── SauAnnAuditDetail.java
│ │ ├── SauClubAuditDetail.java
│ │ ├── SauMsgPublicOrgObj.java
│ │ ├── SauMsgPublishDetail.java
│ │ ├── SauPublishedNewMsg.java
│ │ ├── SauRegAudit.java
│ │ └── SearchPage.java
└── test
│ ├── controller
│ ├── HelloWord.java
│ ├── Interceptor.java
│ ├── StaticStuff.java
│ ├── Test2.java
│ └── Test3.java
│ ├── dao
│ ├── Model.java
│ ├── TestDao.java
│ ├── TestMessage.java
│ └── TestRec.java
│ └── service
│ ├── BaseServiceTest.java
│ ├── Model.java
│ └── UserServiceTest.java
├── resources
├── jdbc.properties
├── log4j.properties
├── log4j2.xml
├── mail.properties
├── mybatis-config.xml
├── redis.properties
├── sauims-dao.xml
├── sauims-service.xml
├── sauims-servlet.xml
├── sauims-url.xml
└── webapp-path.properties
└── webapp
├── META-INF
└── MANIFEST.MF
├── WEB-INF
├── file
│ ├── ann
│ │ ├── 2017_48.docx
│ │ ├── 2018_12.docx
│ │ └── AnnRegisterTemplate.docx
│ ├── ann_ol
│ │ ├── 2017_48.docx
│ │ └── AnnRegisterTemplate.docx
│ └── club_audit
│ │ ├── ClubRegisterTemplate.docx
│ │ └── test reg.docx
├── resources
│ ├── club_view
│ │ └── default_overview.png
│ ├── logo
│ │ ├── 1.jpg
│ │ ├── default_logo.jpg
│ │ └── uQoFWj4R0QcszGL8h65QPNGjpgjpg.PNG
│ └── sau_view
│ │ └── default_overview.png
└── web.xml
├── css
├── app.7412e4db.css
├── chunk-08ead6f2.0ccb84ef.css
├── chunk-18deac72.99785297.css
├── chunk-20145957.0ef90a65.css
├── chunk-37729a73.b2dbb7d4.css
├── chunk-efd82250.2e363f2b.css
└── chunk-vendors.99c3e8bb.css
├── favicon.ico
├── img
├── avatar.c3e6414e.png
├── delete.f9e77e23.svg
├── false_logo.f15f6d79.svg
├── left.6df4379c.png
├── sau.09b84ba8.svg
├── send_logo.c38dcd0e.svg
├── slide1.b725de71.png
├── slide2.63f7c5f2.png
├── slide3.ec5b8c4d.png
└── true_logo.53b6c548.svg
├── index.html
└── js
├── about.6e3194d4.js
├── about.6e3194d4.js.map
├── app.65673d55.js
├── app.65673d55.js.map
├── chunk-08ead6f2.ec875fa6.js
├── chunk-08ead6f2.ec875fa6.js.map
├── chunk-18deac72.c852edcf.js
├── chunk-18deac72.c852edcf.js.map
├── chunk-20145957.7c1c44e0.js
├── chunk-20145957.7c1c44e0.js.map
├── chunk-37729a73.26581912.js
├── chunk-37729a73.26581912.js.map
├── chunk-efd82250.4bc3c63f.js
├── chunk-efd82250.4bc3c63f.js.map
├── chunk-vendors.475259ce.js
└── chunk-vendors.475259ce.js.map
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=java
2 | *.css linguist-language=java
3 | *.html linguist-language=java
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /target/
2 | !.mvn/wrapper/maven-wrapper.jar
3 |
4 | ### STS ###
5 | .apt_generated
6 | .classpath
7 | .factorypath
8 | .project
9 | .settings
10 | .springBeans
11 | .sts4-cache
12 |
13 | ### jhint ###
14 | .jshintrc
15 |
16 | ### IntelliJ IDEA ###
17 | .idea
18 | *.iws
19 | *.iml
20 | *.ipr
21 |
22 | ### NetBeans ###
23 | /nbproject/private/
24 | /build/
25 | /nbbuild/
26 | /dist/
27 | /nbdist/
28 | /.nb-gradle/
--------------------------------------------------------------------------------
/Jenkinsfile:
--------------------------------------------------------------------------------
1 | pipeline {
2 | agent { docker 'maven:3.3.3' }
3 | stages {
4 | stage('build') {
5 | steps {
6 | sh 'mvn --version'
7 | }
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SAU-IMS
2 | 大创项目:校社联管理系统
3 |
4 | 项目地址: http://sauims.kanlon.ink
5 |
6 | 添加新的接口文档,接口文档2.0地址:https://documenter.getpostman.com/view/3892535/S1LsXpZn
7 |
8 |
9 |
10 | 该仓库是小组仓库的备份,是基于idea软件提交的仓库。
11 |
12 |
13 |
14 | 工作进度:
15 |
16 |
17 |
2019/5/1
18 | 0. 升级pom依赖和修改properties统一为utf-8编码
19 | 1. 添加spring mvc 参数校验功能
20 | 2. 针对同步请求和异步请求分别做不同的权限处理
21 |
22 |
23 | 2019/2/25
24 | 0. 修复删除消息的bug
25 | 1. 添加git提交时的忽略的文件
26 |
27 |
28 | 2019/2/1
29 | 0. 增加node.js做跨域的文件。
30 | 1. 删除web.xml中的cors过滤器,以后采用node.js做服务器转发,实现前端测试
31 |
32 |
33 | 2018/8/22
34 | 0.所有合并在master分支上了,第一个版本。
35 | 1.修改了邮箱修改的问题,改为修改邮箱时,向新邮箱发送验证码
36 | 2.项目后端功能已经全部完成,经基本测试,没有问题。还需要交叉测试和结合前端测试。
37 | 3.前端代码已经提交到front-end分支中去了。
38 | 4.项目地址:http://kanlon.ink 测试账号和密码:https://documenter.getpostman.com/view/3892535/RWM8UC2C 该地址中的首页——》登陆 备注中有。
39 |
40 | 2018/5/10
41 | 1.整合了前后端,布置到服务器上去了,基本不过还是有很多问题。
42 | 2.问题1,不能两个不同用户登录。
43 | 3.基本上注册,发送消息,删除功能都还不可以实现,怀疑是前端没有按照文档要求来写
44 |
45 | 2018/5/6
46 | 1.添加了社团端,下载年度注册文件的功能。
47 | 2.将校社联的注册审核链接那里将/role /auditMsgId调换了位置,即新的链接变成了/sau/audit/join/{roleId}/{auditMsgId},这种形式
48 |
49 | 2018/5/2
50 | 1.在社团详细信息中加了是否点赞字段(这个是没有什么用的)。
51 | 2.在用户点赞那里的返回数据的data中加了喜欢人数,就是类似:data:12。
52 |
53 | 2018/4/24
54 | 1.初步整合前端,首页展示和验证码,登录,还有点进某个社团的详细信息应该没问题
55 | 2.在首页展示社团的时候,添加了给各个年级数以及男女数,预计下一步会给有展示社团详细信息的加上这些。
56 | 3.前后端又分开来写了,因为发现前端太多错误,不能在idea中写,决定把前端分离到tomcat上写,自己用文件模拟json,大大加快了修改进度。
57 |
58 |
59 | 2018/4/23
60 | 1.初步整合前端,还存在很多问题,暂时首页展示,链接没问题,验证码和某个社团的详情都需要调一下
61 |
62 | 2018/4/23
63 | 1.从社团描述中分离出口号,口号以“。”来与社团描述分割开。
64 | 2.更新了数据库,将所有的社团展示图和校社联展示图改为默认的图。
65 | 3.增加了前端文件,暂时整合了,还存在很大问题。
66 | 4.增加了管理端的开放权限。
67 |
68 | 2018/4/22
69 | 1.将个人头像改为输出流输出,社团和校社联头像还是经过图片资源输出。
70 | 2.修改了一些小bug,如头像存储问题,社团中心信息增加了男女数和各个年级数,个人信息添加了手机号。
71 | 3.更新了数据库文件
72 |
73 | 2018/4/10
74 | 1、所有功能已经完成,按照接口的数据形式进行发送和请求即可。
75 | 2、还差offset,limit这两个参数需要修改内容和查询出来的数据需要按照时间排序。
76 | 3、计划把接口文档弄规范化,把接口功能和解释统一格式说明。
77 |
78 | 2018/2/16
79 | 1、继续完善服务层接口,预计完成时间为5天
80 | 2、各个发送功能测试正常,redis服务器暂时正常
81 | 3、修复若干个bug
82 | 4、未来加入投票系统,定时任务功能支持
83 | 5、预计一个星期后开始编写点赞功能(所有事先设计的功能都已完成)
84 |
85 |
86 | 2018/2/7
87 | 1、大幅修改项目文件结构,包结构,测试运行正常
88 | 2、新增redis支持,到时申请redis服务器
89 | 3、重写服务层接口,完成首页部分接口编写(按接口文档序号)
90 | 4、清空controller层方法内代码,只保留方法
91 | 5、session移向服务层,并新增session通用操作
92 | 6、大幅修改dao层,逻辑不变
93 | 7、清除大量无意义工具类,部分合并,但未全部修改
94 | 8、将service api分离出来,为将来open-api/rpc-service-api?
95 | 9、将大部分类的操作抽象为BaseXXX接口
96 |
97 | 2018/1/27
98 | 1、大幅修改Dao层,更加具有结构化
99 | 2、删除pojo里的json包
100 | 3、添加了用户工厂类,但尚未实现
101 |
102 | 2018/1/21
103 | 1、完成邮箱等手机发送工具类
104 | 2、完成验证码工具类
105 | 3、添加ip工作类
106 | 4、部分工具类的正则验证尚未完成
107 | 5、其他层尚未完成
108 |
109 |
--------------------------------------------------------------------------------
/build-resource/proxy-cors.js:
--------------------------------------------------------------------------------
1 | const express = require('express');
2 | const path = require('path');
3 | const request = require('request');
4 | const app = express();
5 |
6 | // 要代理的服务器地址
7 | let serverUrl='http://localhost:80';
8 | // ./sauims 是本地静态资源文件,相当于服务器的根目录
9 | app.use(express.static(path.join(__dirname, './sauims')));
10 | app.use('/', function(req, res) {
11 | let url = serverUrl + req.url;
12 | req.pipe(request(url)).pipe(res);
13 | });
14 | app.listen(3000, function () {
15 | console.log('server is running at port 3000');
16 | });
17 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/AccountAccessService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.User;
5 | import com.fekpal.service.model.domain.SecureMsg;
6 | import com.fekpal.service.model.domain.LoginResult;
7 |
8 | import java.io.OutputStream;
9 |
10 | /**
11 | * Created by APone on 2018/2/19 21:13.
12 | * 账号认证接口
13 | * 该接口提供账号的登录,登出,验证码的操作
14 | */
15 | public interface AccountAccessService {
16 |
17 | /**
18 | * 用户身份信息进行用户登录
19 | *
20 | * @param record 信息封装
21 | * 传入参数:用户名userName,密码password, 验证码code, 当前时间currentTime
22 | * @return 登录结果
23 | * 参考参数:登录状态loginState:Operation.SUCCESSFULLY 成功
24 | * Operation.FAILED 失败
25 | * Operation.CAPTCHA_INCORRECT 验证码错误
26 | * 用户权限authority:系统的角色
27 | */
28 | LoginResult login(SecureMsg record);
29 |
30 | /**
31 | * 生成登录验证码,图片形式
32 | *
33 | * @param out 输出流
34 | */
35 | void sendLoginCaptchaImage(OutputStream out);
36 |
37 | /**
38 | * 用户是否仍然处于登录状态
39 | *
40 | * @return 是否处于登录状态
41 | */
42 | boolean isLogin();
43 |
44 | /**
45 | * 用户登出系统
46 | *
47 | * @return 是否登出成功
48 | */
49 | boolean logout();
50 | }
51 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/AccountSecureService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.User;
5 | import com.fekpal.service.model.domain.SecureMsg;
6 |
7 | /**
8 | * Created by APone on 2018/2/7 0:49.
9 | * 账号安全服务接口
10 | * 该接口提供账号用户安全修改操作
11 | */
12 | public interface AccountSecureService {
13 |
14 | /**
15 | * 重置身份记录密码,适用于未登录的用户
16 | *
17 | * @param record 信息封装
18 | * 传入参数:新密码newPassword, 验证码code, 当前时间currentTime
19 | * @return 是否修改成功
20 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CAPTCHA_INCORRECT 验证码错误
21 | */
22 | int resetPwd(SecureMsg record);
23 |
24 | /**
25 | * (申请)忘记身份记录密码,适用于未登录用户,根据填写邮箱(查伪)发送验证码
26 | *
27 | * @param record 信息封装
28 | * 传入参数:邮箱email
29 | * @return 是否可以拥有合法修改
30 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
31 | */
32 | int forgetPwdByEmail(SecureMsg record);
33 |
34 | /**
35 | * 更新(修改)密码记录,适用于登录用户
36 | *
37 | * @param record 信息封装
38 | * 传入参数:新密码newPassword,旧密码oldPassword
39 | * @return 是否更新成功
40 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
41 | */
42 | int modifyPwd(SecureMsg record);
43 |
44 | /**
45 | * 确认(申请)修改邮箱地址,在真正修改邮箱地址前的认证
46 | *
47 | * @return 是否发送确认
48 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
49 | */
50 | int sendModifyEmailCaptcha();
51 |
52 | /**
53 | * 确认(申请)修改邮箱地址,在真正修改邮箱地址前的认证
54 | * @param record 信息封装
55 | * 传入参数:新邮箱email
56 | * @return
57 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
58 | */
59 | int sendModifyEmailCaptcha(SecureMsg record);
60 |
61 |
62 | /**
63 | * 更新(修改)邮箱地址记录,适用于登录用户
64 | *
65 | * @param record 信息封装
66 | * 传入参数:新邮箱newEmail, 验证码code, 当前时间currentTime
67 | * @return 是否修改成功
68 | * 参考参数:Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CAPTCHA_INCORRECT 验证码错误
69 | */
70 | int modifyEmail(SecureMsg record);
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/ClubAuditService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.ClubAudit;
5 | import com.fekpal.web.model.ClubAuditResultMsg;
6 |
7 | import javax.servlet.http.HttpServletResponse;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by APone on 2017/9/5.
12 | * ClubAuditService接口
13 | * 该接口用于校社联审核关社团注册申请的审核等操作
14 | * @author APone
15 | */
16 | public interface ClubAuditService extends BaseService {
17 |
18 | /**
19 | * 根据社团用户标识获得社团注册审核记录
20 | *
21 | * @param clubId 社团用户标识
22 | * @return 社团注册审核记录
23 | */
24 | ClubAudit selectByClubId(int clubId);
25 |
26 | /**
27 | * 根据审核标题模糊搜索获得社团注册审核记录,分页获取
28 | *
29 | * @param auditTitle 社团名称
30 | * @param offset 跳过读数
31 | * @param limit 读取数
32 | * @return 社团注册审核记录集
33 | */
34 | List queryByClubName(String auditTitle, int offset, int limit);
35 |
36 | /**
37 | * 获得所有审核
38 | *
39 | * @param offset 跳过读数
40 | * @param limit 读取数
41 | * @return 社团注册审核记录集
42 | */
43 | List loadAllClubAudit(int offset, int limit);
44 |
45 | /**
46 | * 查看所有未审核的社团审核消息
47 | * @param offset 跳过读数
48 | * @param limit 读取数
49 | * @return 社团注册审核记录集
50 | */
51 | List loadAllUnAudit(int offset,int limit);
52 |
53 | /**
54 | * 计算还没审核的消息数
55 | * @return 未审核数
56 | */
57 | int countUnAudit();
58 |
59 | /**
60 | * 发送社团审核给校社联
61 | * @param clubAudit 社团审核内容
62 | * @return Operation.SUCCESSFULLY; 发送成功 Operation.FAILED 发送失败
63 | */
64 | int sendClubAudit(ClubAudit clubAudit);
65 |
66 | /**
67 | * 根据审核id删除某个社团的审核
68 | * @param id 审核id
69 | * @return Operation.SUCCESSFULLY; 删除成功 Operation.FAILED 删除失败
70 | */
71 | int deleteClubAuditById(int id);
72 |
73 | /**
74 | * 通过审核id和社团审核类更新审核状态信息
75 | * @param id 审核id
76 | * @param clubAudit
77 | * @return Operation.SUCCESSFULLY; 删除成功 Operation.FAILED 删除失败
78 | */
79 | int updateClubAuditById(int id,ClubAudit clubAudit);
80 |
81 | /**
82 | * 通过审核id和响应获取社团审核的文件
83 | * @param id 审核id
84 | * @param response 审核id
85 | * @return Operation.SUCCESSFULLY; 删除成功 Operation.FAILED 删除失败
86 | */
87 | int getClubAuditFileById(int id, HttpServletResponse response);
88 |
89 | /**
90 | * 通过审核id和响应在线预览社团审核文件
91 | * @param id 审核id
92 | * @param response 响应
93 | * @return Operation.SUCCESSFULLY; 删除成功 Operation.FAILED 删除失败
94 | */
95 | int viewClubAuditFileById(int id,HttpServletResponse response);
96 |
97 | /**
98 | * 通过审核id和审核信息类对审核消息进行通过或拒绝
99 | * @param id 审核id
100 | * @param resultMsg 审核结果信息
101 | * @return Operation.SUCCESSFULLY; 删除成功 Operation.FAILED 删除失败
102 | */
103 | Integer passOrRejectClubAuditByIdAndResultMsg(int id, ClubAuditResultMsg resultMsg);
104 | }
105 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/ClubLikeService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.LikeOrg;
5 |
6 | /**
7 | * Created by APone on 2018/2/7 19:12.
8 | * 该接口提供普通用户关于喜爱社团的操作
9 | */
10 | public interface ClubLikeService extends BaseService {
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/LikeOrgService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.LikeOrg;
5 | import com.fekpal.dao.model.OrgMember;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by zhangcanlong on 2018/3/22.
11 | * 喜爱社团的接口
12 | * 该接口提供社团点赞,取消点赞等功能
13 | */
14 | public interface LikeOrgService extends BaseService {
15 | /**
16 | * 根据根据社团id和用户自己的查看该社团的点赞状态
17 | *
18 | * @param orgId 社团id
19 | * @return 喜爱社团记录
20 | */
21 | LikeOrg selectByOrgId(int orgId);
22 |
23 | /**
24 | * 取消该用户对某社团的点赞
25 | *
26 | * @param orgId 社团id
27 | * @return 取消状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
28 | */
29 | int cancelLikeById(int orgId);
30 |
31 | /**
32 | * 该用户对某社团的点赞
33 | *
34 | * @param orgId 社团id
35 | * @return 点赞 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
36 | */
37 | int likeById(int orgId);
38 |
39 | /**
40 | * 根据社团id和他自身的点赞状态,来决定该用户对某社团是点赞还是取消点赞
41 | *
42 | * @param orgId 社团id
43 | * @return 点赞 Operation.SUCCESSFULLY 成功 Operation.CANCEL;取消点赞成功 Operation.FAILED 操作失败
44 | */
45 | int likeByOrgIdAndState(int orgId);
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/MemberOrgService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.MemberOrg;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Created by APone on 2018/2/28 2:59.
10 | * 成员组织接口
11 | * 该接口提供普通用户对所有已加入的有效的组织进行查询,修改等操作
12 | */
13 | public interface MemberOrgService extends BaseService {
14 |
15 | /**
16 | * 根据组织标识获得改成员在此组织的有效记录
17 | *
18 | * @param id 组织标识
19 | * @return 成员组织记录
20 | */
21 | MemberOrg selectByOrgId(int id);
22 |
23 | /**
24 | * 根据成员组织关系标识获得此用户在组织的有效记录
25 | *
26 | * @param id 成员组织关系
27 | * @return 成员组织记录
28 | */
29 | MemberOrg selectById(int id);
30 |
31 | /**
32 | * 根据组织标识申请加入
33 | *
34 | * @param id 组织标识
35 | * @return 加入状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.INPUT_INCORRECT 还未完善信息
36 | */
37 | int joinOrganizationByOrgId(int id);
38 |
39 | /**
40 | * 加载所有该用户加入的有效组织,安分页获取
41 | *
42 | * @param offset 跳过读数
43 | * @param limit 读取数
44 | * @return 成员组织记录集
45 | */
46 | List loadAllOrg(int offset, int limit);
47 |
48 | /**
49 | * 统计所有该用户加入的有效组织数
50 | *
51 | * @return 成员组织记录数
52 | */
53 | Integer countAllOrg();
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/MessageReceiveService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.MessageReceive;
5 | import com.fekpal.service.model.domain.SRMsgRecord;
6 |
7 | import java.io.OutputStream;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by APone on 2018/2/13 19:26.
12 | * 信息接收服务接口
13 | * 该接口提供信息接收者用于接收,删除,查看信息的操作
14 | */
15 | public interface MessageReceiveService extends BaseService {
16 |
17 | /**
18 | * 根据接收信息标识获取该用户接收的原始有效信息记录
19 | *
20 | * @param id 信息标识
21 | * @return 原始信息记录
22 | */
23 | MessageReceive selectById(int id);
24 |
25 | /**
26 | * 根据用户身份标识获取该用户接收的有效信息记录集
27 | *
28 | * @param id 用户身份标识
29 | * @param offset 跳过读数
30 | * @param limit 读取数
31 | * @return 接收信息记录集
32 | */
33 | List selectByUserId(int id, int offset, int limit);
34 |
35 | /**
36 | * 统计该用户所有未读的有效信息数量
37 | *
38 | * @return 统计数量
39 | */
40 | int countUnReadMessage();
41 |
42 | /**
43 | * 根据信息标识逻辑删除该用户所接收的有效信息记录集
44 | *
45 | * @param record 信息封装
46 | * 传入参数:删除集合ids
47 | * @return 删除状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
48 | */
49 | int deleteById(SRMsgRecord record);
50 |
51 | /**
52 | * 异步将用户尚未拥有的全体信息的记录更新到接收记录里
53 | */
54 | void updateReceiveNote();
55 |
56 | /**
57 | * 根据信息标题模糊搜索该用户的接收的按时间降序的有效信息记录集,按分页获取
58 | *
59 | * @param title 信息标题
60 | * @param offset 跳过读数
61 | * @param limit 读取数
62 | * @return 接收信息记录集
63 | */
64 | List queryByMessageTitle(String title, int offset, int limit);
65 |
66 | /**
67 | * 根据信息标题模糊搜索该用户的接收的有效信息记录数
68 | *
69 | * @param title 信息标题
70 | * @return 接收信息记录数
71 | */
72 | Integer countByMessageTitle(String title);
73 |
74 | /**
75 | * 根据信息发送人名称模糊搜索该用户接收的按时间降序的有效信息记录集,按分页获取
76 | *
77 | * @param name 发送人名称
78 | * @param offset 跳过读数
79 | * @param limit 读取数
80 | * @return 接收信息记录集
81 | */
82 | List queryByReleaseName(String name, int offset, int limit);
83 |
84 | /**
85 | * 根据信息发送人名称模糊搜索该用户接收的有效信息记录数
86 | *
87 | * @param name 发送人名称
88 | * @return 接收信息记录数
89 | */
90 | Integer countByReleaseName(String name);
91 |
92 | /**
93 | * 获取该用户接收的有效信息的附件,前提该信息具有附件
94 | *
95 | * @param id 发送信息标识
96 | * @param outputStream 输出流
97 | */
98 | void getAnnexById(int id, OutputStream outputStream);
99 |
100 | /**
101 | * 获取所有该用户接收的按时间降序的有效信息记录,按分页获取
102 | *
103 | * @param offset 跳过读数
104 | * @param limit 读取数
105 | * @return 接收信息记录集
106 | */
107 | List loadAllReceiveMessage(int offset, int limit);
108 |
109 | /**
110 | * 获取所有该用户接收的按时间降序的有效信息记录数
111 | *
112 | * @return 接收信息记录数
113 | */
114 | Integer countAllReceiveMessage();
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/MessageSendService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.Message;
5 | import com.fekpal.service.model.domain.SRMsgRecord;
6 |
7 | import java.io.OutputStream;
8 | import java.util.List;
9 |
10 | /**
11 | * Created by APone on 2017/8/25.
12 | * 信息发送信息接口
13 | * 该接口提供信息发送者用于发送,删除,查看信息的操作
14 | * @author apone
15 | */
16 | public interface MessageSendService extends BaseService {
17 |
18 | /**
19 | * 根据信息标识获取该用户发送的有效信息
20 | *
21 | * @param id 信息标识
22 | * @return 信息记录
23 | */
24 | Message selectByMessageId(int id);
25 |
26 | /**
27 | * 根据标题文字模糊搜索获取该用户发送的时间降序的有效信息记录集分页获取,
28 | *
29 | * @param title 信息标题
30 | * @param offset 跳过读数
31 | * @param limit 读取数
32 | * @return 信息记录集
33 | */
34 | List queryByMessageTitle(String title, int offset, int limit);
35 |
36 | /**
37 | * 根据标题文字模糊搜索获取该用户发送的时间降序的有效信息记录数
38 | *
39 | * @param title 信息标题
40 | * @return 信息记录数
41 | */
42 | Integer countByMessageTitle(String title);
43 |
44 | /**
45 | * 根据信息标识逻辑删除该用户所发送的有效信息记录集
46 | *
47 | * @param record 信息封装
48 | * 传入参数:删除集合ids
49 | * @return 删除状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
50 | */
51 | int deleteByMessageId(SRMsgRecord record);
52 |
53 |
54 | /**
55 | * 发送全体公告的信息
56 | *
57 | * @param record 信息封装:信息标题messageTitle,信息内容messageContent,
58 | * 发送时间releaseTime,消息附件(可为空)messageAnnex
59 | * @return 添加状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
60 | */
61 | int sendGlobalMessage(SRMsgRecord record);
62 |
63 | /**
64 | * 发送组织内的信息
65 | *
66 | * @param record 信息封装:信息标题messageTitle,信息内容messageContent,
67 | * 发送时间releaseTime,消息附件(可为空)messageAnnex
68 | * @return 添加状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
69 | */
70 | int sendCustomMessage(SRMsgRecord record);
71 |
72 | /**
73 | * 发送指定接收人的信息
74 | *
75 | * @param record 信息封装:信息标题messageTitle,信息内容messageContent,
76 | * 发送时间releaseTime,消息附件(可为空)messageAnnex
77 | * @return 添加状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
78 | */
79 | int sendOrgMessage(SRMsgRecord record);
80 |
81 | /**
82 | * 根据信息标识获取该用户发送的有效信息附件
83 | *
84 | * @param outputStream 输出流
85 | * @param id 信息标识
86 | */
87 | void getAnnexByMessageId(int id, OutputStream outputStream);
88 |
89 | /**
90 | * 加载所有该用户发送的时间降序有效信息,分页获取
91 | *
92 | * @param offset 跳过读数
93 | * @param limit 读取数
94 | * @return 信息记录集
95 | */
96 | List loadAllMessage(int offset, int limit);
97 |
98 | /**
99 | * 加载所有该用户发送的所有消息数
100 | *
101 | * @param offset 跳过读数
102 | * @param limit 读取数
103 | * @return 信息记录数
104 | */
105 | Integer countAllMessage(int offset, int limit);
106 | }
107 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/OrgMemberAuditService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.OrgMember;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Created by APone on 2018/2/26 19:17.
10 | * 成员申请加入组织接口
11 | * 该接口提供普通用户加入相应组织的申请操作,组织审核成员有效信息的查询,修改操作
12 | */
13 | public interface OrgMemberAuditService extends BaseService {
14 |
15 | /**
16 | * 根据组织成员关系标识获得该成员(所属此组织)组织成员记录
17 | *
18 | * @param id 组织成员关系标识
19 | * @return 组织成员记录
20 | */
21 | OrgMember selectAuditById(int id);
22 |
23 | /**
24 | * 获取该组织新的成员加入申请
25 | *
26 | * @param offset 跳过读数
27 | * @param limit 读取数
28 | * @return 组织成员记录集
29 | */
30 | List selectNewAudit(int offset, int limit);
31 |
32 | /**
33 | * 通过该成员加入组织申请,审核结果将以信息通知
34 | *
35 | * @param id 组织成员关系标识
36 | * @return 审核状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
37 | */
38 | int passMemberApply(int id);
39 |
40 | /**
41 | * 否决该用户加入组织申请,审核结果将以信息通知
42 | *
43 | * @param id 组织成员关系标识
44 | * @return 审核状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
45 | */
46 | int rejectMemberApply(int id);
47 |
48 |
49 | /**
50 | * 加载所有历史申请加入该组织的(不包含未审核,包含否决以及通过)的组织成员记录集,安分页获取
51 | *
52 | * @param offset 跳过读数
53 | * @param limit 读取数
54 | * @return 组织成员记录
55 | */
56 | List loadAllAudit(int offset, int limit);
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/OrgMemberService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.OrgMember;
5 | import com.fekpal.web.model.AuditResult;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by APone on 2017/9/5.
11 | * 组织成员接口
12 | * 该接口提供组织内的成员的添加,查询,删除等操作
13 | */
14 | public interface OrgMemberService extends BaseService {
15 |
16 | /**
17 | * 根据组织成员(普通用户)标识获取该有效(所属该组织) 组织成员记录
18 | *
19 | * @param id 普通用户标识
20 | * @return 组织成员记录
21 | */
22 | OrgMember selectByPersonId(int id);
23 |
24 | /**
25 | * 根据组织成员关系标识获得该有效(所属该组织) 组织成员记录
26 | *
27 | * @param id 组织成员关系记录标识
28 | * @return 组织成员记录
29 | */
30 | OrgMember selectById(int id);
31 |
32 | /**
33 | * 修改该组织成员在该组织的关系,将其状态改为离开
34 | *
35 | * @param id 组织成员关系标识
36 | * @return 取消状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
37 | */
38 | int cancelMemberById(int id);
39 |
40 | /**
41 | * 解除该组织成员在该组织的关系,关系无效化
42 | *
43 | * @param id 组织成员关系标识
44 | * @return 取消状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
45 | */
46 | int deleteMemberById(int id);
47 |
48 | /**
49 | * 加载所有该组织的所有组织成员,按分页获取
50 | *
51 | * @param offset 跳过读数
52 | * @param limit 读取数
53 | * @return 组织成员记录集
54 | */
55 | List loadAllMember(int offset, int limit);
56 |
57 | /**
58 | * 加载所有该组织的所有未审核的组织成员,按页获取
59 | * @param offset 跳过读数
60 | * @param limit 读取数
61 | * @return 组织成员记录集
62 | */
63 | List loadAllUnAuditMember(int offset,int limit);
64 |
65 | /**
66 | * 加载所有该组织的所有审核的组织成员,按页获取
67 | * @param offset 跳过读数
68 | * @param limit 读取数
69 | * @return 组织成员记录集
70 | */
71 | List loadAllAuditMember(int offset,int limit);
72 |
73 | /**
74 | * 统计所有该组织的所有审核的组织成员数
75 | * @return 组织成员记录数
76 | */
77 | Integer countAllAuditMember();
78 |
79 |
80 | /**
81 | * 根据真实姓名用模糊搜索个人名姓名
82 | * @param realName 真实姓名
83 | * @param offset 跳过读数
84 | * @param limit 读取数
85 | * @return 组织成员记录表
86 | */
87 | List queryByRealName(String realName,int offset,int limit);
88 |
89 | /**
90 | * 根据真实姓名统计组织成员数
91 | * @param realName 真实姓名
92 | * @return 组织成员记录数
93 | */
94 | Integer countAuditByRealName(String realName);
95 |
96 |
97 | /**
98 | * 社团对个人加入社团进行通过或拒绝
99 | * @param auditId 审核id
100 | * @param auditResult 审核结果类
101 | * @return 操作状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
102 | */
103 | int passOrRejectAuditByIdAndModel(int auditId,AuditResult auditResult);
104 | }
105 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/OrgService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.Org;
5 | import com.fekpal.dao.model.PersonOrgView;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by APone on 2018/3/4 15:42.
11 | * 组织接口
12 | * 该接口提供组织(社团,校社联)的查询,修改等操作
13 | */
14 | public interface OrgService extends BaseService {
15 |
16 | /**
17 | * 根据组织标识获取组织记录详细,用于普通用户
18 | *
19 | * @param id 组织标识
20 | * @return 普通用户范围组织记录
21 | */
22 | PersonOrgView selectByIdForPerson(int id);
23 |
24 | /**
25 | * 根据组织名称进行模糊搜索获取组织列表,按分页获取,用于普通用户
26 | *
27 | * @param name 组织名称
28 | * @param offset 跳过读数
29 | * @param limit 读取数
30 | * @return 组织记录
31 | */
32 | List selectByOrgName(String name, int offset, int limit);
33 |
34 | /**
35 | * 根据组织名称进行模糊搜索获取组织总数
36 | *
37 | * @param name 组织名称
38 | * @return 组织总数
39 | */
40 | Integer countByOrgName(String name);
41 |
42 | /**
43 | * 根据组织标识获取组织记录详细,用于校社联和社团用户
44 | *
45 | * @param id 组织标识
46 | * @return 普通用户范围组织记录
47 | */
48 | Org selectByIdForOrg(int id);
49 |
50 | /**
51 | * 根据组织标识进行点赞该组织
52 | *
53 | * @param id 组织标识
54 | * @return 点赞状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CANCEL 取消
55 | */
56 | int likeByOrgId(int id);
57 |
58 | /**
59 | * 加载所有组织记录,按分页获取
60 | *
61 | * @param offset 跳过读数
62 | * @param limit 读取数
63 | * @return 组织记录集
64 | */
65 | List loadAllOrg(int offset, int limit);
66 |
67 | /**
68 | * 统计所有组织记录数
69 | * @return 组织记录数
70 | */
71 | Integer countAllOrg();
72 |
73 | /**
74 | * 根据社团id计算社团内部男生的数量
75 | * @param orgId 组织id
76 | * @return 组织内男生的人数
77 | */
78 | int countOrgManNumByOrgId(int orgId);
79 |
80 | /**
81 | * 根据组织id计算社团内部女生的数量
82 | * @param orgId 组织id
83 | * @return 组织内女生的人数
84 | */
85 | int countOrgWomanNumByOrgId(int orgId);
86 |
87 |
88 | /**
89 | * 根据组织id计算年级数计算社团内部年级的数量
90 | *
91 | * @param grade 年级 如1,2,3,4,
92 | * @param orgId 组织id
93 | * @return 组织内各个年级的人数
94 | */
95 | int countOrgGradeNumByOrgId(int grade,int orgId);
96 |
97 |
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/PersonService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.Person;
5 | import com.fekpal.service.model.domain.PersonMsg;
6 | import com.fekpal.web.model.PersonDetail;
7 |
8 | import java.io.OutputStream;
9 | import java.util.List;
10 |
11 | /**
12 | * Created by APone on 2017/9/5.
13 | * 普通用户信息接口
14 | * 该接口主要提功普通用户信息增删查改操作
15 | */
16 | public interface PersonService extends BaseService {
17 |
18 | /**
19 | * 根据普通用户标识修改用户头像
20 | *
21 | * @param msg 普通用户修改信息封装
22 | * 传入参数:头像文件logo
23 | * @return 头像名
24 | */
25 | String updateLogo(PersonMsg msg);
26 |
27 | /**
28 | * 更新普通用户信息
29 | *
30 | * @param msg 普通用户修改信息封装
31 | * 传入参数:
32 | * @return 更新状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.INPUT_INCORRECT 存在相同的昵称
33 | */
34 | int updatePersonInfo(PersonMsg msg);
35 |
36 | /**
37 | * 根据昵称获得个人
38 | *
39 | * @param name 昵称
40 | * @return 普通用户记录
41 | */
42 | Person selectByNickname(String name);
43 |
44 | /**
45 | * 根据用户身份标识获得个人
46 | *
47 | * @param id 用户身份标识
48 | * @return 普通用户记录
49 | */
50 | Person selectByUserId(int id);
51 |
52 | /**
53 | * 根据普通用户标识获得个人
54 | *
55 | * @return 普通用户记录
56 | */
57 | Person selectByPrimaryId();
58 |
59 | /**
60 | * 根据昵称模糊搜索普通用户信息记录,分页读取
61 | *
62 | * @param name 昵称
63 | * @param offset 跳过读数
64 | * @param limit 读取数
65 | * @return 普通用户信息记录集
66 | */
67 | List queryByNickname(String name, int offset, int limit);
68 |
69 | /**
70 | * 是否有相同的昵称
71 | *
72 | * @param name 昵称
73 | * @return 是否存在
74 | */
75 | boolean isExitNickname(String name);
76 |
77 | /**
78 | * 获得所有普通用户信息记录集
79 | *
80 | * @param offset 跳过读数
81 | * @param limit 读取数
82 | * @return 普通用户记录集
83 | */
84 | List loadAllPerson(int offset, int limit);
85 |
86 |
87 | /**
88 | * 得到个人中心的的详细信息
89 | * @return 个人中心的详细信息类
90 | */
91 | PersonDetail selectPersonDetailByPrimaryId();
92 |
93 | /**
94 | * 得到个人头像
95 | * @param output 输出流
96 | * @return 是否成功
97 | */
98 | int getPersonLogo(OutputStream output);
99 | }
100 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/RegisterService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.dao.model.UniqueMsg;
4 | import com.fekpal.service.model.domain.ClubReg;
5 | import com.fekpal.service.model.domain.PersonReg;
6 | import com.fekpal.service.model.domain.SauReg;
7 |
8 | /**
9 | * Created by APone on 2018/2/9 0:31.
10 | * 注册服务接口
11 | * 该接口用于提供注册普通用户,社团用户,校社联用户,以及发送注册验证码的操作
12 | */
13 | public interface RegisterService {
14 |
15 | /**
16 | * 检测参数是否存在相同,不唯一
17 | *
18 | * @param msg 唯一信息封装
19 | * @return 信息提示
20 | */
21 | UniqueMsg checkExitInfo(UniqueMsg msg);
22 |
23 | /**
24 | * 注册普通用户
25 | *
26 | * @param reg 普通注册信息封装
27 | * 传入参数:用户名userName,密码password,邮箱地址email,验证码captcha,当前时间currentTime,
28 | * 登录地址loginIp,登录时间loginTime,注册地址registerIp,注册时间registerTime
29 | * @return 注册状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CAPTCHA_INCORRECT 验证码错误
30 | */
31 | int insertPersonReg(PersonReg reg);
32 |
33 | /**
34 | * 注册校社联用户
35 | *
36 | * @param reg 校社联注册信息封装
37 | * 传入参数:用户名userName,密码password,社长adminName,邮箱地址email,手机号码phone,
38 | * 校社联名称sauName,描述description,验证码captcha,当前时间currentTime,校社联注册审核文件auditFile,
39 | * 登录地址loginIp,登录时间loginTime,注册地址registerIp,注册时间registerTime
40 | * @return 注册状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CAPTCHA_INCORRECT 验证码错误
41 | */
42 | int insertSauReg(SauReg reg);
43 |
44 | /**
45 | * 注册社团用户
46 | *
47 | * @param reg 社团注册信息封装
48 | * 传入参数:用户名userName,密码password,社长adminName,邮箱地址email,手机号码phone,
49 | * 社团名称clubName,社团类型clubType,描述description,验证码captcha,当前时间currentTime,
50 | * 社团注册审核文件auditFile,登录地址loginIp,登录时间loginTime,注册地址registerIp,
51 | * 注册时间registerTime
52 | * @return 注册状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.CAPTCHA_INCORRECT 验证码错误
53 | */
54 | int insertClubReg(ClubReg reg);
55 |
56 | /**
57 | * 邮箱发送普通用户注册验证码
58 | *
59 | * @param email 邮箱地址
60 | * @return 发送状态状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
61 | */
62 | int sendClubEmailCaptcha(String email);
63 |
64 | /**
65 | * 邮箱发送社团用户注册验证码
66 | *
67 | * @param email 邮箱地址
68 | * @return 发送状态状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败
69 | */
70 | int sendPersonEmailCaptcha(String email);
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/SauService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.Org;
5 | import com.fekpal.service.model.domain.SauMsg;
6 |
7 | /**
8 | * Created by APone on 2017/9/5.
9 | * 校社联用户信息接口
10 | * 该接口主要提功校社联用户信息增删查改操作
11 | * @author APone
12 | * @date 2017/9/5
13 | */
14 | public interface SauService extends BaseService {
15 |
16 | /**
17 | * 根据校社联用户标识获得个人
18 | *
19 | * @return 校社联用户记录
20 | */
21 | Org selectByPrimaryId();
22 |
23 | /**
24 | * 根据校社联用户标识更新校社联头像
25 | *
26 | * @param msg 校社联修改信息封装
27 | * 传入参数:头像文件logo
28 | * @return 头像名
29 | */
30 | String updateLogo(SauMsg msg);
31 |
32 | /**
33 | * 根据校社联用户标识更新校社联展示
34 | *
35 | * @param msg 校社联修改信息封装
36 | * 传入参数:头像文件logo
37 | * @return 头像名
38 | */
39 | String updateView(SauMsg msg);
40 |
41 | /**
42 | * 是否有相同的校社联名称的校社联
43 | *
44 | * @param name 校社联名称
45 | * @return 是否存在
46 | */
47 | boolean isExitSauName(String name);
48 |
49 | /**
50 | * 更新校社联用户信息
51 | *
52 | * @param msg 校社联修改信息封装
53 | * 传入参数:
54 | * @return 更新状态 Operation.SUCCESSFULLY 成功 Operation.FAILED 失败 Operation.INPUT_INCORRECT 存在相同校社联名称
55 | */
56 | int updateSauInfo(SauMsg msg);
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/api/UserService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.api;
2 |
3 | import com.fekpal.common.base.BaseService;
4 | import com.fekpal.dao.model.User;
5 |
6 | import java.util.List;
7 |
8 | /**
9 | * Created by APone on 2017/8/25.
10 | * 用户身份信息接口
11 | * 该接口主要提功增删查改所有角色的基本身份信息的操作
12 | */
13 | public interface UserService extends BaseService {
14 |
15 | /**
16 | * 根据用户名称获得用户身份记录
17 | *
18 | * @param userName 用户名
19 | * @return 用户身份记录
20 | */
21 | User selectByUserName(String userName);
22 |
23 | /**
24 | * 根据用户名和密码获得用户身份记录
25 | *
26 | * @param user 用户身份记录 传入参数:用户名userName,密码password
27 | * @return 用户身份记录
28 | */
29 | User selectByUserNameAndPwd(User user);
30 |
31 | /**
32 | * 根据邮箱地址获得用户身份记录
33 | *
34 | * @param email 邮箱地址
35 | * @return 用户身份记录
36 | */
37 | User selectByEmail(String email);
38 |
39 | /**
40 | * 判断是否存在相同用户名称
41 | *
42 | * @param userName 用户名
43 | * @return 是否存在相同名称
44 | */
45 | boolean isExitAccount(String userName);
46 |
47 | /**
48 | * 判断是否存在相同的邮箱地址
49 | *
50 | * @param email 邮箱地址
51 | * @return 是否存在相同邮箱地址
52 | */
53 | boolean isExitEmail(String email);
54 |
55 | /**
56 | * 判断是否存在相同的手机号码
57 | *
58 | * @param phone 手机号码
59 | * @return 是否存在相同手机号码
60 | */
61 | boolean isExitPhone(String phone);
62 |
63 | /**
64 | * 是否不存在相同必要信息,既用户的关键信息唯一,尚未出现在数据库
65 | *
66 | * @param userName 用户名
67 | * @param email 邮箱
68 | * @return 是否成立
69 | */
70 | boolean isUnique(String userName, String email);
71 |
72 | /**
73 | * 根据用户标识更新用户最后一次登录信息
74 | *
75 | * @param user 用户身份记录
76 | * 传入参数:用户标识 userId 登录ip loginIp 登录时间 loginTime
77 | * @return 更新状态
78 | */
79 | int updateLastLoginById(User user);
80 |
81 | /**
82 | * 获取所有用户身份记录集,按分页获取
83 | *
84 | * @param offset Integer 跳过读数
85 | * @param limit Integer 读取数
86 | * @return 用户身份记录集
87 | */
88 | List loadAllUser(Integer offset, Integer limit);
89 | }
90 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/base/BaseMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.base;
2 |
3 | import org.apache.ibatis.annotations.Param;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * dao基础增删查改操作,所有dao的必须继承,按需求实现方法
9 | *
10 | * @param
11 | */
12 | public interface BaseMapper {
13 |
14 | /**
15 | * 根据主键获取记录
16 | *
17 | * @param id 主键
18 | * @return 记录集
19 | */
20 | Record selectByPrimaryKey(Integer id);
21 |
22 |
23 | /**
24 | * 根据条件获取第一条记录
25 | *
26 | * @param example 条件
27 | * @return 第一条记录
28 | */
29 | Record selectFirstByExample(@Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example);
30 |
31 | /**
32 | * 根据条件获取记录
33 | *
34 | * @param example 条件
35 | * @param offset 跳过数量
36 | * @param limit 查询数量
37 | * @return 记录集
38 | */
39 | List selectByExample(@Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example, @Param("offset") Integer offset, @Param("limit") Integer limit);
40 |
41 | /**
42 | * 根据条件统计数量
43 | *
44 | * @param example 条件例子
45 | * @return 记录集数量
46 | */
47 | int countByExample(@Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example);
48 |
49 | /**
50 | * 根据主键更新记录
51 | *
52 | * @param record 记录
53 | * @return 更新数量
54 | */
55 | int updateByPrimaryKey(Record record);
56 |
57 | /**
58 | * 根据主键更新有效字段记录
59 | *
60 | * @param record 记录
61 | * @return 更新数量
62 | */
63 | int updateByPrimaryKeySelective(Record record);
64 |
65 |
66 | /**
67 | * 根据条件更新记录
68 | *
69 | * @param record 记录
70 | * @param example 条件
71 | * @return 更新数量
72 | */
73 | int updateByExample(@Param("obj") Record record, @Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example);
74 |
75 | /**
76 | * 根据条件更新有效字段记录
77 | *
78 | * @param record 记录
79 | * @param example 条件
80 | * @return 更新数量
81 | */
82 | int updateByExampleSelective(@Param("obj") Record record, @Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example);
83 |
84 | /**
85 | * 根据主键删除记录
86 | *
87 | * @param id 主键
88 | * @return 更新数量
89 | */
90 | int deleteByPrimaryKey(Integer id);
91 |
92 | /**
93 | * 根据条件删除
94 | *
95 | * @param example 条件
96 | * @return 更新数量
97 | */
98 | int deleteByExample(@Param(ExampleWrapper.PARAM_NAME) ExampleWrapper example);
99 |
100 | /**
101 | * 添加记录
102 | *
103 | * @param record 实体类
104 | * @return 添加数量
105 | */
106 | int insert(Record record);
107 |
108 | /**
109 | * 批量添加记录
110 | *
111 | * @param records 记录集
112 | * @return 添加数量
113 | */
114 | int insertLoop(List records);
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/base/BaseModel.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.base;
2 |
3 | import org.apache.commons.lang3.builder.ToStringBuilder;
4 | import org.apache.commons.lang3.builder.ToStringStyle;
5 |
6 | import java.io.Serializable;
7 |
8 | /**
9 | * Created by APone on 2017/8/14.
10 | * POJO基类,实现Serializable接口
11 | */
12 | public class BaseModel implements Serializable{
13 |
14 | private static final long serialVersionUID = 2764427107524917616L;
15 |
16 | public String toString(){
17 |
18 | return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/base/BaseService.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.base;
2 |
3 |
4 | import java.util.List;
5 |
6 | /**
7 | * Created by APone on 2018/1/31 15:40.
8 | * 基础服务接口,定义了各个服务的通用操作
9 | */
10 | public interface BaseService {
11 |
12 | /**
13 | * 通用获取,获取范围为本表
14 | *
15 | * @param id 主键id
16 | * @return 记录集
17 | */
18 | Record selectByPrimaryKey(Integer id);
19 |
20 | /**
21 | * 根据条件获取第一条记录
22 | *
23 | * @param example 条件
24 | * @return 第一条记录
25 | */
26 | Record selectFirstByExample(ExampleWrapper example);
27 |
28 | /**
29 | * 根据条件获取记录
30 | *
31 | * @param example 条件
32 | * @param offset 跳过数量
33 | * @param limit 查询数量
34 | * @return 记录集
35 | */
36 | List selectByExample(ExampleWrapper example, Integer offset, Integer limit);
37 |
38 | /**
39 | * 根据条件统计数量
40 | *
41 | * @param example 条件例子
42 | * @return 记录集数量
43 | */
44 | int countByExample(ExampleWrapper example);
45 |
46 |
47 | /**
48 | * 通用根据主键id更新记录
49 | *
50 | * @param record 记录
51 | * @return 更新数量
52 | */
53 | int updateByPrimaryKey(Record record);
54 |
55 | /**
56 | * 通用根据主键id更新记录有效字段
57 | *
58 | * @param record 记录
59 | * @return 更新数量
60 | */
61 | int updateByPrimaryKeySelective(Record record);
62 |
63 | /**
64 | * 根据条件更新记录
65 | *
66 | * @param record 记录
67 | * @param example 条件
68 | * @return 更新数量
69 | */
70 | int updateByExample(Record record, ExampleWrapper example);
71 |
72 | /**
73 | * 根据条件更新有效字段记录
74 | *
75 | * @param record 记录
76 | * @param example 条件
77 | * @return 更新数量
78 | */
79 | int updateByExampleSelective(Record record, ExampleWrapper example);
80 |
81 | /**
82 | * 通用根据主键id删除记录
83 | *
84 | * @param id 主键id
85 | * @return 更新数量
86 | */
87 | int deleteByPrimaryKey(Integer id);
88 |
89 | /**
90 | * 根据条件删除
91 | *
92 | * @param example 条件
93 | * @return 更新数量
94 | */
95 | int deleteByExample(ExampleWrapper example);
96 |
97 | /**
98 | * 通用插入记录,并记录获得生成的主键id
99 | *
100 | * @param record 记录
101 | * @return 插入数量
102 | */
103 | int insert(Record record);
104 |
105 | /**
106 | * 通用批量插入记录,并所有记录获得生成的主键id
107 | *
108 | * @param records 记录集
109 | * @return 插入数量
110 | */
111 | int insertLoop(List records);
112 | }
113 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/base/CRUDException.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.base;
2 |
3 | /**
4 | * Created by APone on 2018/2/6 0:36.
5 | * 用于事务出现异常回滚的抛出自定义异常
6 | */
7 | public class CRUDException extends RuntimeException {
8 |
9 | private static final long serialVersionUID = 9182577027449098462L;
10 |
11 | public CRUDException() {
12 | }
13 |
14 | public CRUDException(String message) {
15 | super(message);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/base/ExampleWrapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.base;
2 |
3 | import com.baomidou.mybatisplus.mapper.EntityWrapper;
4 | import org.apache.commons.lang3.builder.ToStringBuilder;
5 |
6 | import java.io.Serializable;
7 |
8 | /**
9 | * 条件构造器标准,用于数据库查询的标准条件
10 | */
11 | public class ExampleWrapper extends EntityWrapper implements Serializable {
12 |
13 | //参数别名常量,用于mybatis
14 | public static final String PARAM_NAME = "ex";
15 |
16 | private static final long serialVersionUID = 1612189027479401986L;
17 |
18 | public ExampleWrapper() {
19 | super.setParamAlias(PARAM_NAME);
20 | }
21 |
22 | @Override
23 | public String toString() {
24 | return ToStringBuilder.reflectionToString(this);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/AuditState.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/8/23.
5 | * 审核等状态
6 | */
7 | public class AuditState {
8 |
9 | /**
10 | * 否决
11 | */
12 | public static final int REJECT = 0;
13 |
14 | /**
15 | * 通过
16 | */
17 | public static final int PASS = 1;
18 |
19 | /**
20 | * 待审(审核中)
21 | */
22 | public static final int AUDITING = 2;
23 |
24 | /**
25 | * 已经删除了
26 | */
27 | public static final int DELETE=3;
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/AvailableState.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/8/15.
5 | * 状态常量
6 | */
7 | public class AvailableState {
8 |
9 | /**
10 | * 无效的
11 | */
12 | public static final int UNAVAILABLE = 0;
13 |
14 | /**
15 | * 有效的
16 | */
17 | public static final int AVAILABLE = 1;
18 |
19 | /**
20 | * 待审(审核中),适用于社团申请或其他用于标识非审核状态的状态
21 | */
22 | public static final int AUDITING = 2;
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/ClubRole.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/8/26.
5 | * 社团角色
6 | */
7 | public class ClubRole {
8 |
9 | /**
10 | * 普通社员
11 | */
12 | public static final int MEMBER = 0;
13 |
14 | /**
15 | * 干事
16 | */
17 | public static final int SECRETARY = 1;
18 |
19 | /**
20 | * 部长
21 | */
22 | public static final int LEADER = 2;
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/DefaultField.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | import java.sql.Timestamp;
4 |
5 | /**
6 | * Created by APone on 2018/2/9 2:23.
7 | */
8 | public class DefaultField {
9 |
10 | /**
11 | * 默认字符为无
12 | */
13 | public static final String EMPTY = "无";
14 |
15 | /**
16 | * 默认手机号码,为空但不为null
17 | */
18 | public static final String DEFAULT_PHONE = "";
19 |
20 | /**
21 | * 默认头像图片文件名
22 | */
23 | public static final String DEFAULT_LOGO = "default_logo.jpg";
24 |
25 | /**
26 | * 默认性别,性别男
27 | */
28 | public static final int DEFAULT_GENDER = 0;
29 |
30 | /**
31 | * 默认昵称前缀,后面可以加其他标识
32 | */
33 | public static final String DEFAULT_NICKNAME = "sauims_";
34 |
35 | /**
36 | * 默认人数
37 | */
38 | public static final int DEFAULT_MEMBERS = 0;
39 |
40 | /**
41 | * 默认社团预览图问文件名(展示图)
42 | */
43 | public static final String DEFAULT_CLUB_OVERVIEW = "default_overview.png";
44 |
45 | /**
46 | * 默认时间,以1970年开始
47 | */
48 | public static final Timestamp DEFAULT_TIME = new Timestamp(0);
49 | }
50 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/FIleDefaultPath.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2018/2/10 21:32.
5 | * 各类文件存放默认路径
6 | */
7 | public class FIleDefaultPath {
8 |
9 | /**
10 | * 文件根目录
11 | */
12 | private static final String FILE_ROOT = "WEB-INF/file/";
13 |
14 | /**
15 | * 图片文件根目录
16 | */
17 | private static final String IMAGES_ROOT = "WEB-INF/resources/";
18 |
19 | /**
20 | * 社团注册审核文件存放路径
21 | */
22 | public static final String CLUB_AUDIT_FILE = WebAppPath.WEB_APP_ROOT + FILE_ROOT + "club_audit/";
23 |
24 | /**
25 | * 社团注册审核在线浏览文件存放路径
26 | */
27 | public static final String CLUB_AUDIT_OVERVIEW_FILE = WebAppPath.WEB_APP_ROOT + FILE_ROOT + "club_audit_ol/";
28 |
29 | /**
30 | * 社团年度审核文件存放路径
31 | */
32 | public static final String CLUB_ANN_AUDIT_FILE = WebAppPath.WEB_APP_ROOT + FILE_ROOT + "ann/";
33 |
34 | /**
35 | * 社团年度审核在线浏览文件存放路径
36 | */
37 | public static final String CLUB_ANN_AUDIT_OVERVIEW_FILE = WebAppPath.WEB_APP_ROOT + FILE_ROOT + "ann_ol/";
38 |
39 | /**
40 | * 信息附件文件存放路径
41 | */
42 | public static final String MESSAGE_ANNEX_FILE = WebAppPath.WEB_APP_ROOT + FILE_ROOT + "msg_annex/";
43 |
44 | /**
45 | * 社团用户头像文件存放路径
46 | */
47 | public static final String CLUB_LOGO_FILE = WebAppPath.WEB_APP_ROOT + IMAGES_ROOT + "logo/";
48 |
49 | /**
50 | * 社团预览图文件存放路径
51 | */
52 | public static final String CLUB_VIEW_FILE = WebAppPath.WEB_APP_ROOT + IMAGES_ROOT + "club_view/";
53 |
54 | /**
55 | * 普通用户头像文件存放路径
56 | */
57 | public static final String PERSON_LOGO_FILE = WebAppPath.WEB_APP_ROOT + IMAGES_ROOT + "logo/";
58 |
59 | /**
60 | * 校社联用户头像文件存放路径
61 | */
62 | public static final String SAU_LOGO_FILE = WebAppPath.WEB_APP_ROOT + IMAGES_ROOT + "logo/";
63 |
64 | /**
65 | * 校社联预览图文件存放路径
66 | */
67 | public static final String SAU_VIEW_FILE = WebAppPath.WEB_APP_ROOT + IMAGES_ROOT + "sau_view/";
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/MemberState.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2018/2/28 2:45.
5 | * 组织成员状态
6 | * @author zhangcanlong
7 | * @since 2019-05-02 修改
8 | */
9 | public class MemberState {
10 |
11 | /**
12 | * 审核状态,同时也是在不在部门的状态,0不在,审核不通过
13 | */
14 | public static final int LEAVE = 0;
15 |
16 | /**
17 | * 审核状态,同时也是在不在部门的状态,,1在,审核通过
18 | */
19 | public static final int STILL_BEING = 1;
20 | /**
21 | * 待审(审核中),适用于社团申请或其他用于标识非审核状态的状态
22 | */
23 | public static final int AUDITING = 2;
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/MessageType.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/9/4.
5 | * 消息种类常量
6 | */
7 | public class MessageType {
8 |
9 | /**
10 | * 全体消息
11 | */
12 | public static final int ALL = 0;
13 |
14 | /**
15 | * 社团内部消息
16 | */
17 | public static final int Org = 1;
18 |
19 | /**
20 | * 自定义消息
21 | */
22 | public static final int CUSTOM = 2;
23 |
24 | /**
25 | * 未读
26 | */
27 | public static final int UN_READ = 0;
28 |
29 | /**
30 | * 已读
31 | */
32 | public static final int HAVE_READ = 1;
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/Operation.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2018/2/7 1:25.
5 | * 操作状态,常用于与服务层部分服务操作返回状态
6 | * 需要用时会注释出
7 | */
8 | public class Operation {
9 |
10 | /**
11 | * 操作失败常量
12 | */
13 | public static final int FAILED = 0;
14 |
15 | /**
16 | * 操作成功常量
17 | */
18 | public static final int SUCCESSFULLY = 1;
19 |
20 | /**
21 | * 验证码错误常量
22 | */
23 | public static final int CAPTCHA_INCORRECT = 2;
24 |
25 | /**
26 | * 输入错误、为空、不符合要求
27 | */
28 | public static final int INPUT_INCORRECT = 3;
29 |
30 | /**
31 | * 操作取消
32 | */
33 | public static final int CANCEL = 4;
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/Register.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2018/2/24 3:01.
5 | * 注册状态常量
6 | */
7 | public class Register extends Operation {
8 |
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/ResponseCode.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/8/15.
5 | * 响应状态码
6 | */
7 | public class ResponseCode {
8 |
9 | /**
10 | * 成功
11 | */
12 | public static final int RESPONSE_SUCCESS = 0;
13 |
14 | /**
15 | * 输入或发送数据有误
16 | */
17 | public static final int REQUEST_ERROR = 1;
18 |
19 | /**
20 | * 后端出现错误
21 | */
22 | public static final int RESPONSE_ERROR = 2;
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/SystemRole.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by APone on 2017/9/4.
5 | * 系统角色常量
6 | */
7 | public class SystemRole {
8 |
9 | /**
10 | * 公共
11 | */
12 | public static final int PUBLIC = -1;
13 |
14 | /**
15 | * 普通用户
16 | */
17 | public static final int PERSON = 0;
18 |
19 | /**
20 | * 社团用户
21 | */
22 | public static final int CLUB = 1;
23 |
24 | /**
25 | * 校社联用户
26 | */
27 | public static final int SAU = 2;
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/constant/WebAppPath.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.constant;
2 |
3 | /**
4 | * Created by hasee on 2017/8/15.
5 | */
6 | public class WebAppPath {
7 |
8 | /**
9 | * web项目根目录,斜杠
10 | */
11 | static final String WEB_APP_ROOT = System.getProperty("root").replace("\\", "/");
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/exception/BusinessException.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.exception;
2 |
3 | /**
4 | * 自定义的service层异常类
5 | * @author zhangcanlong
6 | * @date 2018/8/19
7 | */
8 | public class BusinessException extends RuntimeException {
9 |
10 | private static final long serialVersionUID = 1L;
11 |
12 | public BusinessException(){
13 | }
14 | public BusinessException(String message){
15 | super(message);
16 | }
17 | public BusinessException(String message,Throwable cause){
18 | super(message,cause);
19 | }
20 | public BusinessException(Throwable cause){
21 | super(cause);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/json/JsonResult.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.json;
2 |
3 |
4 | import java.io.Serializable;
5 |
6 | /**
7 | * 用来产生返回数据的标准工具类
8 | * Created by hasee on 2017/8/15.
9 | */
10 | public class JsonResult implements Serializable {
11 |
12 | private static final long serialVersionUID = 8014073413945308268L;
13 |
14 | /**
15 | * 响应状态
16 | */
17 | private int code;
18 |
19 | /**
20 | * 响应信息
21 | */
22 | private String msg;
23 |
24 | /**
25 | * 响应数据
26 | */
27 | private Result data;
28 |
29 | /**
30 | * 构造函数
31 | */
32 | public JsonResult() {
33 | this.code = 0;
34 | this.msg = "";
35 | this.data = null;
36 | }
37 |
38 | /**
39 | * 设置返回数据的状态码和信息
40 | *
41 | * @param code 表示返回数据的状态码
42 | * @param msg 描述返回数据的错误信息,正确时候,则为空
43 | */
44 | public void setStateCode(int code, String msg) {
45 | this.code = code;
46 | this.msg = msg;
47 | }
48 |
49 | public int getCode() {
50 | return code;
51 | }
52 |
53 | public void setCode(int code) {
54 | this.code = code;
55 | }
56 |
57 | public String getMsg() {
58 | return msg;
59 | }
60 |
61 | public void setMsg(String msg) {
62 | this.msg = msg;
63 | }
64 |
65 | public Result getData() {
66 | return data;
67 | }
68 |
69 | public void setData(Result data) {
70 | this.data = data;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/IPUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import java.util.regex.Matcher;
5 | import java.util.regex.Pattern;
6 |
7 | /**
8 | * ip工具类
9 | */
10 | public class IPUtil {
11 |
12 | private final static String ERROR_IP = "127.0.0.1";
13 |
14 | private final static Pattern pattern = Pattern.
15 | compile("(2[5][0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})");
16 |
17 | /**
18 | * 取外网IP
19 | *
20 | * @param request 客户端请求
21 | * @return String
22 | */
23 | public static String getRemoteIp(HttpServletRequest request) {
24 | String ip = request.getHeader("x-real-ip");
25 | if (ip == null) {
26 | ip = request.getRemoteAddr();
27 | }
28 |
29 | //过滤反向代理的ip
30 | String[] ips = ip.split(",");
31 | if (ips.length >= 1) {
32 | //得到第一个IP,即客户端真实IP
33 | ip = ips[0];
34 | }
35 |
36 | ip = ip.trim();
37 | if (ip.length() > 23) {
38 | ip = ip.substring(0, 23);
39 | }
40 |
41 | return ip;
42 | }
43 |
44 | /**
45 | * 获取用户的真实ip
46 | *
47 | * @param request 客户端请求
48 | * @return String
49 | */
50 | public static String getUserIP(HttpServletRequest request) {
51 |
52 | // 优先取X-Real-IP
53 | String ip = request.getHeader("X-Real-IP");
54 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
55 | ip = request.getHeader("x-forwarded-for");
56 | }
57 | if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
58 | ip = request.getRemoteAddr();
59 | if ("0:0:0:0:0:0:0:1".equals(ip)) {
60 | ip = ERROR_IP;
61 | }
62 | }
63 |
64 | if ("unknown".equalsIgnoreCase(ip)) {
65 | ip = ERROR_IP;
66 | return ip;
67 | }
68 |
69 | int pos = ip.indexOf(',');
70 | if (pos >= 0) {
71 | ip = ip.substring(0, pos);
72 | }
73 |
74 | return ip;
75 | }
76 |
77 | /**
78 | * 判断ip是否符合规则
79 | *
80 | * @param ip ip地址
81 | * @return boolean
82 | */
83 | public static boolean isValidIP(String ip) {
84 | if (StringUtil.isEmpty(ip)) {
85 | return false;
86 | }
87 | Matcher matcher = pattern.matcher(ip);
88 | return matcher.matches();
89 | }
90 | }
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/ImageFileUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | import org.springframework.web.multipart.MultipartFile;
4 |
5 | import java.io.IOException;
6 | import java.util.List;
7 |
8 | /**
9 | * 处理图片的工具类类
10 | * Created by hasee on 2017/8/16.
11 | */
12 | public class ImageFileUtil {
13 |
14 | /**
15 | * 上传头像的方法
16 | *
17 | * @param files 文件
18 | * @param savePath 存放路径
19 | * @return 储存后的文件名或者null
20 | */
21 | public static List handle(MultipartFile[] files, String savePath) throws IOException {
22 | return FileUtil.fileHandle(files, savePath);
23 | }
24 |
25 | /**
26 | * 上传头像的方法
27 | *
28 | * @param file 文件
29 | * @param savePath 存放路径
30 | * @return 储存后的文件名或者null
31 | */
32 | public static String handle(MultipartFile file, String savePath) throws IOException {
33 | return FileUtil.fileHandle(file, savePath);
34 | }
35 |
36 | /**
37 | * 上传头像的方法
38 | *
39 | * @param files 文件
40 | * @param savePath 存放路径
41 | * @param fileName 不含后缀文件名
42 | * @return 储存后的文件名或者null
43 | */
44 | public static List handle(MultipartFile[] files, String savePath, String fileName) throws IOException {
45 | return FileUtil.fileHandle(files, savePath, fileName);
46 | }
47 |
48 | /**
49 | * 上传头像的方法
50 | *
51 | * @param file 文件
52 | * @param savePath 存放路径
53 | * @param fileName 不含后缀文件名
54 | * @return 储存后的文件名或者null
55 | */
56 | public static String handle(MultipartFile file, String savePath, String fileName) throws IOException {
57 | return FileUtil.fileHandle(file, savePath, fileName);
58 | }
59 |
60 | /**
61 | * 判断图片格式合法性
62 | *
63 | * @param file 文件
64 | * @return 是否正确
65 | */
66 | public static boolean isValid(MultipartFile file) {
67 | return (file != null
68 | && !file.getContentType().equals("image/png")
69 | && !file.getContentType().equals("image/jpeg")
70 | && !file.getContentType().equals("image/jpg")
71 | && !file.getContentType().equals("image/bmp"));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/MD5Util.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | import java.security.MessageDigest;
4 |
5 | /**
6 | * MD5加密工具类
7 | */
8 | public class MD5Util {
9 |
10 | /**
11 | * 传入原始密码,返回加密之后的密码字符串
12 | *
13 | * @param password String
14 | * @return String
15 | */
16 | public static String md5(String password) {
17 | try {
18 | //1)创建加密类对象
19 | MessageDigest md = MessageDigest.getInstance("md5");
20 | //2)进行加密
21 | byte[] byteArray = md.digest(password.getBytes());
22 |
23 | StringBuilder sb = new StringBuilder();
24 | for (byte b : byteArray) {
25 | sb.append(numToHex(b));
26 | }
27 | return sb.toString();
28 | } catch (Exception e) {
29 | e.printStackTrace();
30 | throw new RuntimeException(e);
31 | }
32 | }
33 |
34 | /**
35 | * 利用盐按照一定规则加密密码
36 | *
37 | * @return 加密后的密码
38 | */
39 | public static String encryptPwd(String password, String salt) {
40 | return md5(password + salt);
41 | }
42 |
43 | /**
44 | * 传入一个10进制的字节数值,返回2位的十六进制的字符串
45 | *
46 | * @param num byte
47 | * @return String
48 | */
49 | private static String numToHex(byte num) {
50 | /*
51 | * byte类型:
52 | * 无符号位 : 取值范围: 0 ~ 255
53 | * 有符号为: 取值范围: -128 ~ 127
54 | */
55 | int targetNum = 0;
56 | //如果是负数,则先转为正数,再进行计算;否则,直接使用
57 | if (num < 0) {
58 | targetNum = 256 + num;
59 | } else {
60 | targetNum = num;
61 | }
62 | //第一位字符的值
63 | int first = targetNum / 16;
64 | //第二位字符的值
65 | int sencond = targetNum % 16;
66 |
67 | return strArray[first] + strArray[sencond];
68 | }
69 |
70 | private static String[] strArray = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/RandomUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | import sun.misc.BASE64Encoder;
4 |
5 | import java.security.SecureRandom;
6 | import java.util.Random;
7 |
8 | /**
9 | * Created by APone on 2018/2/9 2:27.
10 | * 随机数工具
11 | */
12 | public class RandomUtil {
13 |
14 |
15 | private static final char[] base =
16 | {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
17 | 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
18 | '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '_'};
19 |
20 |
21 | /**
22 | * 生成盐
23 | *
24 | * @return 盐
25 | */
26 | public static String createSalt() {
27 | Random RANDOM = new SecureRandom();
28 | byte[] salt = new byte[16];
29 | RANDOM.nextBytes(salt);
30 | return new BASE64Encoder().encode(salt);
31 | }
32 |
33 | /**
34 | * 生成随机文件名
35 | *
36 | * @return 随机文件名
37 | */
38 | public static String createFileName(int fileNameLength) {
39 | Random random = new Random();
40 | StringBuilder sb = new StringBuilder();
41 | sb.append(base[random.nextInt(26)]);
42 |
43 | for (int i = 0; i < fileNameLength - 2; i++) {
44 | int num = random.nextInt(base.length);
45 | sb.append(base[num]);
46 | }
47 | //追加最后一个数字
48 | sb.append(base[random.nextInt(10) + 42]);
49 | return sb.toString();
50 | }
51 |
52 | /**
53 | * 生成随机文件名,长度为20位
54 | *
55 | * @return 随机文件名
56 | */
57 | public static String createFileName() {
58 | return createFileName(20);
59 | }
60 |
61 | public static void main(String[] args) throws Exception {
62 | String salt=createSalt();
63 | System.out.println(salt);
64 | System.out.println(MD5Util.md5("123456"+salt));
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/StringUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | /**
4 | * 字符串工具类
5 | */
6 | public class StringUtil {
7 |
8 | /**
9 | * 判断是否为空
10 | * @param string 字符串
11 | * @return 准确性
12 | */
13 | public static boolean isEmpty(String string) {
14 | return string == null || string.length() == 0;
15 | }
16 |
17 | /**
18 | * 去掉前后空格
19 | * @param str 字符串
20 | * @return 字符串
21 | */
22 | public static String trim(String str) {
23 | return org.apache.commons.lang3.StringUtils.trim(str);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/TimeUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils;
2 |
3 | import java.time.LocalDate;
4 |
5 | /**
6 | * Created by hasee on 2017/8/18.
7 | */
8 |
9 | public class TimeUtil {
10 |
11 | /**
12 | * 获取当前年份
13 | *
14 | * @return 年份
15 | */
16 | public static int getYear() {
17 | return LocalDate.now().getYear();
18 | }
19 |
20 | /**
21 | * 获取当前时间的毫秒级
22 | *
23 | * @return 毫秒级
24 | */
25 | public static long currentTime() {
26 | return System.currentTimeMillis();
27 | }
28 | }
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/captcha/CaptchaImgFont.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.captcha;
2 |
3 | import java.awt.*;
4 | import java.io.ByteArrayInputStream;
5 |
6 | /**
7 | * 验证码图片字体
8 | */
9 | class CaptchaImgFont {
10 |
11 | /**
12 | * 常量,由于太长,放到文件中,服务启动时加载到内存中
13 | */
14 | private static String fontStr = null;
15 |
16 | Font getFont(int fontHeight) {
17 | try {
18 | Font baseFont = Font.createFont(Font.TRUETYPE_FONT, new ByteArrayInputStream(hex2byte(fontStr)));
19 | return baseFont.deriveFont(Font.PLAIN, fontHeight);
20 | } catch (Exception e) {
21 | return new Font("Arial", Font.PLAIN, fontHeight);
22 | }
23 | }
24 |
25 | private byte[] hex2byte(String str) {
26 | if (str == null)
27 | return null;
28 | str = str.trim();
29 | int len = str.length();
30 | if (len == 0 || len % 2 == 1)
31 | return null;
32 |
33 | byte[] b = new byte[len / 2];
34 | try {
35 | for (int i = 0; i < str.length(); i += 2) {
36 | b[i / 2] = (byte) Integer.decode("0x" + str.substring(i, i + 2)).intValue();
37 | }
38 | return b;
39 | } catch (Exception e) {
40 | return null;
41 | }
42 | }
43 | }
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/captcha/CaptchaUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.captcha;
2 |
3 | /**
4 | * Created by APone on 2018/2/11 16:57.
5 | * 验证码工具类
6 | */
7 | public class CaptchaUtil {
8 |
9 | /**
10 | * 创建新的验证码实例
11 | *
12 | * @return 验证码信息
13 | */
14 | public static Captcha create() {
15 | return new Captcha();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/msg/email/EmailMsg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.msg.email;
2 |
3 | import org.springframework.mail.SimpleMailMessage;
4 |
5 |
6 | /**
7 | * 邮箱信息封装
8 | */
9 | public class EmailMsg extends SimpleMailMessage{
10 |
11 | private static final long serialVersionUID = -679182586827705228L;
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/msg/email/EmailUtil.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.msg.email;
2 |
3 |
4 | import com.fekpal.common.utils.StringUtil;
5 |
6 | import java.util.regex.Matcher;
7 | import java.util.regex.Pattern;
8 |
9 | /**
10 | * Created by hasee on 2017/8/18.
11 | * 邮箱合法性检测
12 | */
13 | public class EmailUtil {
14 |
15 | /**
16 | * 邮箱地址合法性正则表达式
17 | */
18 | private static final String email = "\\w{1,15}\\w{1,15}[@][a-z0-9]{2,}[.]\\p{Lower}{2,}";
19 |
20 | private static final Pattern patten = Pattern.compile(email);
21 |
22 | /**
23 | * 检查邮箱合法性
24 | *
25 | * @param email 邮箱地址
26 | * @return 是否正确
27 | */
28 | public static boolean isValid(String email) {
29 | /*
30 | p{Alpha}:内容是必选的,和字母字符[\p{Lower}\p{Upper}]等价。如:200896@163.com不是合法的。
31 | w{2,15}: 2~15个[a-zA-Z_0-9]字符;w{}内容是必选的。 如:dyh@152.com是合法的。
32 | [a-z0-9]{3,}:至少三个[a-z0-9]字符,[]内的是必选的;如:dyh200896@16.com是不合法的。
33 | [.]:'.'号时必选的; 如:dyh200896@163com是不合法的。
34 | p{Lower}{2,}小写字母,两个以上。如:dyh200896@163.c是不合法的。
35 | */
36 | if (StringUtil.isEmpty(email)) {
37 | return false;
38 | }
39 | Matcher matcher = patten.matcher(email);
40 | return matcher.matches();
41 | }
42 | }
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/msg/phone/PhoneSender.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.msg.phone;
2 |
3 | /**
4 | * 手机信息发送工具类
5 | */
6 | public class PhoneSender {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/common/utils/msg/phone/PhoneUtils.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.common.utils.msg.phone;
2 |
3 | import com.fekpal.common.utils.StringUtil;
4 |
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | /**
9 | * 手机工具类
10 | */
11 | public class PhoneUtils {
12 |
13 | private static final String regex="";
14 |
15 | private static final Pattern pattern=Pattern.compile(regex);
16 |
17 | public static boolean isValid(String phone){
18 | if(StringUtil.isEmpty(phone)){
19 | return false;
20 | }
21 | Matcher matcher=pattern.matcher(phone);
22 | return matcher.matches();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/AnniversaryAuditMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.AnniversaryAudit;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/23.
9 | */
10 | @Repository
11 | public interface AnniversaryAuditMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/AuditsViewMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.AuditsView;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2018/3/4 12:03.
9 | */
10 | @Repository
11 | public interface AuditsViewMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/ClubAuditMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.ClubAudit;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/23.
9 | */
10 | @Repository
11 | public interface ClubAuditMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/LikeOrgMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.LikeOrg;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/9/5.
9 | *
10 | */
11 | @Repository
12 | public interface LikeOrgMapper extends BaseMapper {
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/MemberMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.common.base.ExampleWrapper;
5 | import com.fekpal.dao.model.Member;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.springframework.stereotype.Repository;
8 |
9 | /**
10 | * Created by APone on 2018/3/6 21:47.
11 | */
12 | @Repository
13 | public interface MemberMapper extends BaseMapper {
14 |
15 | /**
16 | * 根据社团id统计社团内部男生数量
17 | *
18 | * @param OrgId 社团
19 | * @return 记录集数量
20 | */
21 | int countOrgManNum(int OrgId);
22 |
23 | /**
24 | * 根据社团id统计社团内部女生数量
25 | *
26 | * @param OrgId 社团
27 | * @return 记录集数量
28 | */
29 | int countOrgWomanNum(int OrgId);
30 |
31 |
32 | /**
33 | * 根据社团id和年级统计社团内部某个年级学生的数量
34 | *
35 | * @param orgId 社团
36 | * @param grade 年级
37 | * @return 记录集数量
38 | */
39 | int countOrgGradeNum(@Param("orgId")int orgId, @Param("grade")String grade);
40 | }
41 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/MemberOrgMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.common.base.ExampleWrapper;
5 | import com.fekpal.dao.model.MemberOrg;
6 | import org.apache.ibatis.annotations.Param;
7 | import org.springframework.stereotype.Repository;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | * Created by APone on 2018/2/26 20:39.
13 | */
14 | @Repository
15 | public interface MemberOrgMapper extends BaseMapper {
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/MessageMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.Message;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/23.
9 | */
10 | @Repository
11 | public interface MessageMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/MessageReceiveMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.MessageReceive;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/24.
9 | */
10 | @Repository
11 | public interface MessageReceiveMapper extends BaseMapper {
12 |
13 | /**
14 | * 插入尚未在接收公告记录表的信息本体记录
15 | *
16 | * @param receive 接收信息记录
17 | * @return 插入数量
18 | */
19 | int insertCommittedNote(MessageReceive receive);
20 |
21 | /**
22 | * 批量插入相同接收信息但接收人标识集不一样的记录
23 | *
24 | * @param receive 接收信息记录
25 | * @return 插入数量
26 | */
27 | int insertLoopOnlyWithReceiveId(MessageReceive receive);
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/OrgMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.common.base.ExampleWrapper;
5 | import com.fekpal.dao.model.Org;
6 | import com.fekpal.dao.model.PersonOrgView;
7 | import org.apache.ibatis.annotations.Param;
8 | import org.springframework.stereotype.Repository;
9 |
10 | /**
11 | * Created by APone on 2018/2/27 19:47.
12 | */
13 | @Repository
14 | public interface OrgMapper extends BaseMapper {
15 |
16 | PersonOrgView selectByPrimaryIdForPerson(Integer id);
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/OrgMemberMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.OrgMember;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * 提供组织成员表,准对某个组织的所有成员操作
9 | * Created by APone on 2017/8/23.
10 | */
11 | @Repository
12 | public interface OrgMemberMapper extends BaseMapper {
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/PersonMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.Person;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/15.
9 | */
10 | @Repository
11 | public interface PersonMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/SauAuditMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 |
4 | import com.fekpal.common.base.BaseMapper;
5 | import com.fekpal.dao.model.SauAuditRegister;
6 | import org.springframework.stereotype.Repository;
7 |
8 | /**
9 | * 校社联的审核注册服务,主要用来做有关校社联成员审核或社团审核相关的操作
10 | * @author zhangcanlong
11 | * @date 2018/7/9
12 | */
13 | @Repository
14 | public interface SauAuditMapper extends BaseMapper {
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/mapper/UserMapper.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.mapper;
2 |
3 | import com.fekpal.common.base.BaseMapper;
4 | import com.fekpal.dao.model.User;
5 | import org.springframework.stereotype.Repository;
6 |
7 | /**
8 | * Created by APone on 2017/8/15.
9 | */
10 | @Repository
11 | public interface UserMapper extends BaseMapper {
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/AnniversaryAudit.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | public class AnniversaryAudit extends BaseModel {
8 |
9 | private static final long serialVersionUID = -2315766494340261103L;
10 |
11 | /**
12 | * 自增id
13 | */
14 | private Integer id;
15 |
16 | /**
17 | * 提交的组织id
18 | */
19 | private Integer orgId;
20 |
21 | /**
22 | * 审核标题 varchar
23 | */
24 | private String auditTitle;
25 |
26 | /**
27 | * 文件名称 varchar(.docx)
28 | */
29 | private String fileName;
30 |
31 | /**
32 | * 审核状态 0:否决,1,通过,2,待审(暂定:3,删除)
33 | */
34 | private Integer auditState;
35 |
36 | private Timestamp auditTime;
37 |
38 | private String auditResult;
39 |
40 | private Timestamp submitTime;
41 |
42 | private String submitDescription;
43 |
44 | public String getAuditTitle() {
45 | return auditTitle;
46 | }
47 |
48 | public void setAuditTitle(String auditTitle) {
49 | this.auditTitle = auditTitle;
50 | }
51 |
52 | public Integer getId() {
53 | return id;
54 | }
55 |
56 | public void setId(Integer id) {
57 | this.id = id;
58 | }
59 |
60 | public Integer getOrgId() {
61 | return orgId;
62 | }
63 |
64 | public void setOrgId(Integer orgId) {
65 | this.orgId = orgId;
66 | }
67 |
68 | public String getFileName() {
69 | return fileName;
70 | }
71 |
72 | public void setFileName(String fileName) {
73 | this.fileName = fileName;
74 | }
75 |
76 | public Integer getAuditState() {
77 | return auditState;
78 | }
79 |
80 | public void setAuditState(Integer auditState) {
81 | this.auditState = auditState;
82 | }
83 |
84 | public Timestamp getAuditTime() {
85 | return auditTime;
86 | }
87 |
88 | public void setAuditTime(Timestamp auditTime) {
89 | this.auditTime = auditTime;
90 | }
91 |
92 | public String getAuditResult() {
93 | return auditResult;
94 | }
95 |
96 | public void setAuditResult(String auditResult) {
97 | this.auditResult = auditResult;
98 | }
99 |
100 | public Timestamp getSubmitTime() {
101 | return submitTime;
102 | }
103 |
104 | public void setSubmitTime(Timestamp submitTime) {
105 | this.submitTime = submitTime;
106 | }
107 |
108 | public String getSubmitDescription() {
109 | return submitDescription;
110 | }
111 |
112 | public void setSubmitDescription(String submitDescription) {
113 | this.submitDescription = submitDescription;
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/AuditsView.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | /**
8 | * Created by APone on 2018/3/4 12:05.
9 | */
10 | public class AuditsView extends BaseModel{
11 |
12 | private static final long serialVersionUID = -4481814094589741712L;
13 |
14 | private int id;
15 |
16 | private String title;
17 |
18 | private String name;
19 |
20 | private Timestamp time;
21 |
22 | private int type;
23 |
24 | private int result;
25 |
26 | public int getId() {
27 | return id;
28 | }
29 |
30 | public void setId(int id) {
31 | this.id = id;
32 | }
33 |
34 | public String getTitle() {
35 | return title;
36 | }
37 |
38 | public void setTitle(String title) {
39 | this.title = title;
40 | }
41 |
42 | public String getName() {
43 | return name;
44 | }
45 |
46 | public void setName(String name) {
47 | this.name = name;
48 | }
49 |
50 | public Timestamp getTime() {
51 | return time;
52 | }
53 |
54 | public void setTime(Timestamp time) {
55 | this.time = time;
56 | }
57 |
58 | public int getType() {
59 | return type;
60 | }
61 |
62 | public void setType(int type) {
63 | this.type = type;
64 | }
65 |
66 | public int getResult() {
67 | return result;
68 | }
69 |
70 | public void setResult(int result) {
71 | this.result = result;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/ClubAudit.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | public class ClubAudit extends BaseModel {
8 |
9 | private static final long serialVersionUID = -8822913989759898229L;
10 |
11 | private Integer id;
12 |
13 | private Integer orgId;
14 |
15 | private String auditTitle;
16 |
17 | private Timestamp registerTime;
18 |
19 | private Timestamp auditTime;
20 |
21 | private String auditResult;
22 |
23 | private String file;
24 |
25 | private String auditDescription;
26 |
27 | private String applyName;
28 |
29 | /**
30 | * 审核状态(0, 为拒绝。1为通过。2为待审核。3为删除)
31 | */
32 | private Integer auditState;
33 |
34 | public Integer getId() {
35 | return id;
36 | }
37 |
38 | public void setId(Integer id) {
39 | this.id = id;
40 | }
41 |
42 | public Integer getOrgId() {
43 | return orgId;
44 | }
45 |
46 | public void setOrgId(Integer orgId) {
47 | this.orgId = orgId;
48 | }
49 |
50 | public Integer getAuditState() {
51 | return auditState;
52 | }
53 |
54 | public void setAuditState(Integer auditState) {
55 | this.auditState = auditState;
56 | }
57 |
58 | public String getApplyName() {
59 | return applyName;
60 | }
61 |
62 | public void setApplyName(String applyName) {
63 | this.applyName = applyName;
64 | }
65 |
66 | public String getAuditTitle() {
67 | return auditTitle;
68 | }
69 |
70 | public void setAuditTitle(String auditTitle) {
71 | this.auditTitle = auditTitle;
72 | }
73 |
74 | public Timestamp getRegisterTime() {
75 | return registerTime;
76 | }
77 |
78 | public void setRegisterTime(Timestamp registerTime) {
79 | this.registerTime = registerTime;
80 | }
81 |
82 | public Timestamp getAuditTime() {
83 | return auditTime;
84 | }
85 |
86 | public void setAuditTime(Timestamp auditTime) {
87 | this.auditTime = auditTime;
88 | }
89 |
90 | public String getAuditResult() {
91 | return auditResult;
92 | }
93 |
94 | public void setAuditResult(String auditResult) {
95 | this.auditResult = auditResult;
96 | }
97 |
98 | public String getFile() {
99 | return file;
100 | }
101 |
102 | public void setFile(String file) {
103 | this.file = file;
104 | }
105 |
106 | public String getAuditDescription() {
107 | return auditDescription;
108 | }
109 |
110 | public void setAuditDescription(String auditDescription) {
111 | this.auditDescription = auditDescription;
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/LikeOrg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | /**
6 | * Created by APone on 2018/2/5 19:16.
7 | */
8 | public class LikeOrg extends BaseModel {
9 |
10 | private static final long serialVersionUID = -497770962000889055L;
11 |
12 | private Integer id;
13 |
14 | private Integer personId;
15 |
16 | private Integer orgId;
17 |
18 | /**
19 | * 默认为0,不点赞
20 | * 1 为点赞
21 | */
22 | private Integer available;
23 |
24 | public Integer getId() {
25 | return id;
26 | }
27 |
28 | public void setId(Integer id) {
29 | this.id = id;
30 | }
31 |
32 | public Integer getPersonId() {
33 | return personId;
34 | }
35 |
36 | public void setPersonId(Integer personId) {
37 | this.personId = personId;
38 | }
39 |
40 | public Integer getOrgId() {
41 | return orgId;
42 | }
43 |
44 | public void setOrgId(Integer orgId) {
45 | this.orgId = orgId;
46 | }
47 |
48 | public Integer getAvailable() {
49 | return available;
50 | }
51 |
52 | public void setAvailable(Integer available) {
53 | this.available = available;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/Member.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import com.fekpal.common.constant.AuditState;
5 |
6 | import java.sql.Timestamp;
7 |
8 | /**
9 | * Created by APone on 2018/3/6 21:50.
10 | */
11 | public class Member extends BaseModel {
12 |
13 | private static final long serialVersionUID = -1989466091093519928L;
14 |
15 | private Integer id;
16 |
17 | private Integer orgId;
18 |
19 | private Integer personId;
20 |
21 | private Integer memberDuty;
22 |
23 | /**
24 | * 离开状态(0,离开。1.还在该社团)
25 | */
26 | private Integer memberState;
27 |
28 | private Timestamp joinTime;
29 |
30 | private Timestamp leaveTime;
31 |
32 | private String orgDepartment;
33 | /**
34 | * 审核状态(0,拒绝。1:通过。2:审核中。3:删除),用户社团审核状态
35 | */
36 | private Integer available;
37 |
38 | public Integer getId() {
39 | return id;
40 | }
41 |
42 | public void setId(Integer id) {
43 | this.id = id;
44 | }
45 |
46 | public Integer getOrgId() {
47 | return orgId;
48 | }
49 |
50 | public void setOrgId(Integer orgId) {
51 | this.orgId = orgId;
52 | }
53 |
54 | public Integer getPersonId() {
55 | return personId;
56 | }
57 |
58 | public void setPersonId(Integer personId) {
59 | this.personId = personId;
60 | }
61 |
62 | public Integer getMemberDuty() {
63 | return memberDuty;
64 | }
65 |
66 | public void setMemberDuty(Integer memberDuty) {
67 | this.memberDuty = memberDuty;
68 | }
69 |
70 | public Integer getMemberState() {
71 | return memberState;
72 | }
73 |
74 | public void setMemberState(Integer memberState) {
75 | this.memberState = memberState;
76 | }
77 |
78 | public Timestamp getJoinTime() {
79 | return joinTime;
80 | }
81 |
82 | public void setJoinTime(Timestamp joinTime) {
83 | this.joinTime = joinTime;
84 | }
85 |
86 | public Timestamp getLeaveTime() {
87 | return leaveTime;
88 | }
89 |
90 | public void setLeaveTime(Timestamp leaveTime) {
91 | this.leaveTime = leaveTime;
92 | }
93 |
94 | public String getOrgDepartment() {
95 | return orgDepartment;
96 | }
97 |
98 | public void setOrgDepartment(String orgDepartment) {
99 | this.orgDepartment = orgDepartment;
100 | }
101 |
102 | public Integer getAvailable() {
103 | return available;
104 | }
105 |
106 | public void setAvailable(Integer available) {
107 | this.available = available;
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/MemberOrg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 |
4 | import java.sql.Timestamp;
5 |
6 | /**
7 | * Created by APone on 2018/2/26 20:27.
8 | */
9 | public class MemberOrg extends Org {
10 |
11 | private static final long serialVersionUID = 6300840844736636054L;
12 |
13 | private Integer id;
14 |
15 | private Integer personId;
16 |
17 | private Integer memberDuty;
18 |
19 | /**
20 | * 默认状态是在部门里面
21 | */
22 | private Integer memberState=1;
23 |
24 | private Timestamp joinTime;
25 |
26 | private Timestamp leaveTime;
27 |
28 | /**
29 | * 默认部分为无
30 | */
31 | private String orgDepartment="无";
32 |
33 | private Integer available;
34 |
35 | public Integer getId() {
36 | return id;
37 | }
38 |
39 | public void setId(Integer id) {
40 | this.id = id;
41 | }
42 |
43 | public Integer getPersonId() {
44 | return personId;
45 | }
46 |
47 | public void setPersonId(Integer personId) {
48 | this.personId = personId;
49 | }
50 |
51 | public Integer getMemberDuty() {
52 | return memberDuty;
53 | }
54 |
55 | public void setMemberDuty(Integer memberDuty) {
56 | this.memberDuty = memberDuty;
57 | }
58 |
59 | public Integer getMemberState() {
60 | return memberState;
61 | }
62 |
63 | public void setMemberState(Integer memberState) {
64 | this.memberState = memberState;
65 | }
66 |
67 | public Timestamp getJoinTime() {
68 | return joinTime;
69 | }
70 |
71 | public void setJoinTime(Timestamp joinTime) {
72 | this.joinTime = joinTime;
73 | }
74 |
75 | public Timestamp getLeaveTime() {
76 | return leaveTime;
77 | }
78 |
79 | public void setLeaveTime(Timestamp leaveTime) {
80 | this.leaveTime = leaveTime;
81 | }
82 |
83 | public String getOrgDepartment() {
84 | return orgDepartment;
85 | }
86 |
87 | public void setOrgDepartment(String orgDepartment) {
88 | this.orgDepartment = orgDepartment;
89 | }
90 |
91 | public Integer getAvailable() {
92 | return available;
93 | }
94 |
95 | public void setAvailable(Integer available) {
96 | this.available = available;
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/Message.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | /**
8 | * 消息实体类
9 | * @author zhangcanlong
10 | */
11 | public class Message extends BaseModel {
12 |
13 | private static final long serialVersionUID = 7490442249324832127L;
14 |
15 | /**
16 | * 消息自增id
17 | */
18 | private Integer messageId;
19 |
20 | /**
21 | * 发布人或社团id
22 | */
23 | private Integer orgId;
24 |
25 | /**
26 | * 消息标题
27 | */
28 | private String messageTitle;
29 |
30 | /**
31 | * 消息内容
32 | */
33 | private String messageContent;
34 |
35 | /**
36 | * 发布时间
37 | */
38 | private Timestamp releaseTime;
39 |
40 | /**
41 | * 发布人名称
42 | */
43 | private String releaseName;
44 |
45 | /**
46 | * 消息类型 0:全体信息 1:社团内消息 2是自定义接受人的消息
47 | */
48 | private Integer messageType;
49 |
50 | /**
51 | * 消息附件
52 | */
53 | private String messageAnnex;
54 |
55 | private Integer messageState;
56 |
57 | public String getReleaseName() {
58 | return releaseName;
59 | }
60 |
61 | public void setReleaseName(String releaseName) {
62 | this.releaseName = releaseName;
63 | }
64 |
65 | public Integer getOrgId() {
66 | return orgId;
67 | }
68 |
69 | public void setOrgId(Integer orgId) {
70 | this.orgId = orgId;
71 | }
72 |
73 | public Integer getMessageId() {
74 | return messageId;
75 | }
76 |
77 | public void setMessageId(Integer messageId) {
78 | this.messageId = messageId;
79 | }
80 |
81 | public String getMessageTitle() {
82 | return messageTitle;
83 | }
84 |
85 | public void setMessageTitle(String messageTitle) {
86 | this.messageTitle = messageTitle;
87 | }
88 |
89 | public String getMessageContent() {
90 | return messageContent;
91 | }
92 |
93 | public void setMessageContent(String messageContent) {
94 | this.messageContent = messageContent;
95 | }
96 |
97 | public Timestamp getReleaseTime() {
98 | return releaseTime;
99 | }
100 |
101 | public void setReleaseTime(Timestamp releaseTime) {
102 | this.releaseTime = releaseTime;
103 | }
104 |
105 | public Integer getMessageType() {
106 | return messageType;
107 | }
108 |
109 | public void setMessageType(Integer messageType) {
110 | this.messageType = messageType;
111 | }
112 |
113 | public String getMessageAnnex() {
114 | return messageAnnex;
115 | }
116 |
117 | public void setMessageAnnex(String messageAnnex) {
118 | this.messageAnnex = messageAnnex;
119 | }
120 |
121 | public Integer getMessageState() {
122 | return messageState;
123 | }
124 |
125 | public void setMessageState(Integer messageState) {
126 | this.messageState = messageState;
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/MessageReceive.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import java.util.List;
4 |
5 | public class MessageReceive extends Message {
6 |
7 | private static final long serialVersionUID = 7974631739775373072L;
8 |
9 | private Integer id;
10 |
11 | private Integer receiveId;
12 |
13 | private Integer available;
14 |
15 | private Integer readFlag;
16 |
17 | private List receives;
18 |
19 | public List getReceives() {
20 | return receives;
21 | }
22 |
23 | public void setReceives(List receives) {
24 | this.receives = receives;
25 | }
26 |
27 | public Integer getId() {
28 | return id;
29 | }
30 |
31 | public void setId(Integer id) {
32 | this.id = id;
33 | }
34 |
35 | public Integer getReceiveId() {
36 | return receiveId;
37 | }
38 |
39 | public void setReceiveId(Integer receiveId) {
40 | this.receiveId = receiveId;
41 | }
42 |
43 | public Integer getAvailable() {
44 | return available;
45 | }
46 |
47 | public void setAvailable(Integer available) {
48 | this.available = available;
49 | }
50 |
51 | public Integer getReadFlag() {
52 | return readFlag;
53 | }
54 |
55 | public void setReadFlag(Integer readFlag) {
56 | this.readFlag = readFlag;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/OrgMember.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import java.sql.Timestamp;
4 |
5 | public class OrgMember extends Person {
6 |
7 | private static final long serialVersionUID = -3557278531392834590L;
8 |
9 | private Integer id;
10 |
11 | private Integer orgId;
12 |
13 | private Integer memberDuty;
14 |
15 | /**
16 | * 审核状态,同时也是在不在部门的状态,0不在,审核不通过,1在,审核通过,2在审核中,不在部门
17 | */
18 | private Integer memberState=1;
19 |
20 | private Timestamp joinTime;
21 |
22 | private Timestamp leaveTime;
23 |
24 | private String orgDepartment;
25 | /**
26 | * 状态,是否有效,默认有效
27 | **/
28 | private Integer available;
29 |
30 | public Integer getOrgId() {
31 | return orgId;
32 | }
33 |
34 | public void setOrgId(Integer orgId) {
35 | this.orgId = orgId;
36 | }
37 |
38 | public Integer getId() {
39 | return id;
40 | }
41 |
42 | public void setId(Integer id) {
43 | this.id = id;
44 | }
45 |
46 | public Integer getMemberDuty() {
47 | return memberDuty;
48 | }
49 |
50 | public void setMemberDuty(Integer memberDuty) {
51 | this.memberDuty = memberDuty;
52 | }
53 |
54 | public Integer getMemberState() {
55 | return memberState;
56 | }
57 |
58 | public void setMemberState(Integer memberState) {
59 | this.memberState = memberState;
60 | }
61 |
62 | public Timestamp getJoinTime() {
63 | return joinTime;
64 | }
65 |
66 | public void setJoinTime(Timestamp joinTime) {
67 | this.joinTime = joinTime;
68 | }
69 |
70 | public Timestamp getLeaveTime() {
71 | return leaveTime;
72 | }
73 |
74 | public void setLeaveTime(Timestamp leaveTime) {
75 | this.leaveTime = leaveTime;
76 | }
77 |
78 | public String getOrgDepartment() {
79 | return orgDepartment;
80 | }
81 |
82 | public void setOrgDepartment(String orgDepartment) {
83 | this.orgDepartment = orgDepartment;
84 | }
85 |
86 | public Integer getAvailable() {
87 | return available;
88 | }
89 |
90 | public void setAvailable(Integer available) {
91 | this.available = available;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/PersonOrgView.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | /**
4 | * Created by APone on 2018/3/4 20:14.
5 | */
6 | public class PersonOrgView extends Org {
7 |
8 | private static final long serialVersionUID = -3270267110110400581L;
9 |
10 | private int joinState;
11 |
12 | public int getJoinState() {
13 | return joinState;
14 | }
15 |
16 | public void setJoinState(int joinState) {
17 | this.joinState = joinState;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/SauAuditRegister.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | /**
8 | * 校社联审核社团和校社联成员的注册
9 | * @author zhangcanlong
10 | * @date 2018/7/9
11 | */
12 | public class SauAuditRegister extends BaseModel {
13 |
14 | private static final long serialVersionUID = 7855559872220869969L;
15 | /**
16 | * 审核消息的id
17 | */
18 | private Integer auditMsgId;
19 | /**
20 | * 审核消息的标题(是社团名或者校社联内成员名)
21 | */
22 | private String auditTitle;
23 | /**
24 | * 注册人的姓名
25 | */
26 | private String registerName;
27 | /**
28 | * 注册时间
29 | */
30 | private Timestamp registerTime;
31 | /**
32 | * 审核状态,0为审核为通过,1为审核通过,2为正在审核
33 | */
34 | private Integer auditState;
35 | /**
36 | * 审核的角色,是审核社团还是审核校社联内成员,审核社团内成员则为0,审核社团则为1,
37 | */
38 | private Integer role;
39 |
40 | public Integer getAuditMsgId() {
41 | return auditMsgId;
42 | }
43 |
44 | public void setAuditMsgId(Integer auditMsgId) {
45 | this.auditMsgId = auditMsgId;
46 | }
47 |
48 | public String getAuditTitle() {
49 | return auditTitle;
50 | }
51 |
52 | public void setAuditTitle(String auditTitle) {
53 | this.auditTitle = auditTitle;
54 | }
55 |
56 | public String getRegisterName() {
57 | return registerName;
58 | }
59 |
60 | public void setRegisterName(String registerName) {
61 | this.registerName = registerName;
62 | }
63 |
64 | public Timestamp getRegisterTime() {
65 | return registerTime;
66 | }
67 |
68 | public void setRegisterTime(Timestamp registerTime) {
69 | this.registerTime = registerTime;
70 | }
71 |
72 | public Integer getAuditState() {
73 | return auditState;
74 | }
75 |
76 | public void setAuditState(Integer auditState) {
77 | this.auditState = auditState;
78 | }
79 |
80 | public Integer getRole() {
81 | return role;
82 | }
83 |
84 | public void setRole(Integer role) {
85 | this.role = role;
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/UniqueMsg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import org.springframework.stereotype.Component;
5 |
6 | /**
7 | * Created by APone on 2018/2/25 2:01.
8 | * 唯一注册信息封装
9 | * 既该字段的信息在数据库中是唯一的
10 | */
11 | @Component
12 | public class UniqueMsg extends BaseModel{
13 |
14 | private static final long serialVersionUID = 7855293806664844884L;
15 |
16 | private String userName;
17 |
18 | private String email;
19 |
20 | private String clubName;
21 |
22 | public String getUserName() {
23 | return userName;
24 | }
25 |
26 | public void setUserName(String userName) {
27 | this.userName = userName;
28 | }
29 |
30 | public String getEmail() {
31 | return email;
32 | }
33 |
34 | public void setEmail(String email) {
35 | this.email = email;
36 | }
37 |
38 | public String getClubName() {
39 | return clubName;
40 | }
41 |
42 | public void setClubName(String clubName) {
43 | this.clubName = clubName;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/dao/model/User.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.dao.model;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | public class User extends BaseModel {
8 |
9 | private static final long serialVersionUID = -6379875187449194006L;
10 |
11 | private Integer userId;
12 |
13 | private String userName;
14 |
15 | private String password;
16 |
17 | private String phone;
18 |
19 | private String email;
20 |
21 | private String userKey;
22 |
23 | private String loginIp;
24 |
25 | private Timestamp loginTime;
26 |
27 | private String registerIp;
28 |
29 | private Timestamp registerTime;
30 |
31 | private Integer authority;
32 |
33 | private Integer userState;
34 |
35 | public Integer getUserId() {
36 | return userId;
37 | }
38 |
39 | public void setUserId(Integer userId) {
40 | this.userId = userId;
41 | }
42 |
43 | public String getUserName() {
44 | return userName;
45 | }
46 |
47 | public void setUserName(String userName) {
48 | this.userName = userName;
49 | }
50 |
51 | public String getPassword() {
52 | return password;
53 | }
54 |
55 | public void setPassword(String password) {
56 | this.password = password;
57 | }
58 |
59 | public String getPhone() {
60 | return phone;
61 | }
62 |
63 | public void setPhone(String phone) {
64 | this.phone = phone;
65 | }
66 |
67 | public String getEmail() {
68 | return email;
69 | }
70 |
71 | public void setEmail(String email) {
72 | this.email = email;
73 | }
74 |
75 | public String getUserKey() {
76 | return userKey;
77 | }
78 |
79 | public void setUserKey(String userKey) {
80 | this.userKey = userKey;
81 | }
82 |
83 | public String getLoginIp() {
84 | return loginIp;
85 | }
86 |
87 | public void setLoginIp(String loginIp) {
88 | this.loginIp = loginIp;
89 | }
90 |
91 | public Timestamp getLoginTime() {
92 | return loginTime;
93 | }
94 |
95 | public void setLoginTime(Timestamp loginTime) {
96 | this.loginTime = loginTime;
97 | }
98 |
99 | public String getRegisterIp() {
100 | return registerIp;
101 | }
102 |
103 | public void setRegisterIp(String registerIp) {
104 | this.registerIp = registerIp;
105 | }
106 |
107 | public Timestamp getRegisterTime() {
108 | return registerTime;
109 | }
110 |
111 | public void setRegisterTime(Timestamp registerTime) {
112 | this.registerTime = registerTime;
113 | }
114 |
115 | public Integer getAuthority() {
116 | return authority;
117 | }
118 |
119 | public void setAuthority(Integer authority) {
120 | this.authority = authority;
121 | }
122 |
123 | public Integer getUserState() {
124 | return userState;
125 | }
126 |
127 | public void setUserState(Integer userState) {
128 | this.userState = userState;
129 | }
130 | }
131 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/dao/mapper/AuditsViewMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 | (select id, audit_title as title, apply_name as name, register_time as time, 0, audit_result as result from club_audit)union
11 | (select id, real_name as title, real_name as name, join_time as time, 1, available as result
12 | from member left join person_info on member.person_id = person_info.person_id)
13 |
14 |
15 |
21 |
22 |
28 |
29 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/dao/mapper/SauAuditMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | FROM (
12 |
13 | SELECT
14 | MEMBER.ID AS AUDITMSGID,
15 | PERSON_INFO.REAL_NAME AS AUDITTITLE,
16 | PERSON_INFO.REAL_NAME AS REGISTERNAME,
17 | JOIN_TIME AS REGISTERTIME,
18 | MEMBER_STATE AS AUDITSTATE,
19 | 0 AS ROLE
20 | FROM MEMBER, PERSON_INFO
21 | WHERE MEMBER.PERSON_ID = PERSON_INFO.PERSON_ID AND ORG_ID = 11
22 | UNION ALL
23 | SELECT
24 | ID AS AUDITMSGID,
25 | AUDIT_TITLE AS AUDITTITLE,
26 | APPLY_NAME AS REGISTERNAME,
27 | REGISTER_TIME AS REGISTERTIME,
28 | AUDIT_STATE AS AUDITSTATE,
29 | 1 AS ROLE
30 | FROM CLUB_AUDIT
31 | ) A
32 |
33 |
34 |
48 |
49 |
63 |
64 |
72 |
73 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/impl/OrgMemberAuditServiceImpl.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.impl;
2 |
3 | import com.fekpal.api.OrgMemberAuditService;
4 | import com.fekpal.common.base.BaseServiceImpl;
5 | import com.fekpal.dao.mapper.OrgMemberMapper;
6 | import com.fekpal.dao.model.OrgMember;
7 | import org.springframework.beans.factory.annotation.Autowired;
8 | import org.springframework.stereotype.Service;
9 |
10 | import javax.servlet.http.HttpSession;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by APone on 2018/2/26 19:20.
15 | */
16 | @Service
17 | public class OrgMemberAuditServiceImpl extends BaseServiceImpl implements OrgMemberAuditService {
18 |
19 | @Autowired
20 | private HttpSession session;
21 |
22 | @Override
23 | public OrgMember selectAuditById(int id) {
24 | return null;
25 | }
26 |
27 | @Override
28 | public List selectNewAudit(int offset, int limit) {
29 | return null;
30 | }
31 |
32 | @Override
33 | public int passMemberApply(int id) {
34 | return 0;
35 | }
36 |
37 | @Override
38 | public int rejectMemberApply(int id) {
39 | return 0;
40 | }
41 |
42 | @Override
43 | public List loadAllAudit(int offset, int limit) {
44 | return null;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/impl/TestSessionImpl.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.impl;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.stereotype.Service;
5 | import sun.java2d.opengl.WGLSurfaceData;
6 |
7 | import javax.servlet.http.HttpSession;
8 | import java.net.HttpCookie;
9 |
10 | import static java.lang.System.out;
11 |
12 | @Service
13 | public class TestSessionImpl {
14 |
15 | @Autowired
16 | private HttpSession session;
17 |
18 | public void testSessionIsNull(){
19 | out.println("session为:"+session);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/ClubMsg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import org.springframework.web.multipart.MultipartFile;
5 |
6 | import java.sql.Timestamp;
7 |
8 | /**
9 | * Created by APone on 2018/2/23 16:50.
10 | */
11 | public class ClubMsg extends BaseModel{
12 |
13 | private static final long serialVersionUID = 8197472920074309865L;
14 |
15 | private String clubName;
16 |
17 | private MultipartFile logo;
18 |
19 | private MultipartFile view;
20 |
21 | private String description;
22 |
23 | private String adminName;
24 |
25 | private Timestamp foundTime;
26 |
27 | private String orgType;
28 |
29 | public static long getSerialVersionUID() {
30 | return serialVersionUID;
31 | }
32 |
33 | public ClubMsg() {
34 | }
35 |
36 | public String getOrgType() {
37 | return orgType;
38 |
39 | }
40 |
41 | public void setOrgType(String orgType) {
42 | this.orgType = orgType;
43 | }
44 |
45 | public String getClubName() {
46 | return clubName;
47 | }
48 |
49 | public void setClubName(String clubName) {
50 | this.clubName = clubName;
51 | }
52 |
53 | public MultipartFile getLogo() {
54 | return logo;
55 | }
56 |
57 | public void setLogo(MultipartFile logo) {
58 | this.logo = logo;
59 | }
60 |
61 | public MultipartFile getView() {
62 | return view;
63 | }
64 |
65 | public void setView(MultipartFile view) {
66 | this.view = view;
67 | }
68 |
69 | public String getDescription() {
70 | return description;
71 | }
72 |
73 | public void setDescription(String description) {
74 | this.description = description;
75 | }
76 |
77 | public String getAdminName() {
78 | return adminName;
79 | }
80 |
81 | public void setAdminName(String adminName) {
82 | this.adminName = adminName;
83 | }
84 |
85 | public Timestamp getFoundTime() {
86 | return foundTime;
87 | }
88 |
89 | public void setFoundTime(Timestamp foundTime) {
90 | this.foundTime = foundTime;
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/LoginResult.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | /**
6 | * Created by APone on 2018/2/22 13:55.
7 | * 登录结果封装
8 | */
9 | public class LoginResult extends BaseModel{
10 |
11 | private static final long serialVersionUID = -3640349510026355851L;
12 |
13 | /**
14 | * 登录结果
15 | */
16 | private Integer resultState;
17 |
18 | /**
19 | * 用户权限
20 | */
21 | private Integer authority;
22 |
23 | public Integer getResultState() {
24 | return resultState;
25 | }
26 |
27 | public void setResultState(Integer resultState) {
28 | this.resultState = resultState;
29 | }
30 |
31 | public Integer getAuthority() {
32 | return authority;
33 | }
34 |
35 | public void setAuthority(Integer authority) {
36 | this.authority = authority;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/PersonMsg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import org.springframework.stereotype.Component;
5 | import org.springframework.web.multipart.MultipartFile;
6 |
7 | import java.sql.Timestamp;
8 |
9 | /**
10 | * Created by APone on 2018/2/23 16:50.
11 | */
12 | public class PersonMsg extends BaseModel {
13 |
14 | private static final long serialVersionUID = -4430170524723540991L;
15 |
16 | private String realName;
17 |
18 | private String nickname;
19 |
20 | private Integer gender;
21 |
22 | private Timestamp birthday;
23 |
24 | private String description;
25 |
26 | private String address;
27 |
28 | private String department;
29 |
30 | private String major;
31 |
32 | private String studentId;
33 |
34 | private Integer enrollmentYear;
35 |
36 | private MultipartFile logo;
37 |
38 | public String getRealName() {
39 | return realName;
40 | }
41 |
42 | public void setRealName(String realName) {
43 | this.realName = realName;
44 | }
45 |
46 | public String getNickname() {
47 | return nickname;
48 | }
49 |
50 | public void setNickname(String nickname) {
51 | this.nickname = nickname;
52 | }
53 |
54 | public Integer getGender() {
55 | return gender;
56 | }
57 |
58 | public void setGender(Integer gender) {
59 | this.gender = gender;
60 | }
61 |
62 | public Timestamp getBirthday() {
63 | return birthday;
64 | }
65 |
66 | public void setBirthday(Timestamp birthday) {
67 | this.birthday = birthday;
68 | }
69 |
70 | public String getDescription() {
71 | return description;
72 | }
73 |
74 | public void setDescription(String description) {
75 | this.description = description;
76 | }
77 |
78 | public String getAddress() {
79 | return address;
80 | }
81 |
82 | public void setAddress(String address) {
83 | this.address = address;
84 | }
85 |
86 | public String getDepartment() {
87 | return department;
88 | }
89 |
90 | public void setDepartment(String department) {
91 | this.department = department;
92 | }
93 |
94 | public String getMajor() {
95 | return major;
96 | }
97 |
98 | public void setMajor(String major) {
99 | this.major = major;
100 | }
101 |
102 | public String getStudentId() {
103 | return studentId;
104 | }
105 |
106 | public void setStudentId(String studentId) {
107 | this.studentId = studentId;
108 | }
109 |
110 | public Integer getEnrollmentYear() {
111 | return enrollmentYear;
112 | }
113 |
114 | public void setEnrollmentYear(Integer enrollmentYear) {
115 | this.enrollmentYear = enrollmentYear;
116 | }
117 |
118 | public MultipartFile getLogo() {
119 | return logo;
120 | }
121 |
122 | public void setLogo(MultipartFile logo) {
123 | this.logo = logo;
124 | }
125 | }
126 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/PersonReg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 |
5 | import java.sql.Timestamp;
6 |
7 | /**
8 | * Created by APone on 2018/2/7 16:53.
9 | * 普通用户注册消息封装
10 | */
11 | public class PersonReg extends BaseModel {
12 |
13 | private static final long serialVersionUID = 632101732232330617L;
14 |
15 | private String userName;
16 |
17 | private String password;
18 |
19 | private String captcha;
20 |
21 | private Long currentTime;
22 |
23 | private Timestamp loginTime;
24 |
25 | private Timestamp registerTime;
26 |
27 | private String loginIp;
28 |
29 | private String registerIp;
30 |
31 | public String getUserName() {
32 | return userName;
33 | }
34 |
35 | public void setUserName(String userName) {
36 | this.userName = userName;
37 | }
38 |
39 | public Timestamp getLoginTime() {
40 | return loginTime;
41 | }
42 |
43 | public void setLoginTime(Timestamp loginTime) {
44 | this.loginTime = loginTime;
45 | }
46 |
47 | public Timestamp getRegisterTime() {
48 | return registerTime;
49 | }
50 |
51 | public void setRegisterTime(Timestamp registerTime) {
52 | this.registerTime = registerTime;
53 | }
54 |
55 | public String getLoginIp() {
56 | return loginIp;
57 | }
58 |
59 | public void setLoginIp(String loginIp) {
60 | this.loginIp = loginIp;
61 | }
62 |
63 | public String getRegisterIp() {
64 | return registerIp;
65 | }
66 |
67 | public void setRegisterIp(String registerIp) {
68 | this.registerIp = registerIp;
69 | }
70 |
71 | public static long getSerialVersionUID() {
72 | return serialVersionUID;
73 | }
74 |
75 | public String getPassword() {
76 | return password;
77 | }
78 |
79 | public void setPassword(String password) {
80 | this.password = password;
81 | }
82 |
83 | public String getCaptcha() {
84 | return captcha;
85 | }
86 |
87 | public void setCaptcha(String captcha) {
88 | this.captcha = captcha;
89 | }
90 |
91 | public Long getCurrentTime() {
92 | return currentTime;
93 | }
94 |
95 | public void setCurrentTime(Long currentTime) {
96 | this.currentTime = currentTime;
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/SRMsgRecord.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import org.springframework.web.multipart.MultipartFile;
5 |
6 | import java.sql.Timestamp;
7 | import java.util.List;
8 |
9 | /**
10 | * Created by APone on 2018/2/17 1:39.
11 | * 发送信息封装
12 | */
13 | public class SRMsgRecord extends BaseModel {
14 |
15 | private static final long serialVersionUID = -7551797442934277703L;
16 |
17 | /**
18 | * 降序
19 | */
20 | public static final String DESC = "desc";
21 |
22 | /**
23 | * 升序
24 | */
25 | public static final String ASC = "asc";
26 |
27 | /**
28 | * 信息标题
29 | */
30 | private String messageTitle;
31 |
32 | /**
33 | * 信息内容
34 | */
35 | private String messageContent;
36 |
37 | /**
38 | * 发送时间
39 | */
40 | private Timestamp releaseTime;
41 |
42 | /**
43 | * 信息附件
44 | */
45 | private MultipartFile messageAnnex;
46 |
47 | /**
48 | * 信息标识集
49 | */
50 | private List ids;
51 |
52 | /**
53 | * 接收人标识集
54 | */
55 | private List receives;
56 |
57 | /**
58 | * 排序
59 | */
60 | private String order;
61 |
62 | public List getReceives() {
63 | return receives;
64 | }
65 |
66 | public void setReceives(List receives) {
67 | this.receives = receives;
68 | }
69 |
70 | public List getIds() {
71 | return ids;
72 | }
73 |
74 | public void setIds(List ids) {
75 | this.ids = ids;
76 | }
77 |
78 | public String getMessageTitle() {
79 | return messageTitle;
80 | }
81 |
82 | public void setMessageTitle(String messageTitle) {
83 | this.messageTitle = messageTitle;
84 | }
85 |
86 | public String getMessageContent() {
87 | return messageContent;
88 | }
89 |
90 | public void setMessageContent(String messageContent) {
91 | this.messageContent = messageContent;
92 | }
93 |
94 | public Timestamp getReleaseTime() {
95 | return releaseTime;
96 | }
97 |
98 | public void setReleaseTime(Timestamp releaseTime) {
99 | this.releaseTime = releaseTime;
100 | }
101 |
102 | public MultipartFile getMessageAnnex() {
103 | return messageAnnex;
104 | }
105 |
106 | public void setMessageAnnex(MultipartFile messageAnnex) {
107 | this.messageAnnex = messageAnnex;
108 | }
109 |
110 | public String getOrder() {
111 | return order;
112 | }
113 |
114 | public void setOrder(String order) {
115 | this.order = order;
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/service/model/domain/SauMsg.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.service.model.domain;
2 |
3 | import com.fekpal.common.base.BaseModel;
4 | import org.springframework.web.multipart.MultipartFile;
5 |
6 | import java.sql.Timestamp;
7 |
8 |
9 | /**
10 | * Created by APone on 2018/2/23 16:41.
11 | * 校社联信息修改封装
12 | */
13 | public class SauMsg extends BaseModel {
14 |
15 | private static final long serialVersionUID = -8443026982283318374L;
16 |
17 | private String sauName;
18 |
19 | private Timestamp foundTime;
20 |
21 | private String description;
22 |
23 | private String adminName;
24 |
25 | private MultipartFile logo;
26 |
27 | private MultipartFile view;
28 |
29 | public void setView(MultipartFile view) {
30 | this.view = view;
31 | }
32 |
33 | public MultipartFile getView() {
34 |
35 | return view;
36 | }
37 |
38 | public String getSauName() {
39 | return sauName;
40 | }
41 |
42 |
43 | public void setSauName(String sauName) {
44 | this.sauName = sauName;
45 | }
46 |
47 | public Timestamp getFoundTime() {
48 | return foundTime;
49 | }
50 |
51 | public void setFoundTime(Timestamp foundTime) {
52 | this.foundTime = foundTime;
53 | }
54 |
55 | public String getDescription() {
56 | return description;
57 | }
58 |
59 | public void setDescription(String description) {
60 | this.description = description;
61 | }
62 |
63 | public String getAdminName() {
64 | return adminName;
65 | }
66 |
67 | public void setAdminName(String adminName) {
68 | this.adminName = adminName;
69 | }
70 |
71 | public MultipartFile getLogo() {
72 | return logo;
73 | }
74 |
75 | public void setLogo(MultipartFile logo) {
76 | this.logo = logo;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/web/filter/CorsFilter.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.web.filter;
2 |
3 | import com.fekpal.common.utils.StringUtil;
4 |
5 | import javax.servlet.*;
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 | import java.io.IOException;
9 | import java.util.Arrays;
10 | import java.util.List;
11 |
12 | /**
13 | * 跨域问题的filter,用于解决跨域问题,用于前端测试或者分布式发布,测试完成后,要删除该filter
14 | * @author zhangcanlong
15 | */
16 | public class CorsFilter implements Filter {
17 |
18 | /**
19 | * 用来存储 CORS 响应头的值,允许访问的客户端域名,例如:http://web.xxx.com,若为 *,则表示从任意域都能访问,即不做任何限制。
20 | */
21 | private String allowOrigin;
22 | /**
23 | * 用来存储 CORS 响应头的值,允许访问的方法名,多个方法名用逗号分割,例如:GET,POST,PUT,DELETE,OPTIONS。
24 | */
25 | private String allowMethods;
26 | /**
27 | * 用来存储 CORS 响应头的值,是否允许请求带有验证信息,若要获取客户端域下的 cookie 时,需要将其设置为 true。
28 | */
29 | private String allowCredentials;
30 | /**
31 | * 用来存储 CORS 响应头的值,允许服务端访问的客户端请求头,多个请求头用逗号分割,例如:Content-Type
32 | */
33 | private String allowHeaders;
34 | /**
35 | * 允许客户端访问的服务端响应头,多个响应头用逗号分割
36 | */
37 | private String exposeHeaders;
38 |
39 | //从web.xml中得到配置的参数
40 | @Override
41 | public void init(FilterConfig filterConfig) throws ServletException {
42 | allowOrigin = filterConfig.getInitParameter("allowOrigin");
43 | allowMethods = filterConfig.getInitParameter("allowMethods");
44 | allowCredentials = filterConfig.getInitParameter("allowCredentials");
45 | allowHeaders = filterConfig.getInitParameter("allowHeaders");
46 | exposeHeaders = filterConfig.getInitParameter("exposeHeaders");
47 | }
48 |
49 | @Override
50 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
51 | HttpServletRequest request = (HttpServletRequest) req;
52 | HttpServletResponse response = (HttpServletResponse) res;
53 | if (!StringUtil.isEmpty(allowOrigin)) {
54 | List allowOriginList = Arrays.asList(allowOrigin.split(","));
55 | if (allowOriginList != null && allowOriginList.size() !=0 ) {
56 | String currentOrigin = request.getHeader("Origin");
57 | if (allowOriginList.contains(currentOrigin)) {
58 | response.setHeader("Access-Control-Allow-Origin", currentOrigin);
59 | }
60 | }
61 | }
62 | if (!StringUtil.isEmpty(allowMethods)) {
63 | response.setHeader("Access-Control-Allow-Methods", allowMethods);
64 | }
65 | if (!StringUtil.isEmpty(allowCredentials)) {
66 | response.setHeader("Access-Control-Allow-Credentials", allowCredentials);
67 | }
68 | if (!StringUtil.isEmpty(allowHeaders)) {
69 | response.setHeader("Access-Control-Allow-Headers", allowHeaders);
70 | }
71 | if (!StringUtil.isEmpty(exposeHeaders)) {
72 | response.setHeader("Access-Control-Expose-Headers", exposeHeaders);
73 | }
74 | chain.doFilter(req, res);
75 | }
76 |
77 | @Override
78 | public void destroy() {
79 | }
80 | }
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/web/filter/EncodingFilter.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.web.filter;
2 |
3 | import org.springframework.web.filter.OncePerRequestFilter;
4 |
5 | import javax.servlet.FilterChain;
6 | import javax.servlet.ServletException;
7 | import javax.servlet.http.HttpServletRequest;
8 | import javax.servlet.http.HttpServletRequestWrapper;
9 | import javax.servlet.http.HttpServletResponse;
10 | import java.io.IOException;
11 | import java.io.UnsupportedEncodingException;
12 |
13 | /**
14 | * 自定义编码过滤器,解决乱码问题,主要处理get请求乱码问题
15 | * @author zhangcanlong
16 | * @2018/4/11
17 | */
18 | public class EncodingFilter extends OncePerRequestFilter {
19 |
20 | private String encoding;
21 |
22 | private boolean forceEncoding = false;
23 |
24 | public void setEncoding(String encoding) {
25 | this.encoding = encoding;
26 | }
27 |
28 | public void setForceEncoding(boolean forceEncoding) {
29 | this.forceEncoding = forceEncoding;
30 | }
31 |
32 | public String filter(HttpServletRequest request, String input) {
33 | String ret = input;
34 | // 客户端请求参数值可能为(null)服务端过滤掉当null处理即可
35 | if (input == null || input.trim().equals("(null)")) {
36 | return null;
37 | }
38 | final String method = request.getMethod();
39 | // 该处可以实现各种业务的自定义的过滤机制
40 | if ("get".equalsIgnoreCase(method)) {
41 | try {
42 | ret = new String(input.getBytes("UTF-8"), this.encoding);
43 | } catch (UnsupportedEncodingException e) {
44 | e.printStackTrace();
45 | }
46 | }
47 | return ret;
48 | }
49 |
50 | @Override
51 | protected void doFilterInternal(final HttpServletRequest request,
52 | HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
53 | //设置request和response的编码格式
54 | if (this.encoding != null && (this.forceEncoding || request.getCharacterEncoding() == null)) {
55 | request.setCharacterEncoding(this.encoding);
56 | if (this.forceEncoding) {
57 | response.setCharacterEncoding(this.encoding);
58 | }
59 | }
60 | //对request中的参数进行编码格式的转换
61 | filterChain.doFilter(new HttpServletRequestWrapper(request) {
62 | @Override
63 | public String getParameter(String name) {
64 | String value = super.getParameter(name);
65 | return filter(this, value);
66 | }
67 |
68 | @Override
69 | public String[] getParameterValues(String name) {
70 | String[] values = super.getParameterValues(name);
71 | if (values == null) {
72 | return null;
73 | }
74 | for (int i = 0; i < values.length; i++) {
75 | values[i] = filter(this, values[i]);
76 | }
77 | return values;
78 | }
79 | }, response);
80 |
81 | }
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/src/main/java/com/fekpal/web/handler/GlobalExceptionHandler.java:
--------------------------------------------------------------------------------
1 | package com.fekpal.web.handler;
2 |
3 | import com.fekpal.common.constant.ResponseCode;
4 | import com.fekpal.common.json.JsonResult;
5 | import org.springframework.validation.FieldError;
6 | import org.springframework.web.bind.MethodArgumentNotValidException;
7 | import org.springframework.web.bind.annotation.ControllerAdvice;
8 | import org.springframework.web.bind.annotation.ExceptionHandler;
9 | import org.springframework.web.bind.annotation.ResponseBody;
10 |
11 | import java.util.HashMap;
12 | import java.util.List;
13 | import java.util.Locale;
14 | import java.util.Map;
15 |
16 | /**
17 | * Created by APone on 2018/2/21 22:23.
18 | * 全局异常处理器,捕获控制层的异常并做统一处理返回
19 | */
20 | @ControllerAdvice
21 | public class GlobalExceptionHandler {
22 |
23 | /**
24 | * 自定义异常处理
25 | *
26 | * @param e 自定义异常封装
27 | * @return json封装
28 | */
29 | @ResponseBody
30 | @ExceptionHandler(Exception.class)
31 | public JsonResult