Skip to content

Commit

Permalink
update at Nov 30th
Browse files Browse the repository at this point in the history
  • Loading branch information
yhilmare committed Nov 30, 2018
1 parent 4a66c5e commit 0656d5a
Show file tree
Hide file tree
Showing 63 changed files with 105 additions and 78 deletions.
14 changes: 7 additions & 7 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_51">
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5">
<attributes>
<attribute name="owner.project.facets" value="java"/>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk-11.0.1">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion .settings/org.eclipse.wst.common.project.facet.core.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v6.0"/>
<runtime name="Apache Tomcat v8.5"/>
<fixed facet="jst.web"/>
<fixed facet="wst.jsdt.web"/>
<fixed facet="java"/>
Expand Down
13 changes: 13 additions & 0 deletions build/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/Controller/
/DAO/
/Factory/
/Interfaces/
/Listener/
/OuterInterfaces/
/Service/
/ServiceImpl/
/Units/
/Utils/
/WebUI/
/domain/
/filter/
Binary file modified build/classes/DAO/BlogArticle2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogHolder2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogIndex2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogMessage2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogNotice2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogStatus2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogVisit2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogVisitArticle2DB.class
Binary file not shown.
Binary file modified build/classes/DAO/BlogVisitor2DB.class
Binary file not shown.
Binary file modified build/classes/Interfaces/ResultSetHandler.class
Binary file not shown.
Binary file modified build/classes/Service/BlogArticle2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogHolder2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogIndex2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogMessage2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogNotice2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogStatus2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogVisit2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogVisitArticle2DBService.class
Binary file not shown.
Binary file modified build/classes/Service/BlogVisitor2DBService.class
Binary file not shown.
Binary file modified build/classes/ServiceImpl/DataObject2DB.class
Binary file not shown.
Binary file modified build/classes/ServiceImpl/UserAccess2DB.class
Binary file not shown.
Binary file modified build/classes/Units/DBUnit.class
Binary file not shown.
Binary file modified build/classes/Units/UnitUtils.class
Binary file not shown.
Binary file modified build/classes/Utils/BeanHandler.class
Binary file not shown.
Binary file modified build/classes/Utils/DBUtils.class
Binary file not shown.
Binary file modified build/classes/Utils/IntegerHandler.class
Binary file not shown.
Binary file modified build/classes/Utils/ListHandler.class
Binary file not shown.
Binary file modified build/classes/Utils/MD5Utils.class
Binary file not shown.
Binary file modified build/classes/filter/GZIPServletOutputStream.class
Binary file not shown.
Binary file modified build/classes/filter/charsetFilter$1.class
Binary file not shown.
Binary file modified build/classes/filter/gzipFilter$1.class
Binary file not shown.
Binary file modified build/classes/filter/gzipFilter.class
Binary file not shown.
12 changes: 6 additions & 6 deletions src/DAO/BlogArticle2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import domain.blog_index;
import domain.blog_page;

public class BlogArticle2DB implements DataObject2DB {
public class BlogArticle2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
String sql = "select count(*) from blog_article";
Object[] params = {};
return (int)DBUtils.query(sql, params, new IntegerHandler());
return (int)DBUtils.query(sql, params, new IntegerHandler<Integer>());
}

@Override
Expand Down Expand Up @@ -76,7 +76,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select article_id, article_content, article_title, holder_id, create_time from blog_artilce_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_article.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List>(blog_article.class)));
return page;
}

Expand All @@ -90,14 +90,14 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}
String sql = "select article_id, article_title, holder_id, create_time from blog_artilce_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_article.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List>(blog_article.class)));
return page;
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
String sql = "select * from blog_article where article_id=?";
Object[] params = {id};
return DBUtils.query(sql, params, new BeanHandler(blog_article.class));
return DBUtils.query(sql, params, new BeanHandler<T>(blog_article.class));
}
}
10 changes: 5 additions & 5 deletions src/DAO/BlogHolder2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import domain.blog_holder;
import domain.blog_page;

public class BlogHolder2DB implements UserAccess2DB{
public class BlogHolder2DB<T> implements UserAccess2DB<T>{

@Override
public int insertUser(Object obj) {
Expand Down Expand Up @@ -90,10 +90,10 @@ public int updateUser(Object obj) {
}

@Override
public Object selectUser(String name) {
public T selectUser(String name) {
String sql = "select holder_city_en,holder_city_zh,holder_email,holder_img,holder_name_en,holder_name_zh,holder_province_en,holder_province_zh,holder_pwd,holder_school_en,holder_school_year,holder_school_zh,holder_id from blog_holder where holder_name_zh=?";
Object[] params = {name};
return DBUtils.query(sql, params, new BeanHandler(blog_holder.class));
return DBUtils.query(sql, params, new BeanHandler<T>(blog_holder.class));
}

@Override
Expand All @@ -106,10 +106,10 @@ public boolean isExist(String name) {
}

@Override
public Object selectUserByIndex() {
public T selectUserByIndex() {
String sql = "select holder_city_en,holder_city_zh,holder_email,holder_img,holder_name_en,holder_name_zh,holder_province_en,holder_province_zh,holder_pwd,holder_school_en,holder_school_year,holder_school_zh,holder_id from blog_holder limit 0,1";
Object[] params = {};
return DBUtils.query(sql, params, new BeanHandler(blog_holder.class));
return DBUtils.query(sql, params, new BeanHandler<T>(blog_holder.class));
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogIndex2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import domain.blog_index;
import domain.blog_page;

public class BlogIndex2DB implements DataObject2DB {
public class BlogIndex2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -47,7 +47,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select * from blog_index_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_index.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_index.class)));
return page;
}

Expand All @@ -58,7 +58,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogMessage2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import domain.blog_page;
import domain.blog_status;

public class BlogMessage2DB implements DataObject2DB {
public class BlogMessage2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -54,7 +54,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select * from blog_message_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_message.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_message.class)));
return page;
}

Expand All @@ -65,7 +65,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogNotice2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import domain.blog_notice;
import domain.blog_page;

public class BlogNotice2DB implements DataObject2DB {
public class BlogNotice2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -48,7 +48,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select * from blog_notice order by publish_date desc limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_notice.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_notice.class)));
return page;
}

Expand All @@ -59,7 +59,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogStatus2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import domain.blog_page;
import domain.blog_status;

public class BlogStatus2DB implements DataObject2DB {
public class BlogStatus2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -66,7 +66,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select status_id, status_content, publish_date, holder_id from blog_status_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_status.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_status.class)));
return page;
}

Expand All @@ -77,7 +77,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogVisit2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import domain.blog_page;
import domain.blog_visit;

public class BlogVisit2DB implements DataObject2DB {
public class BlogVisit2DB<T> implements DataObject2DB<T> {

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -48,7 +48,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select * from blog_visit_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_visit.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_visit.class)));
return page;
}

Expand All @@ -59,7 +59,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/DAO/BlogVisitArticle2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import domain.blog_visit;
import domain.blog_visit_article;

public class BlogVisitArticle2DB implements DataObject2DB{
public class BlogVisitArticle2DB<T> implements DataObject2DB<T>{

@Override
public int getTotalRecord() {
Expand Down Expand Up @@ -50,7 +50,7 @@ public blog_page selectData(int currentPage, int pageContain, int pageInFrame) {
}
String sql = "select * from blog_article_visit_view limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_visit_article.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_visit_article.class)));
return page;
}

Expand All @@ -61,7 +61,7 @@ public blog_page selectIndexData(int currentPage, int pageContain, int pageInFra
}

@Override
public Object selectByID(String id) {
public T selectByID(String id) {
// TODO Auto-generated method stub
return null;
}
Expand Down
12 changes: 6 additions & 6 deletions src/DAO/BlogVisitor2DB.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import domain.blog_page;
import domain.blog_visitor;

public class BlogVisitor2DB implements UserAccess2DB{
public class BlogVisitor2DB<T> implements UserAccess2DB<T>{

@Override
public int insertUser(Object obj) {
Expand Down Expand Up @@ -41,10 +41,10 @@ public int updateUser(Object obj) {
}

@Override
public Object selectUser(String name) {
public T selectUser(String name) {
String sql = "select visitor_id,visitor_pwd,visitor_nickname,visitor_gender from blog_visitor where visitor_nickname=?";
Object[] params = {name};
return DBUtils.query(sql, params, new BeanHandler(blog_visitor.class));
return DBUtils.query(sql, params, new BeanHandler<T>(blog_visitor.class));
}

@Override
Expand All @@ -55,7 +55,7 @@ public boolean isExist(String name) {
}

@Override
public Object selectUserByIndex() {
public T selectUserByIndex() {
// TODO Auto-generated method stub
return null;
}
Expand All @@ -70,14 +70,14 @@ public blog_page selectUserByList(int currentPage, int pageContain, int pageInFr
}
String sql = "select * from blog_visitor limit ?,?";
Object[] params = {start, page.getPageContain()};
page.setList((List) DBUtils.query(sql, params, new ListHandler(blog_visitor.class)));
page.setList(DBUtils.query(sql, params, new ListHandler<List<T>>(blog_visitor.class)));
return page;
}

@Override
public int getTotalRecord() {
String sql = "select count(*) from blog_visitor";
Object[] params = {};
return (int)DBUtils.query(sql, params, new IntegerHandler());
return (int)DBUtils.query(sql, params, new IntegerHandler<Integer>());
}
}
4 changes: 2 additions & 2 deletions src/Interfaces/ResultSetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import java.sql.ResultSet;

public interface ResultSetHandler {
public Object operate(ResultSet result);
public interface ResultSetHandler<T> {
public <T> T operate(ResultSet result);
}
4 changes: 2 additions & 2 deletions src/Service/BlogArticle2DBService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import domain.blog_page;

public class BlogArticle2DBService {
private DataObject2DB impl = null;
private DataObject2DB<blog_article> impl = null;
public BlogArticle2DBService(){
impl = DataAccessFactory.getFactory("DAO.BlogArticle2DB").getImpleInstance();
}
Expand Down Expand Up @@ -40,6 +40,6 @@ public blog_page selectArticleIndex(int currentPage, int pageContain, int pageIn
}

public blog_article selectArticleByID(String article_id){
return (blog_article) impl.selectByID(article_id);
return impl.selectByID(article_id);
}
}
4 changes: 2 additions & 2 deletions src/Service/BlogHolder2DBService.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

public class BlogHolder2DBService {

private UserAccess2DB impl = null;
private UserAccess2DB<blog_holder> impl = null;
public BlogHolder2DBService(){
impl = UserAccessFactory.getFactory("DAO.BlogHolder2DB").getImplInstance();
}
Expand All @@ -32,7 +32,7 @@ public boolean isExist(String name){
}

public blog_holder selectHolder(){
return (blog_holder) impl.selectUserByIndex();
return impl.selectUserByIndex();
}

}
3 changes: 2 additions & 1 deletion src/Service/BlogIndex2DBService.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

import Factory.DataAccessFactory;
import ServiceImpl.DataObject2DB;
import domain.blog_index;
import domain.blog_page;

public class BlogIndex2DBService {
public DataObject2DB impl = null;
public DataObject2DB<blog_index> impl = null;
public BlogIndex2DBService(){
impl = DataAccessFactory.getFactory("DAO.BlogIndex2DB").getImpleInstance();
}
Expand Down
Loading

0 comments on commit 0656d5a

Please sign in to comment.