Skip to content
Merged

0 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
325 commits
Select commit Hold shift + click to select a range
15a77ef
Merge pull request #1 from onlyliuxin/master
mddonly Jun 13, 2017
6e88a41
new line
mddonly Jun 13, 2017
b20f426
mod
mddonly Jun 13, 2017
35fd594
20170613_1513 删除readme.md
orajavac Jun 13, 2017
f022b28
test
guozheng5 Jun 13, 2017
57ec996
20170613_1517 测试提交
orajavac Jun 13, 2017
eb26a75
first ood-assignment finish
Jun 13, 2017
24e2243
update package name
yangdd1205 Jun 13, 2017
f0d88f2
创建617314917文件夹
ilyle Jun 13, 2017
24f5e9c
first commit homework
Horacehxw Jun 13, 2017
e51fcd9
create readme
KevinSmile Jun 13, 2017
6ea33cd
optimize promotioMail v1 todo 壮性
luoziyihao Jun 13, 2017
93d655d
com
luoziyihao Jun 13, 2017
9fae307
com
luoziyihao Jun 13, 2017
d20173c
add comment
luoziyihao Jun 13, 2017
ca957fc
360682644作业
Jun 13, 2017
2c7dded
作业 :第一次思考 还有不足
EightWolf Jun 13, 2017
bb922a1
第一次提交测试
xusheng199318 Jun 13, 2017
e03c584
Merge pull request #1 from onlyliuxin/master
lorcx Jun 13, 2017
a4a1a16
the first time commit
jimmykwong Jun 13, 2017
bf1d250
Revert "the first time commit"
jimmykwong Jun 13, 2017
1fc5a81
Merge pull request #1 from onlyliuxin/master
mysqlfront Jun 13, 2017
a35a5f9
创建自己的目录
jimmykwong Jun 13, 2017
3f0e0a9
第一版
yupengj Jun 13, 2017
9ba0784
第一周 重构促销邮件
Jun 13, 2017
51be407
重构促销邮件发送程序
hmgogo Jun 13, 2017
c3bfe51
srp first commit
Jun 13, 2017
3069511
第一版
yupengj Jun 13, 2017
3dbbd57
完成设计模式第一周作业
zzJohnH Jun 13, 2017
47d1952
初始化结构
zavier Jun 14, 2017
c00bd79
first
wulLawra Jun 14, 2017
58ff91c
new line
wd40boy Jun 14, 2017
2264d86
first commit
kkc7316 Jun 14, 2017
e5dd58a
Merge pull request #1 from onlyliuxin/master
kkc7316 Jun 14, 2017
ab89336
update readme
KevinSmile Jun 14, 2017
c371b4e
test01
Jun 14, 2017
d894371
重构完成
Jun 14, 2017
0417aec
第一次重构
zavier Jun 14, 2017
7f7a9e6
提交作业
Jun 14, 2017
ec94646
Merge branch 'master' of https://github.com/wenwei0415/coding2017
Jun 14, 2017
63b1474
merge
Jun 14, 2017
22105d4
提交作业
Jun 14, 2017
f558eac
第一次srp重构作业
CheungChan Jun 12, 2017
86d52a9
重构邮件发送小程序
caizhigang97 Jun 14, 2017
8d3bd06
增加注释
yupengj Jun 14, 2017
20457bc
促销Mail重构后,可以根据不同运营方案,向订阅者发送通告
IdenStudy Jun 14, 2017
312602f
二次重构
Jun 14, 2017
aacfc51
第一次作业srp工程的重构01
ilyle Jun 14, 2017
9c8a7b5
广州-许洁:第一次ood作业srp工程重构02
ilyle Jun 14, 2017
9b9a3a8
ood-assignment task
Lyccccc Jun 14, 2017
2507cdb
初始化
cmhello88 Jun 14, 2017
86c0672
添加文件夹
liushuojin Jun 14, 2017
2d6e92a
提交数据结构源码
yupengj Jun 15, 2017
d466684
file stage by macvis
TerrenceWen0832 Jun 15, 2017
c478fdc
datastructure demo code stage
TerrenceWen0832 Jun 15, 2017
8f8bfce
maven structure
TerrenceWen0832 Jun 15, 2017
9de8835
add ignore file
TerrenceWen0832 Jun 15, 2017
dc47b0c
update
yyglider Jun 15, 2017
1ef7aaf
2017.6.15 第一次作业邮件发送程序SRP重构 第一次提交
Jun 15, 2017
aa10e17
github test
bvcalf Jun 15, 2017
c867427
first commit
mengmoli Jun 15, 2017
430e3a5
重构作业
chunyan123b Jun 15, 2017
4e65eca
重构作业完成
TerrenceWen0832 Jun 15, 2017
88ae9f8
重构作业完成
TerrenceWen0832 Jun 15, 2017
733005f
重构作业代码注释部分完善
TerrenceWen0832 Jun 15, 2017
ff755b0
test
Jun 15, 2017
7e796db
test
Jun 15, 2017
eb557b9
test
Jun 15, 2017
f94b7fa
first
PushWary Jun 15, 2017
3d1db9d
sdfsf
PushWary Jun 15, 2017
7219fef
重构作业
xiaoyijian Jun 15, 2017
8bd3297
Merge pull request #1 from onlyliuxin/master
PushWary Jun 15, 2017
46f1d05
Test command line
PushWary Jun 15, 2017
fa6d4c1
my first git with IDEA
Allenzj Jun 15, 2017
baa3c49
jyz第一次提交作业,邮件重构
mysqlfront Jun 15, 2017
a0569f5
update 2017年6月15日 23:28:01
Jun 15, 2017
b0b1e97
update 2017年6月16日 00:02:20
Jun 15, 2017
ade018b
Create src
Ken-W-P-Huang Jun 16, 2017
ed59f2d
Add files via upload
Ken-W-P-Huang Jun 16, 2017
1aa3215
重构作业完成,代码优化
TerrenceWen0832 Jun 16, 2017
fc0dd13
第二季第一次作业
GordenChow Jun 16, 2017
68cba4b
第二次重构, 职责构建更明确
TerrenceWen0832 Jun 16, 2017
52d4587
first
itdoudoutech Jun 16, 2017
e1e0a17
SRP作业
liushuojin Jun 16, 2017
659ff51
ood-assignment first assignment.
zizifn Jun 16, 2017
8e96cc1
新增说明文件
Jun 12, 2017
4dc0345
Merge branch 'master' of https://github.com/dtwj03/coding2017.git
Jun 16, 2017
37aed58
重构邮件发送代码
Jun 16, 2017
8177baf
first commit
Rancher-V Jun 17, 2017
86b2580
srp作业
liubin-vip Jun 17, 2017
6dcfb02
代码优化
pzsoftchen Jun 17, 2017
8cb6450
调整代码目录结构
pzsoftchen Jun 17, 2017
b54ac89
代码优化
pzsoftchen Jun 17, 2017
6dd917c
代码优化
pzsoftchen Jun 17, 2017
9ecc0e6
代码优化
pzsoftchen Jun 17, 2017
9f2285e
2017年6月17日 12:01:42
lorcx Jun 17, 2017
0f2dcc5
1417442485 Wen Zhao 第一次作业 自荐
wenzzzz Jun 17, 2017
68bbd3d
代码优化
pzsoftchen Jun 17, 2017
efa3857
添加工程描述和测试用例
pzsoftchen Jun 17, 2017
8ad2288
optimize
Rancher-V Jun 17, 2017
c7e8203
第一周完成
sdnb Jun 17, 2017
5168c56
第一周作业
MIMIEYES Jun 17, 2017
fd7b984
[lixiaodan]第一次提交
XiaodanL Jun 17, 2017
21b17e0
更改pom.xml
MIMIEYES Jun 17, 2017
e5e1768
2017年6月17日 15:40:28
lorcx Jun 17, 2017
1c70367
提交第一次作业
xusheng199318 Jun 17, 2017
52c5d6f
作业完成
cmhello88 Jun 17, 2017
78497a0
作业完成
cmhello88 Jun 17, 2017
a2fa5a9
first
Jun 17, 2017
0d46d49
second
Jun 17, 2017
ffc58bc
第一次作业
Jun 17, 2017
7d44bbb
第一次作业
Jun 17, 2017
988a0c7
第三次小细节改动
Jun 17, 2017
7c42e24
第一次作业
renfuyi Jun 18, 2017
8e78357
first assignment
Rancher-V Jun 18, 2017
2e84fcb
邮件发送重构
Jun 18, 2017
91353f6
修改读取降价商品逻辑
Jun 18, 2017
a8fb018
init homework of myself
myhongkongzhen Jun 18, 2017
c072a33
Updated file path to myself's.
myhongkongzhen Jun 18, 2017
5668592
Added pom.xml signature.
myhongkongzhen Jun 18, 2017
3c6d5ca
Added *.java signature.
myhongkongzhen Jun 18, 2017
32da006
Formatted code
myhongkongzhen Jun 18, 2017
e1f3128
Formatted code
myhongkongzhen Jun 18, 2017
6506350
Formatted code
myhongkongzhen Jun 18, 2017
2460a89
Formatted codes
myhongkongzhen Jun 18, 2017
9e2474a
Delegated read file code to FileUtil.java
myhongkongzhen Jun 18, 2017
2f4d56e
ood srp
yangdd1205 Jun 18, 2017
7462969
Refactored configuring email setting
myhongkongzhen Jun 18, 2017
3b54f4f
Extracted emailDebug property
myhongkongzhen Jun 18, 2017
7388979
first
Jun 18, 2017
b6dbae5
Extracted ProductInfo.java
myhongkongzhen Jun 18, 2017
bef7598
first
oceanbest Jun 18, 2017
9c4a3ca
Extracted ProductInfo.java
myhongkongzhen Jun 18, 2017
9bd0794
Extracted ProductPromotionDAO.java
myhongkongzhen Jun 18, 2017
c3de70d
Refactored code structure
myhongkongzhen Jun 18, 2017
4638edd
Merge branch '511134962'
myhongkongzhen Jun 18, 2017
a4dcbca
ood srp homework
lqhtmc Jun 18, 2017
3c7f44b
第二次
oceanbest Jun 18, 2017
efbfb53
Merge pull request #386 from myhongkongzhen/master
onlyliuxin Jun 18, 2017
03e2ed4
重构sendMail模块
easonzhang1992 Jun 18, 2017
57f042e
refector
onlyliuxin Jun 18, 2017
8d9df0f
Merge branch 'master' of https://github.com/onlyliuxin/coding2017.git
onlyliuxin Jun 18, 2017
8071d7d
ood作业
XMT-CN Jun 18, 2017
d3a9325
SRP作业
Jun 18, 2017
ae73d96
第一次作业提交!
sychs Jun 18, 2017
86c5327
ood_test
gordonCN Jun 18, 2017
e55c2b9
[MI] refactor email feature
shuiqing05 Jun 18, 2017
a890db4
1241588932
doublesouth Jun 18, 2017
254996e
Merge pull request #3 from onlyliuxin/master
palmshe Jun 18, 2017
efd431d
ood 第二次作业
onlyliuxin Jun 18, 2017
fb35e9f
第一次作业
yoda1990 Jun 18, 2017
4de9b54
Merge pull request #1 from onlyliuxin/master
yoda1990 Jun 18, 2017
7c7c5b1
commit
yupengj Jun 18, 2017
3cfe97f
Merge pull request #1 from onlyliuxin/master
Zering Jun 18, 2017
9e507e2
1241588932
doublesouth Jun 18, 2017
6bb773e
1241588932
Jun 18, 2017
f497794
refactor the homework
xhwork2016 Jun 18, 2017
1f4be1b
初始化目录
zoakerc Jun 18, 2017
881e737
重构一个项目使之符合单一职责原则
zoakerc Jun 18, 2017
3a0199d
homework
itdoudoutech Jun 19, 2017
a1cb65d
修改编码
Jun 19, 2017
d10b80c
Merge pull request #401 from coderlmm/master
onlyliuxin Jun 19, 2017
6d997e5
Merge pull request #399 from M201372261/master
onlyliuxin Jun 19, 2017
3e14154
Merge pull request #398 from yangdd1205/master
onlyliuxin Jun 19, 2017
44eb7af
Merge pull request #276 from Lyccccc/master
onlyliuxin Jun 19, 2017
9b537d7
Merge pull request #369 from pzsoftchen/master
onlyliuxin Jun 19, 2017
625fb33
Merge pull request #368 from wenzzzz/master
onlyliuxin Jun 19, 2017
cbe0405
Merge pull request #367 from liubin-vip/master
onlyliuxin Jun 19, 2017
82429b4
Merge pull request #366 from dtwj03/master
onlyliuxin Jun 19, 2017
9df5d23
Merge pull request #365 from zizifn/master
onlyliuxin Jun 19, 2017
71808b4
Merge pull request #381 from zoakerc/master
onlyliuxin Jun 19, 2017
409c231
Merge pull request #359 from GordenChow/master
onlyliuxin Jun 19, 2017
14f23c2
Merge pull request #355 from Ken-W-P-Huang/master
onlyliuxin Jun 19, 2017
294fb54
Merge pull request #382 from Rancher-V/master
onlyliuxin Jun 19, 2017
c119747
Merge pull request #354 from mysqlfront/master
onlyliuxin Jun 19, 2017
5b8f8c9
Merge pull request #352 from xiaoyijian2/master
onlyliuxin Jun 19, 2017
9b968c3
Merge pull request #360 from macvis/master
onlyliuxin Jun 19, 2017
f021378
Merge pull request #350 from chunyan123b/master
onlyliuxin Jun 19, 2017
6d606cf
Merge pull request #373 from lorcx/master
onlyliuxin Jun 19, 2017
a22a012
Merge pull request #294 from pengLeo/master
onlyliuxin Jun 19, 2017
30d2e42
Merge pull request #370 from sdnb/master
onlyliuxin Jun 19, 2017
8df8c1e
Merge pull request #387 from easonzhang1992/master
onlyliuxin Jun 19, 2017
66abb41
Merge pull request #380 from renfuyi/master
onlyliuxin Jun 19, 2017
3c3488f
Merge pull request #345 from zavier/master
onlyliuxin Jun 19, 2017
d78ce99
Merge pull request #371 from XiaodanL/master
onlyliuxin Jun 19, 2017
7d6b00c
Merge pull request #372 from MIMIEYES/master
onlyliuxin Jun 19, 2017
6df7670
Merge pull request #375 from cmhello88/master
onlyliuxin Jun 19, 2017
b0643f8
Merge pull request #340 from ilyle/master
onlyliuxin Jun 19, 2017
eb2dc88
Merge pull request #346 from lanyuanxiaoyao/master
onlyliuxin Jun 19, 2017
a11d5dd
Merge pull request #374 from xusheng199318/master
onlyliuxin Jun 19, 2017
2fe7d57
Merge pull request #338 from wenwei0415/master
onlyliuxin Jun 19, 2017
6d5afb8
Merge pull request #339 from ShiningChenCode/master
onlyliuxin Jun 19, 2017
94a38ea
Merge pull request #322 from Zering/master
onlyliuxin Jun 19, 2017
4466434
Merge pull request #388 from dustheart/master
onlyliuxin Jun 19, 2017
6001536
Merge pull request #389 from XMT-CN/master
onlyliuxin Jun 19, 2017
6208867
Merge pull request #397 from YouHmilyForProgramming/master
onlyliuxin Jun 19, 2017
68ec73d
Merge pull request #391 from SYCHS/master
onlyliuxin Jun 19, 2017
d5002b7
Merge pull request #395 from Enan01/master
onlyliuxin Jun 19, 2017
2657c42
Merge pull request #383 from SloaneWing/master
onlyliuxin Jun 19, 2017
00eea79
Merge pull request #343 from duoduo1222/master
onlyliuxin Jun 19, 2017
4889e83
Merge pull request #336 from saviRenXin/master
onlyliuxin Jun 19, 2017
5199103
Merge pull request #337 from gaohuan30/master
onlyliuxin Jun 19, 2017
93b6efc
Merge pull request #376 from vvivey/master
onlyliuxin Jun 19, 2017
33e2665
Merge pull request #326 from hmgogo/master
onlyliuxin Jun 19, 2017
14d5741
Merge pull request #325 from johnChnia/master
onlyliuxin Jun 19, 2017
4bd06ed
Merge pull request #324 from yupengj/master
onlyliuxin Jun 19, 2017
5d34e2a
Merge pull request #327 from wulLawra/master
onlyliuxin Jun 19, 2017
24561ed
Merge pull request #320 from EightWolf/master
onlyliuxin Jun 19, 2017
d60a049
Merge pull request #319 from lylylyly/master
onlyliuxin Jun 19, 2017
d4270e9
Merge pull request #321 from jimmykwong/master
onlyliuxin Jun 19, 2017
6dcbab2
Merge pull request #378 from williamgx8/master
onlyliuxin Jun 19, 2017
22d667f
Merge pull request #393 from shuiqing05/master
onlyliuxin Jun 19, 2017
eeed6ad
Merge pull request #385 from lqhtmc/master
onlyliuxin Jun 19, 2017
6679cda
删除无用的代码
onlyliuxin Jun 19, 2017
0db2732
Merge remote-tracking branch 'refs/remotes/Greastate/master'
yangyangxu2016 Jun 19, 2017
4beaab4
重构邮件发送
yangyangxu2016 Jun 19, 2017
279d227
Merge pull request #318 from luoziyihao/master
onlyliuxin Jun 19, 2017
ae97f0e
02 ocp
Jun 19, 2017
c685383
重构后的代码
Allenzj Jun 19, 2017
a2afd81
homework
itdoudoutech Jun 19, 2017
e98a79a
Merge pull request #392 from gordonCN/master
onlyliuxin Jun 19, 2017
1ac0837
Merge pull request #384 from oceanbest/master
onlyliuxin Jun 19, 2017
db0b1a0
Merge pull request #298 from palmshe/master
onlyliuxin Jun 19, 2017
cd0dd12
Merge pull request #403 from yangyangxu2016/master
onlyliuxin Jun 19, 2017
5cddc7d
Merge pull request #313 from Horacehxw/master
onlyliuxin Jun 19, 2017
f17cc5d
Merge pull request #329 from kkc7316/master
onlyliuxin Jun 19, 2017
60e5567
Merge pull request #299 from 511739113/master
onlyliuxin Jun 19, 2017
cf8de7e
20170619_1509
orajavac Jun 19, 2017
27eef3d
Merge pull request #349 from mengmoli/master
onlyliuxin Jun 19, 2017
634ea6e
Merge pull request #404 from coderlmm/master
onlyliuxin Jun 19, 2017
f7021bd
Merge pull request #353 from Allenzj/master
onlyliuxin Jun 19, 2017
4909d08
Merge pull request #351 from PushWary/master
onlyliuxin Jun 19, 2017
7a45673
Merge pull request #348 from bvcalf/master
onlyliuxin Jun 19, 2017
b468fdf
delete season one
yyglider Jun 19, 2017
e92eb19
Update .gitignore
yuyingzhi828 Jun 19, 2017
5715b85
Merge pull request #342 from liushuojin/master
onlyliuxin Jun 19, 2017
a178e17
Merge pull request #335 from guoshenghui/master
onlyliuxin Jun 19, 2017
e4e013c
Merge pull request #323 from jiaxun1990/master
onlyliuxin Jun 19, 2017
d0b5a16
Merge pull request #314 from KevinSmile/master
onlyliuxin Jun 19, 2017
79df61f
Merge pull request #309 from yuyingzhi828/master
onlyliuxin Jun 19, 2017
720b0b0
Merge pull request #308 from orajavac/master
onlyliuxin Jun 19, 2017
62c6260
Merge pull request #307 from guozheng5/master
onlyliuxin Jun 19, 2017
55b3e74
Merge pull request #405 from yyglider/master
onlyliuxin Jun 19, 2017
ce5b7b3
Merge pull request #306 from mddonly/master
onlyliuxin Jun 19, 2017
002f38a
Merge pull request #300 from onlyLYJ/master
onlyliuxin Jun 19, 2017
cf87352
Merge pull request #296 from CheungChanDevCoder/master
onlyliuxin Jun 19, 2017
cc63c5f
Merge pull request #281 from littleshame/master
onlyliuxin Jun 19, 2017
b1ee84e
Merge pull request #280 from Maneng/master
onlyliuxin Jun 19, 2017
27b9fba
Merge pull request #277 from nightn/master
onlyliuxin Jun 19, 2017
b81c9a1
remove code
onlyliuxin Jun 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,23 @@ target
liuxin/.DS_Store
liuxin/src/.DS_Store

students/1005475328/*
students/1329920463/*
students/1452302762/*
students/14703250/*
students/2842295913/*
students/383117348/*
students/404481481/*
students/406400373/*
students/549739951/*
students/582161208/*
students/592146505/*
students/740707954/*
students/844620174/*
students/87049319/*
students/183549495/*





Expand Down
1 change: 0 additions & 1 deletion coding2017
Submodule coding2017 deleted from bdbfcf
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,7 @@ public void testIsValid() {
public void testGetNodesBetween(){
List<Integer> numbers = this.tree.getNodesBetween(3, 8);
Assert.assertEquals("[3, 4, 5, 6, 8]",numbers.toString());
numbers = this.tree.getNodesBetween(1, 8);
Assert.assertEquals("[1, 2, 3, 4, 5, 6, 8]",numbers.toString());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.coderising.ood.ocp;

public class DateUtil {

public static String getCurrentDateAsString() {

return null;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.coderising.ood.ocp;

public class Logger {

public final int RAW_LOG = 1;
public final int RAW_LOG_WITH_DATE = 2;
public final int EMAIL_LOG = 1;
public final int SMS_LOG = 2;
public final int PRINT_LOG = 3;

int type = 0;
int method = 0;

public Logger(int logType, int logMethod){
this.type = logType;
this.method = logMethod;
}
public void log(String msg){

String logMsg = msg;

if(this.type == RAW_LOG){
logMsg = msg;
} else if(this.type == RAW_LOG_WITH_DATE){
String txtDate = DateUtil.getCurrentDateAsString();
logMsg = txtDate + ": " + msg;
}

if(this.method == EMAIL_LOG){
MailUtil.send(logMsg);
} else if(this.method == SMS_LOG){
SMSUtil.send(logMsg);
} else if(this.method == PRINT_LOG){
System.out.println(logMsg);
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.coderising.ood.ocp;

public class MailUtil {

public static void send(String logMsg) {
// TODO Auto-generated method stub

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.coderising.ood.ocp;

public class SMSUtil {

public static void send(String logMsg) {
// TODO Auto-generated method stub

}

}
28 changes: 28 additions & 0 deletions students/1049843090/ood/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
group 'com.yangdd'
version '1.0-SNAPSHOT'
description = '面向对象设计'

apply plugin: 'java'

sourceCompatibility = 1.8

repositories {
mavenLocal()
mavenCentral()
}

//项目布局,下面是Java plugin的默认布局
sourceSets {
main.java.srcDir('src/main/java')
main.resources.srcDir('src/main/resources')
test.java.srcDir('src/test/java')
test.resources.srcDir('src/test/resources')
}

dependencies {
testCompile('junit:junit:4.12')
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
2 changes: 2 additions & 0 deletions students/1049843090/ood/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rootProject.name = 'ood'

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.coderising.ood.srp;
import java.util.HashMap;
import java.util.Map;

public class Configuration {

static Map<String,String> configurations = new HashMap<>();
static{
configurations.put(ConfigurationKeys.SMTP_SERVER, "smtp.163.com");
configurations.put(ConfigurationKeys.ALT_SMTP_SERVER, "smtp1.163.com");
configurations.put(ConfigurationKeys.EMAIL_ADMIN, "admin@company.com");
}
/**
* 应该从配置文件读, 但是这里简化为直接从一个map 中去读
* @param key
* @return
*/
public String getProperty(String key) {

return configurations.get(key);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.coderising.ood.srp;

public class ConfigurationKeys {

public static final String SMTP_SERVER = "smtp.server";
public static final String ALT_SMTP_SERVER = "alt.smtp.server";
public static final String EMAIL_ADMIN = "email.admin";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package com.coderising.ood.srp;

import java.net.URI;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;

public class DBUtil {

/**
* 应该从数据库读, 但是简化为直接生成。
*
* @param sql
* @return
*/
public static List query(String sql) {

List userList = new ArrayList();
for (int i = 1; i <= 3; i++) {
HashMap userInfo = new HashMap();
userInfo.put("NAME", "User" + i);
userInfo.put("EMAIL", "aa@bb.com");
userList.add(userInfo);
}

return userList;
}


public static List<UserInfo> querySubscriber(String productId) {

List<UserInfo> list = new ArrayList<>();

Random random = new Random();
int number = random.nextInt(3);

for (int i = 1; i <= number; i++) {
UserInfo userInfo = new UserInfo();
userInfo.setName("User" + productId + i);
userInfo.setMail(userInfo.getName() + "@" + productId + ".com");
list.add(userInfo);
}
return list;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.coderising.ood.srp;

/**
* 邮件数据
*
* @author yangdd
*/
public class MailData {

protected String smtpHost;
protected String altSmtpHost;
protected String fromAddress;
protected String toAddress;
protected String subject;
protected String message;
private boolean debug;

public String getSmtpHost() {
return smtpHost;
}

public void setSmtpHost(String smtpHost) {
this.smtpHost = smtpHost;
}

public String getAltSmtpHost() {
return altSmtpHost;
}

public void setAltSmtpHost(String altSmtpHost) {
this.altSmtpHost = altSmtpHost;
}

public String getFromAddress() {
return fromAddress;
}

public void setFromAddress(String fromAddress) {
this.fromAddress = fromAddress;
}

public String getToAddress() {
return toAddress;
}

public void setToAddress(String toAddress) {
this.toAddress = toAddress;
}

public String getSubject() {
return subject;
}

public void setSubject(String subject) {
this.subject = subject;
}

public String getMessage() {
return message;
}

public void setMessage(String message) {
this.message = message;
}

public boolean isDebug() {
return debug;
}

public void setDebug(boolean debug) {
this.debug = debug;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.coderising.ood.srp;

public class MailUtil {

public static void sendEmail(String toAddress, String fromAddress, String subject, String message, String smtpHost,
boolean debug) {
//假装发了一封邮件
StringBuilder buffer = new StringBuilder();
buffer.append("From:").append(fromAddress).append("\n");
buffer.append("To:").append(toAddress).append("\n");
buffer.append("Subject:").append(subject).append("\n");
buffer.append("Content:").append(message).append("\n");
System.out.println(buffer.toString());

}


public static void sendEmail(MailData mailData) {
//假装发了一封邮件
try {
StringBuilder buffer = new StringBuilder();
buffer.append("Smtp:").append(mailData.getSmtpHost()).append("\n");
buffer.append("From:").append(mailData.getFromAddress()).append("\n");
buffer.append("To:").append(mailData.getToAddress()).append("\n");
buffer.append("Subject:").append(mailData.getSubject()).append("\n");
buffer.append("Content:").append(mailData.getMessage()).append("\n");
System.out.println(buffer.toString());
} catch (Exception e) {
try {
StringBuilder buffer = new StringBuilder();
buffer.append("Smtp:").append(mailData.getAltSmtpHost()).append("\n");
buffer.append("From:").append(mailData.getFromAddress()).append("\n");
buffer.append("To:").append(mailData.getToAddress()).append("\n");
buffer.append("Subject:").append(mailData.getSubject()).append("\n");
buffer.append("Content:").append(mailData.getMessage()).append("\n");
System.out.println(buffer.toString());
} catch (Exception e1) {
System.out.println("通过备用 SMTP服务器发送邮件失败: " + e1.getMessage());
}
}


}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.coderising.ood.srp;

import java.util.List;

/**
* 产品信息
*
* @author yangdd
*/
public class ProductInfo {

private String id;

private String description;


public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}
Loading