Skip to content

Commit e3fc297

Browse files
committed
将项目文件编码改为UTF-8
1 parent d7677da commit e3fc297

File tree

64 files changed

+392
-390
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+392
-390
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

src/main/java/team/even/jobcrawler/controller/MainController.java

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package team.even.jobcrawler.controller;
1+
package team.even.jobcrawler.controller;
22

33
import java.io.IOException;
44
import java.io.OutputStream;
@@ -41,7 +41,7 @@ public class MainController
4141
public String index(HttpServletRequest request)
4242
{
4343
String remoteAddr = request.getRemoteAddr();
44-
logger.info("网友" + remoteAddr + "访问了首页。");
44+
logger.info("网友" + remoteAddr + "访问了首页。");
4545
return "index";
4646
}
4747

@@ -78,7 +78,7 @@ public String index(HttpServletRequest request)
7878
HttpServletRequest request) throws Exception
7979
{
8080
String remoteAddr = request.getRemoteAddr();
81-
logger.info("网友" + remoteAddr + "启动了爬虫。职业类型:" + kind + ",地区:" + distinct);
81+
logger.info("网友" + remoteAddr + "启动了爬虫。职业类型:" + kind + ",地区:" + distinct);
8282
List<JobTypes> list = JobTypesDAOFactory.getJobTypesDAOInstance()
8383
.findByKindandWorkPlace(kind, distinct);
8484
if(list.isEmpty())
@@ -116,10 +116,10 @@ public String index(HttpServletRequest request)
116116
public @ResponseBody String stopCrawler(HttpServletRequest request)
117117
{
118118
String remoteAddr = request.getRemoteAddr();
119-
logger.info("网友" + remoteAddr + "停止了爬虫。");
119+
logger.info("网友" + remoteAddr + "停止了爬虫。");
120120
Service service = Service.getInstance();
121121
service.close();
122-
String operation = "正在停止运行爬虫程序,请稍等...\n";
122+
String operation = "正在停止运行爬虫程序,请稍等...\n";
123123
return operation;
124124
}
125125

@@ -135,7 +135,7 @@ public String displayData()
135135
HttpServletRequest request) throws Exception
136136
{
137137
String remoteAddr = request.getRemoteAddr();
138-
logger.info("网友" + remoteAddr + "查看了" + workPlace + "地区" + kind + "职业的数据。");
138+
logger.info("网友" + remoteAddr + "查看了" + workPlace + "地区" + kind + "职业的数据。");
139139
List<JobData> list = JobDataDAOFactory.getJobDataDAOInstance()
140140
.findByKindandWorkPlace(kind, workPlace);
141141
return list;
@@ -147,7 +147,7 @@ public String displayData()
147147
@RequestParam(value="inputPassword")String inputPassword) throws Exception
148148
{
149149
Service service = Service.getInstance();
150-
if(service.checkPassword(inputPassword) == true) //口令正确
150+
if(service.checkPassword(inputPassword) == true) //口令正确
151151
{
152152
boolean flag = true;
153153
boolean flag1 = JobDataDAOFactory
@@ -165,7 +165,7 @@ public String displayData()
165165
return String.valueOf(false);
166166
}
167167
}
168-
else //口令错误
168+
else //口令错误
169169
{
170170
return "passwordError";
171171
}
@@ -185,7 +185,7 @@ public String generateReport()
185185
HttpServletRequest request) throws Exception
186186
{
187187
String remoteAddr = request.getRemoteAddr();
188-
logger.info("网友" + remoteAddr + "查看了" + district + "地区" + kind + "职业的报告。");
188+
logger.info("网友" + remoteAddr + "查看了" + district + "地区" + kind + "职业的报告。");
189189
Map<String, String> dataMap = new HashMap<String, String>();
190190
DataAnalyzer analyzer = new DataAnalyzer();
191191
dataMap = analyzer.analyzeSalary(kind, district);
@@ -241,7 +241,7 @@ public String password()
241241
String oldPassword = request.getParameter("oldPassword");
242242
String newPassword = request.getParameter("newPassword");
243243
Service service = Service.getInstance();
244-
if(service.checkPassword(oldPassword) == true) //密码正确
244+
if(service.checkPassword(oldPassword) == true) //密码正确
245245
{
246246
if(service.updatePassword(newPassword) == true)
247247
{
@@ -252,7 +252,7 @@ public String password()
252252
return "error!";
253253
}
254254
}
255-
else //密码错误
255+
else //密码错误
256256
{
257257
return "failure";
258258
}

src/main/java/team/even/jobcrawler/model/dataAnalyzer/DataAnalyzer.java

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package team.even.jobcrawler.model.dataAnalyzer;
1+
package team.even.jobcrawler.model.dataAnalyzer;
22

33
import java.util.HashMap;
44
import java.util.List;
@@ -10,25 +10,25 @@
1010
import team.even.jobcrawler.model.db.vo.JobData;
1111

1212
/**
13-
* 数据分析器,对爬虫程序获取的信息进行分析,为生成报告提供数据支持
14-
* @author 曾裕文
13+
* 数据分析器,对爬虫程序获取的信息进行分析,为生成报告提供数据支持
14+
* @author 曾裕文
1515
*
1616
*/
1717
public class DataAnalyzer
1818
{
1919
/**
20-
* 分析jobdata表中符合条件的月薪,统计各范围内的数量
21-
* @param kind 职业种类条件
22-
* @param district 地区条件
23-
* @return 以范围/月薪的形式输出在各个范围内的数量统计
20+
* 分析jobdata表中符合条件的月薪,统计各范围内的数量
21+
* @param kind 职业种类条件
22+
* @param district 地区条件
23+
* @return 以范围/月薪的形式输出在各个范围内的数量统计
2424
* @throws Exception
2525
*/
2626
public Map<String, String> analyzeSalary(String kind, String district) throws Exception
2727
{
2828
Map<String, String> dataMap = new HashMap<String, String>();
2929
String[] scope = new String[10];
3030
int[] countScope = new int[10];
31-
scope[0] = "2k以下";
31+
scope[0] = "2k以下";
3232
scope[1] = "2k-4k";
3333
scope[2] = "4k-6k";
3434
scope[3] = "6k-8k";
@@ -37,14 +37,14 @@ public Map<String, String> analyzeSalary(String kind, String district) throws Ex
3737
scope[6] = "15k-20k";
3838
scope[7] = "20k-30k";
3939
scope[8] = "30k-40k";
40-
scope[9] = "40k以上";
40+
scope[9] = "40k以上";
4141

4242
List<JobData> dataList = JobDataDAOFactory
4343
.getJobDataDAOInstance()
4444
.findByKindandWorkPlace(kind, district);
4545
for(JobData data: dataList)
4646
{
47-
//通过正则表达式获取月薪的额度
47+
//通过正则表达式获取月薪的额度
4848
String salaryStr = data.getSalary();
4949
salaryStr = salaryStr.toLowerCase();
5050
Pattern pattern = Pattern.compile("[0-9]+k");
@@ -106,22 +106,22 @@ else if(basicSalary < 40)
106106
}
107107

108108
/**
109-
* 分析jobdata表中符合条件的经验要求,统计各范围内的数量
110-
* @param kind 职业种类条件
111-
* @param district 地区条件
112-
* @return 以要求种类/数量的形式输出在各个范围内的数量统计
109+
* 分析jobdata表中符合条件的经验要求,统计各范围内的数量
110+
* @param kind 职业种类条件
111+
* @param district 地区条件
112+
* @return 以要求种类/数量的形式输出在各个范围内的数量统计
113113
* @throws Exception
114114
*/
115115
public Map<String, String> analyzeExp(String kind, String district) throws Exception
116116
{
117117
Map<String, String> dataMap = new HashMap<String, String>();
118118
String[] type = new String[5];
119119
int[] countType = new int[5];
120-
type[0] = "经验应届毕业生";
121-
type[1] = "经验1-3年";
122-
type[2] = "经验3-5年";
123-
type[3] = "经验5-10年";
124-
type[4] = "经验不限";
120+
type[0] = "经验应届毕业生";
121+
type[1] = "经验1-3年";
122+
type[2] = "经验3-5年";
123+
type[3] = "经验5-10年";
124+
type[4] = "经验不限";
125125
List<JobData> dataList = JobDataDAOFactory
126126
.getJobDataDAOInstance()
127127
.findByKindandWorkPlace(kind, district);
@@ -146,22 +146,22 @@ public Map<String, String> analyzeExp(String kind, String district) throws Excep
146146
}
147147

148148
/**
149-
* 分析jobdata表中符合条件的学历要求,统计各范围内的数量
150-
* @param kind 职业种类条件
151-
* @param district 地区条件
152-
* @return 以学历/数量的形式输出在各个范围内的数量统计
149+
* 分析jobdata表中符合条件的学历要求,统计各范围内的数量
150+
* @param kind 职业种类条件
151+
* @param district 地区条件
152+
* @return 以学历/数量的形式输出在各个范围内的数量统计
153153
* @throws Exception
154154
*/
155155
public Map<String, String> analyzeAcade(String kind, String district) throws Exception
156156
{
157157
Map<String, String> dataMap = new HashMap<String, String>();
158158
String[] type = new String[5];
159159
int[] countType = new int[5];
160-
type[0] = "大专及以上";
161-
type[1] = "本科及以上";
162-
type[2] = "硕士及以上";
163-
type[3] = "博士及以上";
164-
type[4] = "学历不限";
160+
type[0] = "大专及以上";
161+
type[1] = "本科及以上";
162+
type[2] = "硕士及以上";
163+
type[3] = "博士及以上";
164+
type[4] = "学历不限";
165165
List<JobData> dataList = JobDataDAOFactory
166166
.getJobDataDAOInstance()
167167
.findByKindandWorkPlace(kind, district);

src/main/java/team/even/jobcrawler/model/db/dao/IDistrictDAO.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
package team.even.jobcrawler.model.db.dao;
1+
package team.even.jobcrawler.model.db.dao;
22

33
import java.util.List;
44

55
import team.even.jobcrawler.model.db.vo.District;
66

77
/**
8-
* 此接口定义district表的基本操作,包括查询、插入
9-
* @author 曾裕文
8+
* 此接口定义district表的基本操作,包括查询、插入
9+
* @author 曾裕文
1010
*
1111
*/
1212
public interface IDistrictDAO
1313
{
1414
/**
15-
* 向district表插入一条数据
16-
* @param district 被插入的数据
17-
* @return 是否插入成功
15+
* 向district表插入一条数据
16+
* @param district 被插入的数据
17+
* @return 是否插入成功
1818
* @throws Exception
1919
*/
2020
boolean doCreate(District district) throws Exception;
2121

2222
/**
23-
* 查询district中的所有数据
24-
* @return 被插入的数据
23+
* 查询district中的所有数据
24+
* @return 被插入的数据
2525
* @throws Exception
2626
*/
2727
List<District> findAll() throws Exception;

src/main/java/team/even/jobcrawler/model/db/dao/IJobDataDAO.java

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,63 @@
1-
package team.even.jobcrawler.model.db.dao;
1+
package team.even.jobcrawler.model.db.dao;
22

33
import java.util.List;
44

55
import team.even.jobcrawler.model.db.vo.JobData;
66

77
/**
8-
* 本接口定义数据库表jobdata的操作方法,包括插入、删除、查找
9-
* @author 曾裕文
8+
* 本接口定义数据库表jobdata的操作方法,包括插入、删除、查找
9+
* @author 曾裕文
1010
*
1111
*/
1212
public interface IJobDataDAO
1313
{
1414
/**
15-
* 向jobdata表插入一条记录
16-
* @param jobData 被插入的数据
17-
* @return 插入是否成功
15+
* 向jobdata表插入一条记录
16+
* @param jobData 被插入的数据
17+
* @return 插入是否成功
1818
* @throws Exception
1919
*/
2020
boolean doCreate(JobData jobData) throws Exception;
2121

2222
/**
23-
* 删除条件指定的记录
24-
* @param column 条件中的列名
25-
* @param value 列的值
26-
* @return 删除是否成功
23+
* 删除条件指定的记录
24+
* @param column 条件中的列名
25+
* @param value 列的值
26+
* @return 删除是否成功
2727
* @throws Exception
2828
*/
2929
boolean doDelete(String column, String value) throws Exception;
3030

3131
/**
32-
* 通过表属性kind和workPlace指定删除条件,进行删除记录
33-
* @param kind 被删除记录kind属性的值
34-
* @param workPlace 被删除记录workPlace属性的值
35-
* @return 删除是否成功
32+
* 通过表属性kind和workPlace指定删除条件,进行删除记录
33+
* @param kind 被删除记录kind属性的值
34+
* @param workPlace 被删除记录workPlace属性的值
35+
* @return 删除是否成功
3636
* @throws Exception
3737
*/
3838
boolean doDeleteByKindandWorkPlace(String kind, String workPlace) throws Exception;
3939

4040
/**
41-
* 查找jobdata表中的所有数据
42-
* @return 表中的所有数据
41+
* 查找jobdata表中的所有数据
42+
* @return 表中的所有数据
4343
* @throws Exception
4444
*/
4545
List<JobData> findAll() throws Exception;
4646

4747
/**
48-
* 查找条件指定的值
49-
* @param column 条件中的列名
50-
* @param value 列的值
51-
* @return 查询的结果
48+
* 查找条件指定的值
49+
* @param column 条件中的列名
50+
* @param value 列的值
51+
* @return 查询的结果
5252
* @throws Exception
5353
*/
5454
List<JobData> find(String column, String value) throws Exception;
5555

5656
/**
57-
* 通过属性kind和workPlace查找记录
58-
* @param kind 指定查询条件中kind的值
59-
* @param workPlace 指定查询条件中workPlace的值
60-
* @return 查询的结果
57+
* 通过属性kind和workPlace查找记录
58+
* @param kind 指定查询条件中kind的值
59+
* @param workPlace 指定查询条件中workPlace的值
60+
* @return 查询的结果
6161
* @throws Exception
6262
*/
6363
List<JobData> findByKindandWorkPlace(String kind, String workPlace) throws Exception;

src/main/java/team/even/jobcrawler/model/db/dao/IJobKindDAO.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
package team.even.jobcrawler.model.db.dao;
1+
package team.even.jobcrawler.model.db.dao;
22

33
import java.util.List;
44

55
import team.even.jobcrawler.model.db.vo.JobKind;
66

77
/**
8-
* 本接口定义jobkind表的基本操作,包括插入和查询
9-
* @author 曾裕文
8+
* 本接口定义jobkind表的基本操作,包括插入和查询
9+
* @author 曾裕文
1010
*
1111
*/
1212
public interface IJobKindDAO
1313
{
1414
/**
15-
* 向jobkind表插入一条数据
16-
* @param jobKind 被插入的数据
17-
* @return 是否插入成功
15+
* 向jobkind表插入一条数据
16+
* @param jobKind 被插入的数据
17+
* @return 是否插入成功
1818
* @throws Exception
1919
*/
2020
boolean doCreate(JobKind jobKind) throws Exception;
2121

2222
/**
23-
* 查找jobkind表中的所有数据
24-
* @return 返回所有数据
23+
* 查找jobkind表中的所有数据
24+
* @return 返回所有数据
2525
* @throws Exception
2626
*/
2727
List<JobKind> findAll() throws Exception;

0 commit comments

Comments
 (0)