【毕业设计】基于springboot的大学生招聘网 - 招聘系统 就业系统
文章目录
- 1 前言
- 2 毕设课题目的
- 3 开发环境与技术栈
- 4 系统设计
- 4.1 系统模块设计
- 4.2 数据库设计
- 5 系统代码实现
- 5.1 maven配置
- 5.2 项目配置
- 5.3 拦截器配置
- 5.4 常用工具类
- 5.5 业务层代码
- 5.6 控制层代码
- 6 项目效果展示
- 7 最后
1 前言
Hi,同学们好呀,学长今天带大家复盘一个学长帮往届同学做的一个毕业作品
基于springboot的大学生招聘网 - 招聘系统 就业系统
2 毕设课题目的
本系统开发的意义一方面在于突破传统人才招聘的模式,给招聘者和求职者提供一个便利、高效、准确的网络招聘平台,使得双方可以在把成本降到最低的前提下,在更快的时间获得更加准确的信息,从而满足企业的用人需求,实现求职者的自我价值。另一方面在于完善网络招聘服务工作,建立服务体系,通过对用户需求的研究,开发出更符合实际应用的软件。
3 开发环境与技术栈
- 操作系统:Windows10
- 数据库版本:Oracle10g XE
- JDK版本:JDK1.8
- 服务器版本:apache-tomcat-8.0.24-windows-x64
- 后端 :Java、Springboot、redis、MyBatis
- 前端 :HTML+CSS实现页面布局,部分功能使用Jquery和Ajax减轻服务器端的压力。
4 系统设计
4.1 系统模块设计
功能模块包含:
- (1)个人用户注册,登录,修改密码
- (2)个人信息管理:查看,修改个人信息。
- (3)求职信息管理:修改自己的求职信息;发布自己的求职信息。
- (4)简历管理:查看,修改简历信息.
4.2 数据库设计
公司表
公司管理员表
公司收到简历表
用户表
获奖表
职位表
项目经验表
简历表
5 系统代码实现
5.1 maven配置
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.aistar</groupId>
<artifactId>zhaopin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>zhaopin</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- 使用jsp引擎,springboot内置tomcat没有此依赖 -->
<!--tomcat-embed-jasper-->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.31</version>
</dependency>
<!--分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.12</version>
</dependency>
<!-- ======================el====================== -->
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>3.0.0</version>
</dependency>
<!-- ======================standard====================== -->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
<!-- ======================jstl====================== -->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- ======================jstl-impl====================== -->
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
</dependency>
<!-- ==================自动管理 数据库连接池====druid====================== -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
<!--<!–=========================日志记录=========================–>-->
<!--<dependency>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-aop</artifactId>-->
<!--</dependency>-->
<!--热部署的依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
<!--Swagger-UI API文档生产工具-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<!--热部署-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
5.2 项目配置
server:
servlet:
context-path: /
port: 8081
logging:
level:
root: info
spring:
jackson:
date-format: yyyy-MM-dd
time-zone: GMT+8
serialization:
#格式化输出
indent_output: true
#忽略无法转换的对象
fail_on_empty_beans: false
#设置空如何序列化
defaultPropertyInclusion: NON_EMPTY
deserialization:
#允许对象忽略json中不存在的属性
fail_on_unknown_properties: false
parser:
#允许出现特殊字符和转义符
allow_unquoted_control_chars: true
#允许出现单引号
allow_single_quotes: true
mvc:
view:
prefix: /WEB-INF/jsp/
suffix: .jsp
# 配置开启springboot解析PUT和DELETE请求
hiddenmethod:
filter:
enabled: true
# datasource:
# driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/zhaopin?serverTimezone=UTC&useUnicode=true&characterencoding=utf8
# username: root
# password: root
datasource:
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/zhaopin?serverTimezone=UTC&useUnicode=true&characterencoding=utf8
username: root
password: 123456
#数据库连接池的参数配置
# 初始化连接数量
initial-size: 5
# 最大连接池数量
max-active: 30
# 最小连接池数量
min-idle: 5
# 获取连接时最大等待时间,单位毫秒
max-wait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
time-between-eviction-runs-millis: 60000
# 连接保持空闲而不被驱逐的最小时间
min-evictable-idle-time-millis: 300000
# 用来检测连接是否有效的sql,要求是一个查询语句
validation-query: SELECT 1 FROM DUAL
# 建议配置为true,不影响性能,并且保证安全性。申请连接的时候检测,如果空闲时间大于timeBetweenEvictionRunsMillis,执行validationQuery检测连接是否有效。
test-while-idle: true
# 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
test-on-borrow: false
# 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
test-on-return: false
# 是否缓存preparedStatement,也就是PSCache。PSCache对支持游标的数据库性能提升巨大,比如说oracle。在mysql下建议关闭。
pool-prepared-statements: true
# 要启用PSCache,必须配置大于0,当大于0时,poolPreparedStatements自动触发修改为true。
max-pool-prepared-statement-per-connection-size: 50
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计
filters: stat,wall,log4j2
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
# 合并多个DruidDataSource的监控数据
useGlobalDataSourceStat: true
stat-view-servlet:
login-username: admin #监控页面登录的用户名
login-password: admin #监控页面登录的密码
mybatis:
type-aliases-package: com.aistar.pojo
mapper-locations: classpath:com/aistar/mapper/*Mapper.xml
# 分页配置
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql
5.3 拦截器配置
@Configuration
public class ConfigRegistCanter implements WebMvcConfigurer {
//注册拦截器
//addPathPatterns 用来设置拦截路径
//excludePathPatterns 用来设置白名单,也就是不需要触发这个拦截器的路径。
//addPathPatterns("/**") 表示拦截所有的请求
//.excludePathPatterns("/login","/regist")表示出了登录与注册之外,都会拦截(因为登录注册不需要登录页可以访问)
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new MyInterceptor()).addPathPatterns("/company/**","/custmoer/center","/record/**","/resume/**","/job/**")
.excludePathPatterns("/job/getByPageForIndex");
/* .excludePathPatterns("/login")
.excludePathPatterns("/regist");*/
}
//这个方法是用来配置静态资源的,比如html,js,css等
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
}
}
5.4 常用工具类
public static ServerResponse addSuccess() {
return new ServerResponse(1, MessageUtil.ADD_SUCCESS);
}
public static ServerResponse addFailed() {
return new ServerResponse(0, MessageUtil.ADD_FAIL);
}
// ===========================================删除=====================================================
public static ServerResponse deleteSuccess() {
return new ServerResponse(1, MessageUtil.DELETE_SUCCESS);
}
public static ServerResponse deleteFailed() {
return new ServerResponse(0, MessageUtil.DELETE_FAIL);
}
// ===========================================修改=====================================================
public static ServerResponse modifySuccess() {
return new ServerResponse(1, MessageUtil.UPDATE_SUCCESS);
}
public static ServerResponse modifyFailed() {
return new ServerResponse(0, MessageUtil.UPDATE_FAIL);
}
// ===========================================查找=====================================================
public static ServerResponse getSuccess(Object data) {
ServerResponse serverResponse = new ServerResponse(1, MessageUtil.GET_SUCCESS);
serverResponse.setData(data);
return serverResponse;
}
public static ServerResponse getFailed() {
return new ServerResponse(0, MessageUtil.GET_FAIL);
}
public static ServerResponse getFailed(String data) {
ServerResponse serverResponse = new ServerResponse(0, MessageUtil.GET_FAIL);
serverResponse.setData(data);
return serverResponse;
}
// ===========================================constructor=====================================================
private ServerResponse(Integer status, String message) {
this.status = status;
this.message = message;
this.data = null;
}
5.5 业务层代码
/**
* @param username 手机号/邮箱
* @param password 密码
* @param userType 0手机号;1邮箱
* @return 结果集
*/
@Override
public ServerResponse getByUsernameAndPwd(String username, String password, Integer userType) {
CustomerExample example = new CustomerExample();
CustomerExample.Criteria criteria = example.createCriteria();
criteria.andStatusEqualTo(0);
if (userType == 0)
criteria.andCustTelnoEqualTo(Long.valueOf(username));
else
criteria.andCustEmailEqualTo(username);
criteria.andCustPasswordEqualTo(password);
List<Customer> customerList = customerMapper.selectByExample(example);
if (customerList != null) {
if (customerList.size() == 1)
return ServerResponse.getSuccess(customerList.get(0));
else if (customerList.size() > 1)
return ServerResponse.getFailed("用户异常,请联系管理员");
}
return ServerResponse.getFailed("用户名/密码错误,请重试");
}
@Override
public ServerResponse add(Customer customer) {
customer.setCustRegistTime(new Date());
customer.setStatus(0);
int rows = customerMapper.insert(customer);
if (rows > 0)
return ServerResponse.addSuccess();
return ServerResponse.addFailed();
}
@Override
public ServerResponse getByTelno(Long custTelno) {
CustomerExample example = new CustomerExample();
example.createCriteria().andCustTelnoEqualTo(custTelno).andStatusEqualTo(0);
List<Customer> customerList = customerMapper.selectByExample(example);
if (customerList != null && customerList.size() > 0) {
//找到用户了
return ServerResponse.getSuccess(customerList.get(0)); // 1,"查询数据成功",customer
} else // 用户不存在
return ServerResponse.getFailed("用户不存在"); // 0,"查询数据失败","用户不存在"
}
5.6 控制层代码
@Controller
@RequestMapping("/customer")
public class CustomerController {
private CustomerService customerService;
private ResumeService resumeService;
private ResumeJobCompanyRDRVOService resumeJobCompanyRDRVOService;
@Autowired
public CustomerController(ResumeJobCompanyRDRVOService resumeJobCompanyRDRVOService, CustomerService customerService, ResumeService resumeService) {
this.resumeJobCompanyRDRVOService = resumeJobCompanyRDRVOService;
this.customerService = customerService;
this.resumeService = resumeService;
}
// 个人中心跳转
@GetMapping("/center/{type}")
public String center(@PathVariable("type") Integer type, HttpServletRequest request) {
Customer customer = (Customer) request.getSession().getAttribute("loginCustomer");
ServerResponse serverResponse;
if (customer != null) {
if (type == 1) {
serverResponse = resumeService.getByCustomerId(customer.getCustId());
request.setAttribute("resumeList", serverResponse.getData());
} else if (type == 2) {
serverResponse = resumeJobCompanyRDRVOService.getByCustomerId(customer.getCustId());//封装了用户简历,工作 公司的对象
request.setAttribute("rdrList", serverResponse.getData());
}
request.setAttribute("type", type);//这里的type需要判断
return "customer/personalCenter";
} else
return "redirect:/"; // 未登录
}
// 登录ajax
@GetMapping("/login")
@ResponseBody
public ServerResponse login(String username, String password, Integer type, Integer userType, HttpServletRequest request) {
ServerResponse serverResponse = null;
if (1 == type) {
// 手机号、邮箱 & 密码
// userType = 0手机号;1邮箱
serverResponse = customerService.getByUsernameAndPwd(username, password, userType);
if (serverResponse.getStatus() == 1) {
// 登录成功 用户存在
Customer customer = (Customer) serverResponse.getData();
request.getSession().setAttribute("loginCustomer", customer);
}
} else {
// 手机号 & 验证码
System.out.println("手机号,验证码登录");
}
return serverResponse;
}
// 退出登录跳转
@RequestMapping("/logout")
public String register(HttpServletRequest request) {
request.getSession().removeAttribute("loginCustomer");
return "redirect:/";
}
// 注册ajax
@PostMapping("/add")
@ResponseBody
public ServerResponse register(Customer customer) {
customer.setCustName(customer.getCustTelno().toString());
return customerService.add(customer);
}
// 获取验证码ajax
@GetMapping("/getCode")
@ResponseBody
public ServerResponse getCheckedCode(Long custTelno) {
// 数据库中查看手机号是否已经注册
ServerResponse serverResponse = customerService.getByTelno(custTelno);
ServerResponse result;
if (serverResponse.getStatus() != 1) {
// 失败 - 用户不存在,可以创建
// 获取验证码 - 调用短信接口
// String code = GetMessageCode.getCode(telnoStr);
String code = "666666";
result = ServerResponse.getSuccess(code);
} else {
// 成功 - 用户已经存在
result = ServerResponse.getFailed("用户已存在,请前往登录页面");
}
return result;
}
}
6 项目效果展示
登录
主页
职位详情
公司简介
投递记录
编辑简历
简历列表
申请职位
还没有评论,来说两句吧...