├── .classpath ├── .myhibernatedata ├── .mymetadata ├── .project ├── .settings ├── .jsdtscope ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container └── org.eclipse.wst.jsdt.ui.superType.name ├── LICENSE.txt ├── README.md ├── db ├── function.sql └── webeffect.sql ├── src ├── config │ ├── applicationContext.xml │ ├── ehcache.xml │ ├── ehcache.xsd │ ├── freemarker.properties │ ├── hibernate.cfg.xml │ ├── i18n.properties │ ├── jdbc.properties │ ├── struts.properties │ └── struts.xml └── java │ └── com │ └── thinkgem │ └── webeffect │ ├── action │ ├── BaseAction.java │ ├── CategoryAction.java │ ├── DefaultAction.java │ ├── EffectAction.java │ ├── UserAction.java │ ├── ValidateAction.java │ ├── struts-center.xml │ ├── struts-default.xml │ ├── struts-effect.xml │ └── struts-setting.xml │ ├── dao │ ├── WeCategoryDao.java │ ├── WeCommentDao.java │ ├── WeEffectDao.java │ ├── WeFileDao.java │ ├── WeUserDao.java │ └── impl │ │ ├── WeCategoryDaoImpl.java │ │ ├── WeCommentDaoImpl.java │ │ ├── WeEffectDaoImpl.java │ │ ├── WeFileDaoImpl.java │ │ └── WeUserDaoImpl.java │ ├── hibernate │ ├── BaseDao.java │ ├── BaseDaoImpl.java │ ├── BatchBuildDao.java │ └── Pagination.java │ ├── interceptor │ ├── AuthInterceptor.java │ └── ClearErrorsAndMessagesInterceptor.java │ ├── model │ ├── WeCategory.hbm.xml │ ├── WeCategory.java │ ├── WeComment.hbm.xml │ ├── WeComment.java │ ├── WeEffect.hbm.xml │ ├── WeEffect.java │ ├── WeFile.hbm.xml │ ├── WeFile.java │ ├── WeFunction.hbm.xml │ ├── WeFunction.java │ ├── WeRole.hbm.xml │ ├── WeRole.java │ ├── WeRoleFunction.hbm.xml │ ├── WeRoleFunction.java │ ├── WeRoleFunctionId.java │ ├── WeUser.hbm.xml │ └── WeUser.java │ ├── service │ ├── CategoryService.java │ ├── EffectService.java │ ├── UserService.java │ └── impl │ │ ├── CategoryServiceImpl.java │ │ ├── EffectServiceImpl.java │ │ └── UserServiceImpl.java │ └── util │ ├── Encrypt.java │ ├── FileOperateUtils.java │ ├── FileUtils.java │ ├── RequestUtils.java │ ├── StrUtils.java │ ├── Utils.java │ └── Validate.java ├── web ├── 403.html ├── 404.html ├── 500.html ├── META-INF │ └── MANIFEST.MF ├── WEB-INF │ ├── ftl_lib │ │ ├── common.ftl │ │ └── index.ftl │ ├── lib │ │ ├── activation.jar │ │ ├── antlr-2.7.6.jar │ │ ├── aopalliance-1.0.jar │ │ ├── apache-ant-zip.jar │ │ ├── commons-beanutils-1.7.0.jar │ │ ├── commons-chain-1.2.jar │ │ ├── commons-collections-3.2.jar │ │ ├── commons-fileupload-1.2.1.jar │ │ ├── commons-io-1.3.2.jar │ │ ├── commons-lang-2.3.jar │ │ ├── commons-logging-1.0.4.jar │ │ ├── commons-logging-api-1.1.jar │ │ ├── dom4j-1.6.1.jar │ │ ├── ehcache-1.6.0-beta3.jar │ │ ├── freemarker-2.3.15.jar │ │ ├── gson.jar │ │ ├── hibernate3.jar │ │ ├── idchecker.jar │ │ ├── jta-1.1.jar │ │ ├── log4j-1.2.15.jar │ │ ├── mysql.jar │ │ ├── ognl-2.7.3.jar │ │ ├── ojdbc14.jar │ │ ├── org.springframework.aop-3.0.0.RELEASE.jar │ │ ├── org.springframework.asm-3.0.0.RELEASE.jar │ │ ├── org.springframework.beans-3.0.0.RELEASE.jar │ │ ├── org.springframework.context-3.0.0.RELEASE.jar │ │ ├── org.springframework.context.support-3.0.0.RELEASE.jar │ │ ├── org.springframework.core-3.0.0.RELEASE.jar │ │ ├── org.springframework.expression-3.0.0.RELEASE.jar │ │ ├── org.springframework.jdbc-3.0.0.RELEASE.jar │ │ ├── org.springframework.orm-3.0.0.RELEASE.jar │ │ ├── org.springframework.transaction-3.0.0.RELEASE.jar │ │ ├── org.springframework.web-3.0.0.RELEASE.jar │ │ ├── org.springframework.web.struts-3.0.0.RELEASE.jar │ │ ├── proxool-0.9.1.jar │ │ ├── proxool-cglib.jar │ │ ├── slf4j-api-1.5.6.jar │ │ ├── slf4j-log4j12-1.5.6.jar │ │ ├── struts2-core-2.1.8.1.jar │ │ ├── struts2-spring-plugin-2.1.8.1.jar │ │ └── xwork-core-2.1.6.jar │ ├── template │ │ ├── center │ │ │ ├── changeInfo.html │ │ │ └── changePassword.html │ │ ├── effect │ │ │ ├── comment.html │ │ │ ├── edit.html │ │ │ ├── index.html │ │ │ ├── upload.html │ │ │ └── view.html │ │ ├── include │ │ │ ├── footer.html │ │ │ ├── head.html │ │ │ └── header.html │ │ ├── login.html │ │ ├── message.html │ │ └── setting │ │ │ ├── category │ │ │ └── index.html │ │ │ └── user │ │ │ ├── add.html │ │ │ ├── edit.html │ │ │ └── index.html │ └── web.xml ├── index.jspx └── resource │ ├── global.css │ ├── global.js │ ├── iepngfix.htc │ ├── images │ ├── add.gif │ ├── bottom_bg.jpg │ ├── box_title1.gif │ ├── box_title2.gif │ ├── box_title3.gif │ ├── box_title4.gif │ ├── cancelbutton.gif │ ├── li.gif │ ├── loading.gif │ ├── login_bg.gif │ ├── login_logo.gif │ ├── logo.gif │ ├── logo.psd │ ├── nav_on.gif │ ├── top_bg.gif │ ├── top_bg_.gif │ └── tree │ │ ├── Thumbs.db │ │ ├── base.gif │ │ ├── close.gif │ │ ├── empty.gif │ │ ├── folder.gif │ │ ├── folderopen.gif │ │ ├── join.gif │ │ ├── joinbottom.gif │ │ ├── line.gif │ │ ├── minus.gif │ │ ├── minusbottom.gif │ │ ├── open.gif │ │ ├── page.gif │ │ ├── plus.gif │ │ └── plusbottom.gif │ ├── jquery-1.3.2.js │ ├── jquery.bgiframe-2.1.1.js │ ├── jquery.cookie.js │ ├── jquery.form.js │ ├── jquery.json.js │ ├── jquery.metadata.js │ ├── jquery.validate.js │ ├── login.css │ ├── main.css │ └── swfupload │ ├── XPButtonNoText_160x22.png │ ├── XPButtonUploadText_61x22.png │ ├── fileprogress.js │ ├── handlers.js │ ├── handlers_edit.js │ ├── swfupload.css │ ├── swfupload.js │ ├── swfupload.swf │ ├── swfupload.swfobject.js │ └── swfuploadbutton.swf ├── 网页特效集锦系统 - 数据库设计.doc └── 网页特效集锦系统 - 需求说明书.doc /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /.myhibernatedata: -------------------------------------------------------------------------------- 1 | #MyEclipse Hibernate Properties 2 | #Fri Sep 10 15:02:00 CST 2010 3 | sessionFactoryName=com.thinkgem.webeffect.model.HibernateSessionFactory 4 | genBasicCompId=false 5 | profile= 6 | daoSFId= 7 | version=3.2 8 | jndiPath= 9 | detectM2M=false 10 | reStrategyClass= 11 | detectO2O=false 12 | springDaoFile= 13 | useJavaTypes=true 14 | keyGenerator=identity 15 | libInstallFolder=web/WEB-INF/lib 16 | addLibs2Project=false 17 | genVersionTag=false 18 | sessionFactoryId= 19 | basePersistenceClass= 20 | genAnnotations=false 21 | reSettingsFile= 22 | configFile=/webeffect/src/config/hibernate.cfg.xml 23 | createConfigFile=true 24 | addLibs2Classpath=false 25 | -------------------------------------------------------------------------------- /.mymetadata: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | webeffect 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.common.project.facet.core.builder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.jsdt.core.javascriptValidator 15 | 16 | 17 | 18 | 19 | com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.jdt.core.javabuilder 25 | 26 | 27 | 28 | 29 | com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator 30 | 31 | 32 | 33 | 34 | com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator 35 | 36 | 37 | 38 | 39 | org.eclipse.wst.validation.validationbuilder 40 | 41 | 42 | 43 | 44 | com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder 45 | 46 | 47 | 48 | 49 | com.genuitec.eclipse.hibernate.HibernateBuilder 50 | 51 | 52 | 53 | 54 | 55 | org.eclipse.jem.workbench.JavaEMFNature 56 | com.genuitec.eclipse.hibernate.hibernatenature 57 | com.genuitec.eclipse.ast.deploy.core.deploymentnature 58 | com.genuitec.eclipse.j2eedt.core.webnature 59 | org.eclipse.jdt.core.javanature 60 | org.eclipse.wst.jsdt.core.jsNature 61 | org.eclipse.wst.common.project.facet.core.nature 62 | org.eclipse.wst.common.modulecore.ModuleCoreNature 63 | 64 | 65 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 4 | org.eclipse.jdt.core.compiler.compliance=1.5 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.5 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 WangZhen(ThinkGem@163.COM) All rights reserved. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | * Neither the name of the "JeeSite" nor the names of its contributors may 13 | be used to endorse or promote products derived from this software without 14 | specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 23 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | 28 | ============================= 29 | 中文解释: 30 | ============================= 31 | Copyright (c) 2012-2013 著作权由王震(ThinkGem@163.COM)所有。著作权人保留一切权利。 32 | 33 | 这份授权条款,在使用者符合以下三条件的情形下,授予使用者使用及再散播本 34 | 软件包装原始码及二进位可执行形式的权利,无论此包装是否经改作皆然: 35 | 36 | * 对于本软件源代码的再散播,必须保留上述的版权宣告、此三条件表列,以 37 | 及下述的免责声明。 38 | * 对于本套件二进位可执行形式的再散播,必须连带以文件以及/或者其他附 39 | 于散播包装中的媒介方式,重制上述之版权宣告、此三条件表列,以及下述 40 | 的免责声明。 41 | * 未获事前取得书面许可,不得使用"WebEffect"或本软件贡献者之名称, 42 | 来为本软件之衍生物做任何表示支持、认可或推广、促销之行为。 43 | 44 | 免责声明:本软件是由加州大学董事会及本软件之贡献者以现状("as is")提供, 45 | 本软件包装不负任何明示或默示之担保责任,包括但不限于就适售性以及特定目 46 | 的的适用性为默示性担保。加州大学董事会及本软件之贡献者,无论任何条件、 47 | 无论成因或任何责任主义、无论此责任为因合约关系、无过失责任主义或因非违 48 | 约之侵权(包括过失或其他原因等)而起,对于任何因使用本软件包装所产生的 49 | 任何直接性、间接性、偶发性、特殊性、惩罚性或任何结果的损害(包括但不限 50 | 于替代商品或劳务之购用、使用损失、资料损失、利益损失、业务中断等等), 51 | 不负任何责任,即在该种使用已获事前告知可能会造成此类损害的情形下亦然。 52 | 53 | http://zh.wikipedia.org/wiki/BSD%E8%AE%B8%E5%8F%AF%E8%AF%81 54 | 55 | ============================= 56 | 部分摘录: 57 | ============================= 58 | 三、权利义务 59 | 60 | (一) 被授权人权利 61 | 62 | 允许商业或私有使用。 63 | 64 | (二) 被授权人义务 65 | 66 | 1. 在原始码的重制物中一定要保有本授权条款的著作权标示内容。 67 | 2. 以二进制制格式呈现的重制物必须再现本授权条款的著作权声明和内容。 68 | 3. 在没有事前书面同意的情况下,「WebEffect」均不得被用于支持或宣传从既有软件衍生出的产品(不为产品背书)。ORGANIZATION视使用BSD的使用者名称而定。 69 | 70 | 四、其他重要特性 71 | 72 | 1. 可与其他授权条款并存。 73 | 2. 是一个近乎公共领域的授权条款,一般个人或组织可以为了使授权条款内容符合自身 74 | 需求而更改”University of California”此一标示。 75 | 3. 使用BSD的软件程序代码可以被任意使用,代表的是在开放源码和封闭源码软件上均可 76 | 利用采用此类授权条款的程序代码。 77 | 4. 简单的免责条款。 78 | 5. 三条款BSD是由自由软件基金会(FSF)所认可的自由软件授权条款,也被开放源码组 79 | 织(OSI)认可为开放源码授权条款。并与GPL相容。 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #WebEffect网页特效集锦系统 2 | ========= 3 | 4 | ##介绍 5 | 6 | 网页特效是用程序代码在网页中实现特殊效果或者特殊功能的一种技术,它为网页添加活跃气氛,增加了网站的亲和力。在公司资源管理中由于每个员工都会收集些网页特效代码,为了实现资源共享,为了在辛勤的工作中能给网页制作提供一些便利,从而产生了网页特效集锦系统。 7 | 8 | ##使用技术 9 | 10 | Java JDK1.6、Spring Framework 3.0、Status2.1、Hibernate 3、Freemarker 2.3 11 | 12 | ##快速安装部署 13 | 14 | 1. 安装Tomcat6 Web容器及MySql5数据库并启动服务。 15 | 2. 将项导入到Eclipse中,编译并部署到Tomcat发布目录下 16 | 3. 将db\webeffect.sql文件导入到MySql数据库 17 | 4. 将MySql的用户名设置为root,密码设置为空,也可直接修改软件的连接数据库配置/WEB-INF/classes/jdbc.properties 18 | 5. 打开浏览器,输入地址:http://localhost:8080/webeffect 19 | 6. 管理员用户名:admin 密码:admin 20 | 7. 普通用户名:user 密码:user 21 | 22 | ##更多文档 23 | 24 | * [网页特效集锦系统 - 需求说明书.doc](https://github.com/thinkgem/webeffect/raw/master/%E7%BD%91%E9%A1%B5%E7%89%B9%E6%95%88%E9%9B%86%E9%94%A6%E7%B3%BB%E7%BB%9F%20-%20%E9%9C%80%E6%B1%82%E8%AF%B4%E6%98%8E%E4%B9%A6.doc) 25 | * [网页特效集锦系统 - 数据库设计.doc](https://github.com/thinkgem/webeffect/raw/master/%E7%BD%91%E9%A1%B5%E7%89%B9%E6%95%88%E9%9B%86%E9%94%A6%E7%B3%BB%E7%BB%9F%20-%20%E6%95%B0%E6%8D%AE%E5%BA%93%E8%AE%BE%E8%AE%A1.doc) 26 | -------------------------------------------------------------------------------- /db/function.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/db/function.sql -------------------------------------------------------------------------------- /src/config/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 13 | 14 | 15 | 16 | 17 | classpath:jdbc.properties 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | classpath:/com/thinkgem/webeffect/model/*.hbm.xml 36 | 37 | 38 | 39 | 40 | hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect 41 | hibernate.show_sql=true 42 | hibernate.format_sql=false 43 | hibernate.query.substitutions=true 1, false 0 44 | hibernate.jdbc.batch_size=20 45 | hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider 46 | hibernate.cache.use_second_level_cache=true 47 | hibernate.statement_cache.size = 6 48 | hibernate.connection.release_mode = after_statement 49 | hibernate.cache.provider_configuration_file_resource_path=/ehcache.xml 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/config/ehcache.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /src/config/freemarker.properties: -------------------------------------------------------------------------------- 1 | template_update_delay=1 2 | datetime_format=yyyy-MM-dd HH:mm:ss 3 | date_format=yyyy-MM-dd 4 | time_format=HH:mm:ss 5 | number_format=0.######; 6 | boolean_format=true,false 7 | auto_import="/WEB-INF/ftl_lib/index.ftl" as we 8 | whitespace_stripping=true 9 | default_encoding=UTF-8 10 | tag_syntax=auto_detect 11 | url_escaping_charset=UTF-8 12 | # Release mode 13 | #template_update_delay=60000 14 | #template_exception_handler=ignore -------------------------------------------------------------------------------- /src/config/hibernate.cfg.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | org.hibernate.dialect.MySQLDialect 12 | 13 | 14 | jdbc:mysql://localhost:3306/webeffect 15 | 16 | root 17 | 18 | com.mysql.jdbc.Driver 19 | 20 | 21 | webeffect 22 | 23 | 24 | 25 | 27 | 28 | 29 | 31 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/config/i18n.properties: -------------------------------------------------------------------------------- 1 | format.date={0,date,yyyy-MM-dd} 2 | format.datetime={0,date,yyyy-MM-dd HH:mm:ss} 3 | format.money={0,number,currency} 4 | format.percent = {0,number,##0.00'%'} 5 | 6 | title=\u7F51\u9875\u7279\u6548\u96C6\u9526 7 | -------------------------------------------------------------------------------- /src/config/jdbc.properties: -------------------------------------------------------------------------------- 1 | db.driver=com.mysql.jdbc.Driver 2 | db.url=jdbc:mysql://localhost:3306/webeffect 3 | db.username=root 4 | db.password= 5 | db.characterEncoding=UTF-8 6 | db.minimumConnectionCount=5 7 | db.maximumConnectionCount=50 -------------------------------------------------------------------------------- /src/config/struts.properties: -------------------------------------------------------------------------------- 1 | struts.action.extension=jspx,do 2 | struts.objectFactory=spring 3 | struts.enable.DynamicMethodInvocation=false 4 | struts.devMode=true 5 | struts.locale=zh_CN 6 | struts.i18n.encoding=UTF-8 7 | struts.custom.i18n.resources=i18n 8 | struts.ui.theme=simple 9 | struts.multipart.saveDir=/temp 10 | struts.multipart.maxSize=5258240 11 | struts.enable.SlashesInActionNames=true 12 | status.resPath=/resource 13 | status.tplPath=/WEB-INF/template 14 | # Release mode 15 | #struts.devMode=false 16 | #struts.freemarker.templatesCache=true 17 | #struts.freemarker.templatesCache=true 18 | #struts.serve.static.browserCache=true 19 | -------------------------------------------------------------------------------- /src/config/struts.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | ${tplPath}/message.html 38 | ${tplPath}/message.html 39 | 40 | / 41 | login 42 | 43 | ${tplPath}/message.html 44 | ${tplPath}/message.html 45 | /403.html 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/BaseAction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.action; 2 | 3 | import java.io.IOException; 4 | import java.util.Map; 5 | 6 | import javax.servlet.http.HttpServletRequest; 7 | import javax.servlet.http.HttpServletResponse; 8 | import javax.servlet.http.HttpSession; 9 | 10 | import org.apache.struts2.ServletActionContext; 11 | import org.slf4j.Logger; 12 | import org.slf4j.LoggerFactory; 13 | 14 | import com.thinkgem.webeffect.hibernate.Pagination; 15 | import com.thinkgem.webeffect.model.WeUser; 16 | import com.opensymphony.xwork2.ActionContext; 17 | 18 | /** 19 | * Action 基类 20 | * @author WangZhen 21 | * @version $Id: BaseAction.java 2500 2010-05-21 20:35:46Z wzhen $ 22 | */ 23 | public class BaseAction extends com.opensymphony.xwork2.ActionSupport { 24 | 25 | private static final long serialVersionUID = 6879997137880435518L; 26 | protected static final Logger log = LoggerFactory.getLogger(BaseAction.class); 27 | 28 | public int pageIndex = 1; 29 | protected int pageSize = 30; 30 | protected Pagination pagination; 31 | 32 | public static final String MESSAGE = "message"; 33 | 34 | public int getPageIndex() { 35 | return pageIndex; 36 | } 37 | 38 | public void setPageIndex(int pageIndex) { 39 | this.pageIndex = pageIndex; 40 | } 41 | 42 | public int getPageSize() { 43 | return pageSize; 44 | } 45 | 46 | public void setPageSize(int pageSize) { 47 | this.pageSize = pageSize; 48 | } 49 | 50 | public Pagination getPagination() { 51 | return pagination; 52 | } 53 | 54 | public void setPagination(Pagination pagination) { 55 | this.pagination = pagination; 56 | } 57 | 58 | /** 59 | * 获取主题资源路径 60 | */ 61 | public String getResPath(){ 62 | return this.getRequest().getContextPath()+getTexts("struts").getString("status.resPath"); 63 | } 64 | 65 | /** 66 | * 获取主题模板路径 67 | */ 68 | public String getTplPath(){ 69 | return getTexts("struts").getString("status.tplPath"); 70 | } 71 | 72 | /** 73 | * 获得请求对象 74 | */ 75 | protected HttpServletRequest getRequest(){ 76 | return ServletActionContext.getRequest(); 77 | } 78 | 79 | /** 80 | * 获得客户端响应对象 81 | */ 82 | protected HttpServletResponse getResponse(){ 83 | return ServletActionContext.getResponse(); 84 | } 85 | 86 | /** 87 | * 获得客户端会话对象 88 | */ 89 | protected HttpSession getSession(){ 90 | return this.getRequest().getSession(); 91 | } 92 | 93 | /** 94 | * 获得服务器session对象 95 | */ 96 | @SuppressWarnings("unchecked") 97 | protected Map getSessionMap(){ 98 | return ActionContext.getContext().getSession(); 99 | } 100 | 101 | /** 102 | * 获得HTTP的请求方法 103 | */ 104 | protected String getMethod(){ 105 | return this.getRequest().getMethod(); 106 | } 107 | 108 | /** 109 | * HTTP是否以Get方式请求 110 | */ 111 | protected boolean isGet(){ 112 | return "GET".equals(this.getMethod()); 113 | } 114 | 115 | /** 116 | * HTTP是否以POST方式请求 117 | */ 118 | protected boolean isPost(){ 119 | return "POST".equals(this.getMethod()); 120 | } 121 | 122 | /** 123 | * 获得GET或POST参数 124 | */ 125 | protected String getParameter(String s){ 126 | return this.getRequest().getParameter(s); 127 | } 128 | 129 | /** 130 | * 直接输出Text 131 | */ 132 | protected String renderText(String text) { 133 | return render(text, "text/plain;charset=utf-8"); 134 | } 135 | 136 | /** 137 | * 直接输出HTML 138 | */ 139 | protected String renderHtml(String html) { 140 | return render(html, "text/html;charset=utf-8"); 141 | } 142 | 143 | /** 144 | * 直接输出XML 145 | */ 146 | protected String renderXML(String xml) { 147 | return render(xml, "text/xml;charset=utf-8"); 148 | } 149 | 150 | /** 151 | * 直接输出JavaScript 152 | */ 153 | protected String renderJavaScript(String html) { 154 | return render(html, "text/javascript;charset=utf-8"); 155 | } 156 | 157 | /** 158 | * 直接输出内容 159 | */ 160 | protected String render(String s, String contentType) { 161 | try { 162 | HttpServletResponse response = this.getResponse(); 163 | response.setContentType(contentType); 164 | response.getWriter().write(s); 165 | } catch (IOException e) { 166 | log.error(e.getMessage(), e); 167 | } 168 | return NONE; 169 | } 170 | 171 | protected WeUser getCurrentUser(){ 172 | Object user = ServletActionContext.getRequest().getSession().getAttribute("user"); 173 | return user == null ? null : (WeUser)user; 174 | } 175 | 176 | } 177 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/CategoryAction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.action; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Scope; 7 | import org.springframework.stereotype.Controller; 8 | 9 | import com.thinkgem.webeffect.model.WeCategory; 10 | import com.thinkgem.webeffect.service.CategoryService; 11 | import com.thinkgem.webeffect.service.EffectService; 12 | import com.thinkgem.webeffect.util.Validate; 13 | 14 | /** 15 | * 特效分类控制器 16 | * @author WangZhen 17 | * @version $Id$ 18 | */ 19 | @Scope("prototype") 20 | @Controller("categoryAction") 21 | public class CategoryAction extends BaseAction { 22 | 23 | private static final long serialVersionUID = -4427797236687774982L; 24 | 25 | private int id; 26 | 27 | private List categoryList; 28 | @Autowired 29 | private CategoryService categoryService; 30 | @Autowired 31 | private EffectService effectService; 32 | 33 | public String index(){ 34 | categoryList = categoryService.list(); 35 | return SUCCESS; 36 | } 37 | 38 | /** 39 | * 删除资源分类 40 | * @return 41 | */ 42 | public String delete(){ 43 | pagination = effectService.list(id, 1, 1, null); 44 | if(pagination.getList().size()>0){ 45 | return renderText("删除失败,分类不为空,请删除改分类特效后再操作!"); 46 | } 47 | categoryService.delete(id); 48 | return renderText(SUCCESS); 49 | } 50 | public void validateDel(){ 51 | if(id==0) this.addActionError("编号不能为0"); 52 | } 53 | 54 | /** 55 | * 批量更新分类 56 | * @return 57 | */ 58 | public String update(){ 59 | //数据校验 60 | for(int i=0; i getCategoryList() { 87 | return categoryList; 88 | } 89 | 90 | public void setCategoryList(List categoryList) { 91 | this.categoryList = categoryList; 92 | } 93 | 94 | public int getId() { 95 | return id; 96 | } 97 | 98 | public void setId(int id) { 99 | this.id = id; 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/DefaultAction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.action; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.context.annotation.Scope; 5 | import org.springframework.stereotype.Controller; 6 | 7 | import com.thinkgem.webeffect.model.WeUser; 8 | import com.thinkgem.webeffect.service.UserService; 9 | 10 | /** 11 | * 默认控制器 12 | * @author WangZhen 13 | * @version $Id$ 14 | */ 15 | @Scope("prototype") 16 | @Controller("defaultAction") 17 | public class DefaultAction extends ValidateAction { 18 | 19 | private static final long serialVersionUID = -4859608488707100341L; 20 | 21 | // private String uri; 22 | 23 | private String username; 24 | private String password; 25 | 26 | private WeUser user; 27 | 28 | @Autowired 29 | private UserService userService; 30 | 31 | /** 32 | * 引导 33 | * @return 34 | */ 35 | public String index(){ 36 | return this.getCurrentUser() == null ? LOGIN : SUCCESS; 37 | } 38 | 39 | /** 40 | * 登录 41 | * @return 42 | */ 43 | public String login(){ 44 | if(isPost()){ 45 | user = userService.login(username, password); 46 | if (user==null){ 47 | this.addActionError("用户名或密码不正确"); 48 | }else{ 49 | this.getRequest().getSession().setAttribute("user", user); 50 | return SUCCESS; 51 | } 52 | } 53 | return INPUT; 54 | } 55 | public void validateLogin(){ 56 | if (isPost()){ 57 | requiredStringValidate("用户名", username); 58 | requiredStringValidate("密码", password); 59 | } 60 | } 61 | 62 | /** 63 | * 登出 64 | * @return 65 | */ 66 | public String logout(){ 67 | this.getRequest().getSession().removeAttribute("user"); 68 | return LOGIN; 69 | } 70 | 71 | // /** 72 | // * 权限验证 73 | // * @param uri 需验证的URI 74 | // * @return 通过:true 75 | // */ 76 | // public String auth(){ 77 | // WeUser u = getCurrentUser(); 78 | // if (u != null){ 79 | // if (u.getRole().intValue() == 2){ 80 | // Set set = new HashSet(); 81 | // //普通 用户拥有的权限 82 | // set.add("/effect/index"); 83 | // set.add("/effect/upload"); 84 | // set.add("/effect/uploadfile"); 85 | // set.add("/effect/view"); 86 | // set.add("/effect/download"); 87 | // //判断是否拥有权限 88 | // if(!set.contains(uri)){ 89 | // return renderText("false"); 90 | // } 91 | // } 92 | // return renderText("true"); 93 | // } 94 | // return renderText("false"); 95 | // } 96 | 97 | //---------- get set 98 | 99 | public String getUsername() { 100 | return username; 101 | } 102 | 103 | public void setUsername(String username) { 104 | this.username = username; 105 | } 106 | 107 | public String getPassword() { 108 | return password; 109 | } 110 | 111 | public void setPassword(String password) { 112 | this.password = password; 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/UserAction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.action; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.context.annotation.Scope; 8 | import org.springframework.stereotype.Controller; 9 | 10 | import com.thinkgem.webeffect.model.WeUser; 11 | import com.thinkgem.webeffect.service.UserService; 12 | import com.thinkgem.webeffect.util.Encrypt; 13 | 14 | /** 15 | * 用户控制器 16 | * @author WangZhen 17 | * @version $Id$ 18 | */ 19 | @Scope("prototype") 20 | @Controller("userAction") 21 | public class UserAction extends ValidateAction { 22 | 23 | private static final long serialVersionUID = 5087739323925878936L; 24 | 25 | private int id; 26 | 27 | private Map roleMap; 28 | 29 | private WeUser user; 30 | 31 | @Autowired 32 | private UserService userService; 33 | 34 | /** 35 | * 用户管理首页 36 | * @return 37 | */ 38 | public String index(){ 39 | pagination = userService.list(pageIndex, pageSize); 40 | return SUCCESS; 41 | } 42 | 43 | /** 44 | * 新增用户 45 | * @return 46 | */ 47 | public String add(){ 48 | if(isPost()){ 49 | if(userService.usernameExists(user.getUsername())){ 50 | this.addActionError("该用户名已经存在"); 51 | return INPUT; 52 | } 53 | userService.save(user); 54 | return renderText(SUCCESS); 55 | } 56 | return SUCCESS; 57 | } 58 | public void validateAdd(){ 59 | if (isPost() && user!=null){ 60 | this.usernameValidate(user.getUsername()); 61 | this.rangeLengthValidate("密码", user.getPassword(), 4, 20); 62 | this.rangeLengthValidate("昵称", user.getNickname(), 2, 20); 63 | this.maxLengthValidate("描述", user.getDescription(), 255); 64 | if(!this.requiredValidate("角色", user.getRole())){ 65 | this.rangeValidate("角色", user.getRole(), 1, 2); 66 | } 67 | } 68 | } 69 | 70 | /** 71 | * 编辑用户 72 | * @return 73 | */ 74 | public String edit(){ 75 | if(isPost()){ 76 | WeUser u = userService.getById(user.getId()); 77 | u.setNickname(user.getNickname()); 78 | u.setDescription(user.getDescription()); 79 | u.setRole(user.getRole()); 80 | if (user.getPassword()!=null && !"".equals(user.getPassword())) 81 | u.setPassword(Encrypt.md5(Encrypt.sha(user.getPassword()))); 82 | userService.update(u); 83 | return renderText(SUCCESS); 84 | }else{ 85 | user = userService.getById(id); 86 | } 87 | return SUCCESS; 88 | } 89 | public void validateEdit(){ 90 | if (isPost() && user!=null){ 91 | if (user.getPassword()!=null && !"".equals(user.getPassword())) 92 | this.rangeLengthValidate("密码", user.getPassword(), 4, 20); 93 | this.rangeLengthValidate("昵称", user.getNickname(), 2, 20); 94 | this.maxLengthValidate("描述", user.getDescription(), 255); 95 | if(!this.requiredValidate("角色", user.getRole())){ 96 | this.rangeValidate("角色", user.getRole(), 1, 2); 97 | } 98 | } 99 | } 100 | 101 | /** 102 | * 删除用户 103 | * @return 104 | */ 105 | public String delete(){ 106 | if (id == 1 || getCurrentUser().getId().intValue() == id){//不能删除自己及最高管理员 107 | return renderText("不能删除该用户"); 108 | } 109 | userService.delete(id); 110 | return renderText(SUCCESS); 111 | } 112 | 113 | /** 114 | * 修改个人资料 115 | * @return 116 | */ 117 | public String changeInfo(){ 118 | if(isPost()){ 119 | WeUser u = userService.getById(getCurrentUser().getId()); 120 | u.setNickname(user.getNickname()); 121 | u.setDescription(user.getDescription()); 122 | userService.update(u); 123 | return renderText(SUCCESS); 124 | }else{ 125 | user = userService.getById(getCurrentUser().getId()); 126 | } 127 | return SUCCESS; 128 | } 129 | public void validateChangeInfo(){ 130 | if (isPost() && user!=null){ 131 | this.rangeLengthValidate("昵称", user.getNickname(), 2, 20); 132 | this.maxLengthValidate("描述", user.getDescription(), 255); 133 | } 134 | } 135 | /** 136 | * 修改密码 137 | * @return 138 | */ 139 | public String changePassword(){ 140 | if(isPost()){ 141 | WeUser u = userService.getById(getCurrentUser().getId()); 142 | if(!u.getPassword().equals(Encrypt.md5(Encrypt.sha(user.getPassword())))){ 143 | this.addActionError("旧密码不正确"); 144 | return INPUT; 145 | } 146 | u.setPassword(Encrypt.md5(Encrypt.sha(user.getPasswordNew()))); 147 | userService.update(u); 148 | return renderText(SUCCESS); 149 | }else{ 150 | user = userService.getById(getCurrentUser().getId()); 151 | } 152 | return SUCCESS; 153 | } 154 | public void validateChangePassword(){ 155 | if (isPost() && user!=null){ 156 | this.rangeLengthValidate("新密码", user.getPasswordNew(), 4, 20); 157 | this.equalStringValidate("新密码与确认新密码", user.getPasswordNew(), user.getPasswordNew2()); 158 | } 159 | } 160 | 161 | public Map getRoleMap() { 162 | roleMap = new HashMap(); 163 | roleMap.put(1, "系统管理员"); 164 | roleMap.put(2, "普通用户"); 165 | // roleMap.put(3, "普通用户"); 166 | return roleMap; 167 | } 168 | 169 | public void setRoleMap(Map roleMap) { 170 | this.roleMap = roleMap; 171 | } 172 | 173 | public WeUser getUser() { 174 | return user; 175 | } 176 | 177 | public void setUser(WeUser user) { 178 | this.user = user; 179 | } 180 | 181 | public int getId() { 182 | return id; 183 | } 184 | 185 | public void setId(int id) { 186 | this.id = id; 187 | } 188 | 189 | 190 | } 191 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/struts-center.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | ${tplPath}/center/{1}.html 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/struts-default.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | login 11 | 12 | 13 | effect 14 | index 15 | 16 | 17 | 18 | ${tplPath}/login.html 19 | 20 | effect 21 | index 22 | 23 | 24 | 25 | 26 | effect 27 | index 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/struts-effect.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | application/octet-stream;charset=ISO8859-1 11 | inputStream 12 | attachment;filename=${fileName} 13 | 8192 14 | 15 | 16 | 17 | 18 | 19 | ${tplPath}/effect/{1}.html 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/action/struts-setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | ${tplPath}/setting/user/{1}.html 10 | 11 | 12 | 13 | 14 | 15 | ${tplPath}/setting/category/{1}.html 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/WeCategoryDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeCategory DAO Interface 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao; 7 | 8 | import com.thinkgem.webeffect.hibernate.BaseDao; 9 | import com.thinkgem.webeffect.model.WeCategory; 10 | 11 | public interface WeCategoryDao extends BaseDao { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/WeCommentDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeComment DAO Interface 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao; 7 | 8 | import com.thinkgem.webeffect.hibernate.BaseDao; 9 | import com.thinkgem.webeffect.model.WeComment; 10 | 11 | public interface WeCommentDao extends BaseDao { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/WeEffectDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeEffect DAO Interface 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao; 7 | 8 | import com.thinkgem.webeffect.hibernate.BaseDao; 9 | import com.thinkgem.webeffect.model.WeEffect; 10 | 11 | public interface WeEffectDao extends BaseDao { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/WeFileDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeFile DAO Interface 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao; 7 | 8 | import com.thinkgem.webeffect.hibernate.BaseDao; 9 | import com.thinkgem.webeffect.model.WeFile; 10 | 11 | public interface WeFileDao extends BaseDao { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/WeUserDao.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeUser DAO Interface 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao; 7 | 8 | import com.thinkgem.webeffect.hibernate.BaseDao; 9 | import com.thinkgem.webeffect.model.WeUser; 10 | 11 | public interface WeUserDao extends BaseDao { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/impl/WeCategoryDaoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeCategory DAO Implement 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao.impl; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.thinkgem.webeffect.dao.WeCategoryDao; 11 | import com.thinkgem.webeffect.hibernate.BaseDaoImpl; 12 | import com.thinkgem.webeffect.model.WeCategory; 13 | 14 | @Repository 15 | public class WeCategoryDaoImpl extends BaseDaoImpl implements WeCategoryDao { 16 | 17 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/impl/WeCommentDaoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeComment DAO Implement 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao.impl; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.thinkgem.webeffect.dao.WeCommentDao; 11 | import com.thinkgem.webeffect.hibernate.BaseDaoImpl; 12 | import com.thinkgem.webeffect.model.WeComment; 13 | 14 | @Repository 15 | public class WeCommentDaoImpl extends BaseDaoImpl implements WeCommentDao { 16 | 17 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/impl/WeEffectDaoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeEffect DAO Implement 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao.impl; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.thinkgem.webeffect.dao.WeEffectDao; 11 | import com.thinkgem.webeffect.hibernate.BaseDaoImpl; 12 | import com.thinkgem.webeffect.model.WeEffect; 13 | 14 | @Repository 15 | public class WeEffectDaoImpl extends BaseDaoImpl implements WeEffectDao { 16 | 17 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/impl/WeFileDaoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeFile DAO Implement 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao.impl; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.thinkgem.webeffect.dao.WeFileDao; 11 | import com.thinkgem.webeffect.hibernate.BaseDaoImpl; 12 | import com.thinkgem.webeffect.model.WeFile; 13 | 14 | @Repository 15 | public class WeFileDaoImpl extends BaseDaoImpl implements WeFileDao { 16 | 17 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/dao/impl/WeUserDaoImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WeUser DAO Implement 3 | * @author Batch Build DAO Tools 4 | * @version $Id$ 5 | */ 6 | package com.thinkgem.webeffect.dao.impl; 7 | 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.thinkgem.webeffect.dao.WeUserDao; 11 | import com.thinkgem.webeffect.hibernate.BaseDaoImpl; 12 | import com.thinkgem.webeffect.model.WeUser; 13 | 14 | @Repository 15 | public class WeUserDaoImpl extends BaseDaoImpl implements WeUserDao { 16 | 17 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/hibernate/BatchBuildDao.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.hibernate; 2 | 3 | import java.io.File; 4 | import java.io.FileWriter; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | /** 10 | * Batch Build DAO Tools 11 | * @author WangZhen 12 | * @version $Id: BatchBuildDao.java 2500 2010-05-21 20:35:46Z wzhen $ 13 | */ 14 | public class BatchBuildDao { 15 | 16 | String filePath = "D:\\Workspaces\\MyEclipse\\webeffect\\src\\java\\com\\thinkgem\\webeffect\\"; 17 | String packageName = "com.thinkgem.webeffect"; 18 | boolean isUpdateFile = false; 19 | boolean isAnnotation = true; 20 | 21 | public BatchBuildDao() { 22 | // String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); 23 | List classNameList = new ArrayList(); 24 | classNameList = this.getClassNameList(this.filePath + "model\\"); 25 | String content = ""; 26 | for (String className : classNameList) { 27 | content = "/**\n * "+className+" DAO Interface\n * @author Batch Build DAO Tools\n * @version $Id$\n */\n" 28 | + "package " + this.packageName + ".dao;\n\n" 29 | + "import " + this.packageName + ".hibernate.BaseDao;\n" 30 | + "import " + this.packageName + ".model." + className + ";\n\n" 31 | + "public interface " + className + "Dao" + " extends BaseDao<" + className + "> {\n\n" 32 | + "}\n"; 33 | if(this.createFile(filePath + "dao\\" + className + "Dao.java", content)){ 34 | content = "/**\n * "+className+" DAO Implement\n * @author Batch Build DAO Tools\n * @version $Id$\n */\n" 35 | + "package " + this.packageName + ".dao.impl;\n\n" 36 | + "import org.springframework.stereotype.Repository;\n" 37 | + "import " + this.packageName + ".hibernate.BaseDaoImpl;\n" 38 | + "import " + this.packageName + ".dao." + className + "Dao;\n" 39 | + "import " + this.packageName + ".model." + className + ";\n\n"; 40 | if (isAnnotation){ 41 | content += "@Repository\n"; 42 | } 43 | content += "public class " + className + "DaoImpl extends BaseDaoImpl<" + className + "> implements " + className + "Dao {\n\n" 44 | + "}"; 45 | if (this.createFile(filePath + "dao\\impl\\" + className + "DaoImpl.java", content)){ 46 | content = "\n" 47 | + " \n" 48 | + "\n"; 49 | System.out.print(content); 50 | } 51 | } 52 | } 53 | if (isAnnotation){ 54 | content = "\n" 55 | + ""; 56 | System.out.print(content); 57 | } 58 | } 59 | 60 | public List getClassNameList(String path) { 61 | List list = new ArrayList(); 62 | File file = new File(path); 63 | File[] files = file.listFiles(); 64 | for (int i = 0; i < files.length; i++) { 65 | if (files[i].isFile()) { 66 | String fileName = files[i].getName(); 67 | if (".java".equals(fileName 68 | .substring(fileName.lastIndexOf(".")))) { 69 | list.add(fileName.substring(0, fileName.lastIndexOf("."))); 70 | } 71 | } 72 | } 73 | return list; 74 | } 75 | 76 | public boolean createFile(String fileName, String content) { 77 | if (!isUpdateFile && new File(fileName).exists()){ 78 | return false; 79 | } 80 | try { 81 | FileWriter fw = new FileWriter(fileName); 82 | fw.write(content); 83 | fw.close(); 84 | } catch (IOException e) { 85 | e.printStackTrace(); 86 | } 87 | return true; 88 | } 89 | 90 | public static void main(String[] args) { 91 | new BatchBuildDao(); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/hibernate/Pagination.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.hibernate; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * 分页类 8 | * @author WangZhen 9 | * @version $Id: Pagination.java 2658 2010-05-29 13:14:02Z wzhen $ 10 | */ 11 | public class Pagination { 12 | 13 | private int pageIndex; // 当前页索引 14 | private int pageSize; // 页面大小 15 | 16 | private int count;// 总记录数 17 | 18 | private int first;// 首页索引 19 | private int last;// 尾页索引 20 | private int prev;// 上一页索引 21 | private int next;// 下一页索引 22 | 23 | private boolean firstPage;//是否是第一页 24 | private boolean lastPage;//是否是最后一页 25 | 26 | private int length = 8;// 显示页面长度 27 | private int slider = 1;// 前后显示页面长度 28 | 29 | @SuppressWarnings("unchecked") 30 | private List list; 31 | 32 | public Pagination(){ 33 | 34 | } 35 | 36 | @SuppressWarnings("unchecked") 37 | public Pagination(int pageIndex, int pageSize, int count) { 38 | this(pageIndex, pageSize, count, new ArrayList()); 39 | } 40 | 41 | @SuppressWarnings("unchecked") 42 | public Pagination(int pageIndex, int pageSize, int count, List list) { 43 | this.count = count; 44 | this.pageIndex = pageIndex; 45 | this.pageSize = pageSize; 46 | this.list = list; 47 | 48 | //1 49 | this.first = 1; 50 | 51 | this.last = (count / (this.pageSize < 1 ? 20 : this.pageSize) + first - 1); 52 | 53 | if (count % pageSize != 0 || this.last == 0) { 54 | this.last++; 55 | } 56 | 57 | if (this.last < this.first) { 58 | this.last = this.first; 59 | } 60 | 61 | if (this.pageIndex <= 1) { 62 | this.pageIndex = this.first; 63 | this.firstPage=true; 64 | } 65 | 66 | if (this.pageIndex >= this.last) { 67 | this.pageIndex = this.last; 68 | this.lastPage=true; 69 | } 70 | 71 | if (this.pageIndex < this.last - 1) { 72 | this.next = this.pageIndex + 1; 73 | } else { 74 | this.next = this.last; 75 | } 76 | 77 | if (this.pageIndex > 1) { 78 | this.prev = this.pageIndex - 1; 79 | } else { 80 | this.prev = this.first; 81 | } 82 | 83 | //2 84 | if (this.pageIndex < this.first) {// 如果当前页小于首页 85 | this.pageIndex = this.first; 86 | } 87 | 88 | if (this.pageIndex > this.last) {// 如果当前页大于尾页 89 | this.pageIndex = this.last; 90 | } 91 | 92 | } 93 | 94 | @Override 95 | public String toString() { 96 | 97 | StringBuilder sb = new StringBuilder(); 98 | 99 | // sb.append("
\n"); 100 | 101 | sb.append("
    \n"); 102 | 103 | //1 104 | 105 | if (pageIndex == first) {// 如果是首页 106 | sb.append("
  • « 上一页
  • \n"); 107 | } else { 108 | sb.append("
  • " + "« 上一页
  • \n"); 109 | } 110 | 111 | //2 112 | 113 | int begin = pageIndex - (length / 2); 114 | 115 | if (begin < first) { 116 | begin = first; 117 | } 118 | 119 | int end = begin + length - 1; 120 | 121 | if (end >= last) { 122 | end = last; 123 | begin = end - length + 1; 124 | if (begin < first) { 125 | begin = first; 126 | } 127 | } 128 | 129 | if (begin > first) { 130 | int i = 0; 131 | for (i = first; i < first + slider && i < begin; i++) { 132 | sb.append("
  • " 133 | + (i + 1 - first) + "
  • \n"); 134 | } 135 | if (i < begin) { 136 | sb.append("
  • ...
  • \n"); 137 | } 138 | } 139 | 140 | for (int i = begin; i <= end; i++) { 141 | if (i == pageIndex) { 142 | sb.append("
  • " + (i + 1 - first) 143 | + "
  • \n"); 144 | } else { 145 | sb.append("
  • " 146 | + (i + 1 - first) + "
  • \n"); 147 | } 148 | } 149 | 150 | if (last - end > slider) { 151 | sb.append("
  • ...
  • \n"); 152 | end = last - slider; 153 | } 154 | 155 | for (int i = end + 1; i <= last; i++) { 156 | sb.append("
  • " 157 | + (i + 1 - first) + "
  • \n"); 158 | } 159 | 160 | if (pageIndex == last) { 161 | sb.append("
  • 下一页 »
  • \n"); 162 | } else { 163 | sb.append("
  • " 164 | + "下一页 »
  • \n"); 165 | } 166 | 167 | sb.append("
\n"); 168 | 169 | sb.append("

"); 170 | 171 | sb.append(" 共 " + count + " 条"); 172 | 173 | sb.append("

"); 174 | 175 | // sb.append("
\n"); 176 | return sb.toString(); 177 | } 178 | 179 | public static void main(String[] args) { 180 | Pagination p = new Pagination(3, 3, 25); 181 | System.out.println(p); 182 | System.out.println("首页:"+p.getFirst()); 183 | System.out.println("尾页:"+p.getLast()); 184 | System.out.println("上页:"+p.getPrev()); 185 | System.out.println("下页:"+p.getNext()); 186 | } 187 | 188 | public int getCount() { 189 | return count; 190 | } 191 | 192 | public int getPageIndex() { 193 | return pageIndex; 194 | } 195 | 196 | public int getPageSize() { 197 | return pageSize; 198 | } 199 | 200 | public int getFirst() { 201 | return first; 202 | } 203 | 204 | public int getLast() { 205 | return last; 206 | } 207 | 208 | public int getTotalPage() { 209 | return last; 210 | } 211 | 212 | public boolean isFirstPage() { 213 | return firstPage; 214 | } 215 | 216 | public boolean isLastPage() { 217 | return lastPage; 218 | } 219 | 220 | public int getPrev() { 221 | if (isFirstPage()) { 222 | return pageIndex; 223 | } else { 224 | return pageIndex - 1; 225 | } 226 | } 227 | 228 | public int getNext() { 229 | if (isLastPage()) { 230 | return pageIndex; 231 | } else { 232 | return pageIndex + 1; 233 | } 234 | } 235 | 236 | @SuppressWarnings("unchecked") 237 | public List getList() { 238 | return list; 239 | } 240 | 241 | @SuppressWarnings("unchecked") 242 | public void setList(List list) { 243 | this.list = list; 244 | } 245 | } 246 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/interceptor/AuthInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.interceptor; 2 | 3 | import java.util.HashSet; 4 | import java.util.Map; 5 | import java.util.Set; 6 | 7 | import javax.servlet.http.HttpServletRequest; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | import com.thinkgem.webeffect.action.BaseAction; 12 | import com.thinkgem.webeffect.model.WeUser; 13 | import com.opensymphony.xwork2.ActionInvocation; 14 | import com.opensymphony.xwork2.interceptor.AbstractInterceptor; 15 | 16 | /** 17 | * 访问权限拦截器 18 | * @author WangZhen 19 | * @created 2010-4-19 20 | * @version $Id: EvaAuthInterceptor.java 2500 2010-05-21 20:35:46Z wzhen $ 21 | */ 22 | @SuppressWarnings("unchecked") 23 | public class AuthInterceptor extends AbstractInterceptor { 24 | 25 | private static final long serialVersionUID = 632293647099709993L; 26 | 27 | @Override 28 | public String intercept(ActionInvocation invocation) throws Exception { 29 | Map session = invocation.getInvocationContext().getSession(); 30 | if (session.containsKey("user")){ 31 | WeUser u = (WeUser)session.get("user"); 32 | if (u.getRole().intValue() == 2){ 33 | Set set = new HashSet(); 34 | //普通 用户拥有的权限 35 | set.add("/effect/index");//主页 36 | set.add("/effect/upload");//上传特效 37 | set.add("/effect/uploadfile");//上传特效文件 38 | set.add("/effect/edit");//编辑特效 39 | set.add("/effect/delete");//删除特效 40 | set.add("/effect/view");//查看特效 41 | set.add("/effect/download");//下载特效 42 | set.add("/effect/comment");//浏览评论 43 | set.add("/effect/addComment");//发表评论 44 | set.add("/effect/getNickname");//获得昵称 45 | set.add("/center/changeInfo");//修改个人信息 46 | set.add("/center/changePassword");//修改个人密码 47 | //获得当前URI 48 | HttpServletRequest request = ServletActionContext.getRequest(); 49 | String uri = request.getRequestURI(); 50 | uri = uri.substring(0,uri.lastIndexOf(".")).replace(request.getContextPath(), ""); 51 | // System.out.println(uri); 52 | //判断是否拥有权限 53 | if(!set.contains(uri)){ 54 | return "403"; 55 | } 56 | } 57 | return invocation.invoke(); 58 | }else{ 59 | // if (invocation.getAction() instanceof com.opensymphony.xwork2.ActionSupport) { 60 | // String msg = "你当前还没有登录!点击这里登录"; 61 | // ((com.opensymphony.xwork2.ActionSupport)invocation.getAction()).addActionMessage(msg); 62 | // } 63 | // return BaseAction.MESSAGE; 64 | return BaseAction.LOGIN; 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/interceptor/ClearErrorsAndMessagesInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.interceptor; 2 | 3 | import com.opensymphony.xwork2.ActionInvocation; 4 | import com.opensymphony.xwork2.ActionSupport; 5 | import com.opensymphony.xwork2.interceptor.AbstractInterceptor; 6 | 7 | /** 8 | * 清除错误及消息拦截器 9 | * @author WangZhen 10 | * @created 2010-3-31 11 | * @version $Id: ClearErrorsAndMessagesInterceptor.java 2500 2010-05-21 20:35:46Z wzhen $ 12 | */ 13 | public class ClearErrorsAndMessagesInterceptor extends AbstractInterceptor { 14 | 15 | private static final long serialVersionUID = -6809721511919203053L; 16 | 17 | public String intercept(ActionInvocation invocation) throws Exception { 18 | ((ActionSupport)invocation.getAction()).clearErrorsAndMessages(); 19 | return invocation.invoke(); 20 | } 21 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeCategory.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 名称 18 | 19 | 20 | 21 | 22 | 描述 23 | 24 | 25 | 26 | 27 | 权重 28 | 29 | 30 | 31 | 32 | 33 | 分类编号 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeCategory.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | /** 7 | * WeCategory entity. @author MyEclipse Persistence Tools 8 | */ 9 | 10 | @SuppressWarnings({ "unchecked", "serial" }) 11 | public class WeCategory implements java.io.Serializable { 12 | 13 | // Fields 14 | 15 | private Integer id; 16 | private String name; 17 | private String description; 18 | private Integer weight; 19 | private Set weEffects = new HashSet(0); 20 | 21 | // Constructors 22 | 23 | /** default constructor */ 24 | public WeCategory() { 25 | } 26 | 27 | /** minimal constructor */ 28 | public WeCategory(String name, String description, Integer weight) { 29 | this.name = name; 30 | this.description = description; 31 | this.weight = weight; 32 | } 33 | 34 | /** full constructor */ 35 | public WeCategory(String name, String description, Integer weight, 36 | Set weEffects) { 37 | this.name = name; 38 | this.description = description; 39 | this.weight = weight; 40 | this.weEffects = weEffects; 41 | } 42 | 43 | // Property accessors 44 | 45 | public Integer getId() { 46 | return this.id; 47 | } 48 | 49 | public void setId(Integer id) { 50 | this.id = id; 51 | } 52 | 53 | public String getName() { 54 | return this.name; 55 | } 56 | 57 | public void setName(String name) { 58 | this.name = name; 59 | } 60 | 61 | public String getDescription() { 62 | return this.description; 63 | } 64 | 65 | public void setDescription(String description) { 66 | this.description = description; 67 | } 68 | 69 | public Integer getWeight() { 70 | return this.weight; 71 | } 72 | 73 | public void setWeight(Integer weight) { 74 | this.weight = weight; 75 | } 76 | 77 | public Set getWeEffects() { 78 | return this.weEffects; 79 | } 80 | 81 | public void setWeEffects(Set weEffects) { 82 | this.weEffects = weEffects; 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeComment.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 评论的特效 16 | 17 | 18 | 19 | 20 | 评论者用户名 21 | 22 | 23 | 24 | 25 | 评论内容 26 | 27 | 28 | 29 | 30 | 发表时间 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeComment.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.sql.Timestamp; 4 | 5 | /** 6 | * WeComment entity. @author MyEclipse Persistence Tools 7 | */ 8 | 9 | @SuppressWarnings("serial") 10 | public class WeComment implements java.io.Serializable { 11 | 12 | // Fields 13 | 14 | private Integer id; 15 | private WeEffect weEffect; 16 | private String username; 17 | private String content; 18 | private Timestamp created; 19 | 20 | // Constructors 21 | 22 | /** default constructor */ 23 | public WeComment() { 24 | } 25 | 26 | /** full constructor */ 27 | public WeComment(WeEffect weEffect, String username, String content, 28 | Timestamp created) { 29 | this.weEffect = weEffect; 30 | this.username = username; 31 | this.content = content; 32 | this.created = created; 33 | } 34 | 35 | // Property accessors 36 | 37 | public Integer getId() { 38 | return this.id; 39 | } 40 | 41 | public void setId(Integer id) { 42 | this.id = id; 43 | } 44 | 45 | public WeEffect getWeEffect() { 46 | return this.weEffect; 47 | } 48 | 49 | public void setWeEffect(WeEffect weEffect) { 50 | this.weEffect = weEffect; 51 | } 52 | 53 | public String getUsername() { 54 | return this.username; 55 | } 56 | 57 | public void setUsername(String username) { 58 | this.username = username; 59 | } 60 | 61 | public String getContent() { 62 | return this.content; 63 | } 64 | 65 | public void setContent(String content) { 66 | this.content = content; 67 | } 68 | 69 | public Timestamp getCreated() { 70 | return this.created; 71 | } 72 | 73 | public void setCreated(Timestamp created) { 74 | this.created = created; 75 | } 76 | 77 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeEffect.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 文件编号 16 | 17 | 18 | 19 | 20 | 分类编号 21 | 22 | 23 | 24 | 25 | 分类名称 26 | 27 | 28 | 29 | 30 | 特效标题 31 | 32 | 33 | 34 | 35 | 描述/使用说明 36 | 37 | 38 | 39 | 40 | 作者 41 | 42 | 43 | 44 | 45 | 上传者 46 | 47 | 48 | 49 | 50 | 上传时间 51 | 52 | 53 | 54 | 55 | 最后修改时间 56 | 57 | 58 | 59 | 60 | 点击次数 61 | 62 | 63 | 64 | 65 | 下载次数 66 | 67 | 68 | 69 | 70 | 71 | 评论的特效 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeEffect.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | /** 8 | * WeEffect entity. @author MyEclipse Persistence Tools 9 | */ 10 | @SuppressWarnings({ "unchecked", "serial" }) 11 | public class WeEffect implements java.io.Serializable { 12 | 13 | // Fields 14 | 15 | private Integer id; 16 | private WeFile weFile; 17 | private WeFile weFileNew; 18 | private WeCategory weCategory; 19 | private String categoryName; 20 | private String title; 21 | private String description; 22 | private String author; 23 | private String username; 24 | private Timestamp created; 25 | private Timestamp updated; 26 | private Integer clickNum; 27 | private Integer downNum; 28 | private Set weComments = new HashSet(0); 29 | 30 | // Constructors 31 | 32 | /** default constructor */ 33 | public WeEffect() { 34 | } 35 | 36 | /** minimal constructor */ 37 | public WeEffect(WeFile weFile, WeCategory weCategory, String categoryName, 38 | String title, String description, String author, String username, 39 | Timestamp created, Timestamp updated, Integer clickNum, 40 | Integer downNum) { 41 | this.weFile = weFile; 42 | this.weCategory = weCategory; 43 | this.categoryName = categoryName; 44 | this.title = title; 45 | this.description = description; 46 | this.author = author; 47 | this.username = username; 48 | this.created = created; 49 | this.updated = updated; 50 | this.clickNum = clickNum; 51 | this.downNum = downNum; 52 | } 53 | 54 | /** full constructor */ 55 | public WeEffect(WeFile weFile, WeCategory weCategory, String categoryName, 56 | String title, String description, String author, String username, 57 | Timestamp created, Timestamp updated, Integer clickNum, 58 | Integer downNum, Set weComments) { 59 | this.weFile = weFile; 60 | this.weCategory = weCategory; 61 | this.categoryName = categoryName; 62 | this.title = title; 63 | this.description = description; 64 | this.author = author; 65 | this.username = username; 66 | this.created = created; 67 | this.updated = updated; 68 | this.clickNum = clickNum; 69 | this.downNum = downNum; 70 | this.weComments = weComments; 71 | } 72 | 73 | // Property accessors 74 | 75 | public Integer getId() { 76 | return this.id; 77 | } 78 | 79 | public void setId(Integer id) { 80 | this.id = id; 81 | } 82 | 83 | public WeFile getWeFile() { 84 | return this.weFile; 85 | } 86 | 87 | public void setWeFile(WeFile weFile) { 88 | this.weFile = weFile; 89 | } 90 | 91 | public WeCategory getWeCategory() { 92 | return this.weCategory; 93 | } 94 | 95 | public void setWeCategory(WeCategory weCategory) { 96 | this.weCategory = weCategory; 97 | } 98 | 99 | public String getCategoryName() { 100 | return this.categoryName; 101 | } 102 | 103 | public void setCategoryName(String categoryName) { 104 | this.categoryName = categoryName; 105 | } 106 | 107 | public String getTitle() { 108 | return this.title; 109 | } 110 | 111 | public void setTitle(String title) { 112 | this.title = title; 113 | } 114 | 115 | public String getDescription() { 116 | return this.description; 117 | } 118 | 119 | public void setDescription(String description) { 120 | this.description = description; 121 | } 122 | 123 | public String getAuthor() { 124 | return this.author; 125 | } 126 | 127 | public void setAuthor(String author) { 128 | this.author = author; 129 | } 130 | 131 | public String getUsername() { 132 | return this.username; 133 | } 134 | 135 | public void setUsername(String username) { 136 | this.username = username; 137 | } 138 | 139 | public Timestamp getCreated() { 140 | return this.created; 141 | } 142 | 143 | public void setCreated(Timestamp created) { 144 | this.created = created; 145 | } 146 | 147 | public Timestamp getUpdated() { 148 | return this.updated; 149 | } 150 | 151 | public void setUpdated(Timestamp updated) { 152 | this.updated = updated; 153 | } 154 | 155 | public Integer getClickNum() { 156 | return this.clickNum; 157 | } 158 | 159 | public void setClickNum(Integer clickNum) { 160 | this.clickNum = clickNum; 161 | } 162 | 163 | public Integer getDownNum() { 164 | return this.downNum; 165 | } 166 | 167 | public void setDownNum(Integer downNum) { 168 | this.downNum = downNum; 169 | } 170 | 171 | public Set getWeComments() { 172 | return this.weComments; 173 | } 174 | 175 | public void setWeComments(Set weComments) { 176 | this.weComments = weComments; 177 | } 178 | 179 | public WeFile getWeFileNew() { 180 | return weFileNew; 181 | } 182 | 183 | public void setWeFileNew(WeFile weFileNew) { 184 | this.weFileNew = weFileNew; 185 | } 186 | 187 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeFile.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 文件标题 18 | 19 | 20 | 21 | 22 | 文件名 23 | 24 | 25 | 26 | 27 | 扩展名 28 | 29 | 30 | 31 | 32 | 文件大小 33 | 34 | 35 | 36 | 37 | 文件存放路径 38 | 39 | 40 | 41 | 42 | 43 | 文件编号 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeFile.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.io.File; 4 | import java.io.UnsupportedEncodingException; 5 | import java.net.URLEncoder; 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | 9 | import org.apache.struts2.ServletActionContext; 10 | 11 | /** 12 | * WeFile entity. @author MyEclipse Persistence Tools 13 | */ 14 | @SuppressWarnings({ "unchecked", "serial" }) 15 | public class WeFile implements java.io.Serializable { 16 | 17 | // Fields 18 | 19 | private Integer id; 20 | private String title; 21 | private String name; 22 | private String ext; 23 | private Integer size; 24 | private String path; 25 | private Set weEffects = new HashSet(0); 26 | 27 | // Constructors 28 | 29 | /** default constructor */ 30 | public WeFile() { 31 | } 32 | 33 | /** minimal constructor */ 34 | public WeFile(String title, String name, String ext, Integer size, 35 | String path) { 36 | this.title = title; 37 | this.name = name; 38 | this.ext = ext; 39 | this.size = size; 40 | this.path = path; 41 | } 42 | 43 | /** full constructor */ 44 | public WeFile(String title, String name, String ext, Integer size, 45 | String path, Set weEffects) { 46 | this.title = title; 47 | this.name = name; 48 | this.ext = ext; 49 | this.size = size; 50 | this.path = path; 51 | this.weEffects = weEffects; 52 | } 53 | 54 | // Property accessors 55 | 56 | public Integer getId() { 57 | return this.id; 58 | } 59 | 60 | public void setId(Integer id) { 61 | this.id = id; 62 | } 63 | 64 | public String getTitle() { 65 | return this.title; 66 | } 67 | 68 | public void setTitle(String title) { 69 | this.title = title; 70 | } 71 | 72 | public String getName() { 73 | return this.name; 74 | } 75 | 76 | public void setName(String name) { 77 | this.name = name; 78 | } 79 | 80 | public String getExt() { 81 | return this.ext; 82 | } 83 | 84 | public void setExt(String ext) { 85 | this.ext = ext; 86 | } 87 | 88 | public Integer getSize() { 89 | return this.size; 90 | } 91 | 92 | public void setSize(Integer size) { 93 | this.size = size; 94 | } 95 | 96 | public String getPath() { 97 | return this.path; 98 | } 99 | 100 | public void setPath(String path) { 101 | this.path = path; 102 | } 103 | 104 | public Set getWeEffects() { 105 | return this.weEffects; 106 | } 107 | 108 | public void setWeEffects(Set weEffects) { 109 | this.weEffects = weEffects; 110 | } 111 | 112 | // custom 113 | 114 | public String getPreviewName(){ 115 | String path = ServletActionContext.getServletContext().getRealPath("preview/" + this.path + "/" + this.name); 116 | String previewName = ""; 117 | File dirFile = new File(path); 118 | if (dirFile.exists() && dirFile.isDirectory()){ 119 | File[] files = dirFile.listFiles(); 120 | for (int i = 0; i < files.length; i++) { 121 | if (files[i].isFile()) { 122 | String name = files[i].getName(); 123 | String ext = name.substring(name.lastIndexOf(".")+1).toLowerCase(); 124 | if ("".equals(previewName) && ("html".equals(ext) || "htm".equals(ext))){ 125 | previewName = name; 126 | } 127 | if ("index.html".equals(name) || "index.htm".equals(name) 128 | || "default.html".equals(name) || "default.htm".equals(name)){ 129 | previewName = name; 130 | } 131 | } 132 | } 133 | } 134 | try { 135 | return URLEncoder.encode(previewName, "ISO8859-1"); 136 | } catch (UnsupportedEncodingException e) { 137 | e.printStackTrace(); 138 | } 139 | return previewName; 140 | } 141 | 142 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeFunction.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | URI 16 | 17 | 18 | 19 | 20 | 描述 21 | 22 | 23 | 24 | 25 | 26 | 功能表编号 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeFunction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | /** 7 | * WeFunction entity. @author MyEclipse Persistence Tools 8 | */ 9 | 10 | public class WeFunction implements java.io.Serializable { 11 | 12 | // Fields 13 | 14 | private Integer id; 15 | private String uri; 16 | private String description; 17 | private Set weRoleFunctions = new HashSet(0); 18 | 19 | // Constructors 20 | 21 | /** default constructor */ 22 | public WeFunction() { 23 | } 24 | 25 | /** minimal constructor */ 26 | public WeFunction(String uri, String description) { 27 | this.uri = uri; 28 | this.description = description; 29 | } 30 | 31 | /** full constructor */ 32 | public WeFunction(String uri, String description, Set weRoleFunctions) { 33 | this.uri = uri; 34 | this.description = description; 35 | this.weRoleFunctions = weRoleFunctions; 36 | } 37 | 38 | // Property accessors 39 | 40 | public Integer getId() { 41 | return this.id; 42 | } 43 | 44 | public void setId(Integer id) { 45 | this.id = id; 46 | } 47 | 48 | public String getUri() { 49 | return this.uri; 50 | } 51 | 52 | public void setUri(String uri) { 53 | this.uri = uri; 54 | } 55 | 56 | public String getDescription() { 57 | return this.description; 58 | } 59 | 60 | public void setDescription(String description) { 61 | this.description = description; 62 | } 63 | 64 | public Set getWeRoleFunctions() { 65 | return this.weRoleFunctions; 66 | } 67 | 68 | public void setWeRoleFunctions(Set weRoleFunctions) { 69 | this.weRoleFunctions = weRoleFunctions; 70 | } 71 | 72 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeRole.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 名称 16 | 17 | 18 | 19 | 20 | 21 | 角色编号 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeRole.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | /** 7 | * WeRole entity. @author MyEclipse Persistence Tools 8 | */ 9 | 10 | public class WeRole implements java.io.Serializable { 11 | 12 | // Fields 13 | 14 | private Integer id; 15 | private String name; 16 | private Set weRoleFunctions = new HashSet(0); 17 | 18 | // Constructors 19 | 20 | /** default constructor */ 21 | public WeRole() { 22 | } 23 | 24 | /** minimal constructor */ 25 | public WeRole(String name) { 26 | this.name = name; 27 | } 28 | 29 | /** full constructor */ 30 | public WeRole(String name, Set weRoleFunctions) { 31 | this.name = name; 32 | this.weRoleFunctions = weRoleFunctions; 33 | } 34 | 35 | // Property accessors 36 | 37 | public Integer getId() { 38 | return this.id; 39 | } 40 | 41 | public void setId(Integer id) { 42 | this.id = id; 43 | } 44 | 45 | public String getName() { 46 | return this.name; 47 | } 48 | 49 | public void setName(String name) { 50 | this.name = name; 51 | } 52 | 53 | public Set getWeRoleFunctions() { 54 | return this.weRoleFunctions; 55 | } 56 | 57 | public void setWeRoleFunctions(Set weRoleFunctions) { 58 | this.weRoleFunctions = weRoleFunctions; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeRoleFunction.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeRoleFunction.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | /** 4 | * WeRoleFunction entity. @author MyEclipse Persistence Tools 5 | */ 6 | 7 | public class WeRoleFunction implements java.io.Serializable { 8 | 9 | // Fields 10 | 11 | private WeRoleFunctionId id; 12 | 13 | // Constructors 14 | 15 | /** default constructor */ 16 | public WeRoleFunction() { 17 | } 18 | 19 | /** full constructor */ 20 | public WeRoleFunction(WeRoleFunctionId id) { 21 | this.id = id; 22 | } 23 | 24 | // Property accessors 25 | 26 | public WeRoleFunctionId getId() { 27 | return this.id; 28 | } 29 | 30 | public void setId(WeRoleFunctionId id) { 31 | this.id = id; 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeRoleFunctionId.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | /** 4 | * WeRoleFunctionId entity. @author MyEclipse Persistence Tools 5 | */ 6 | 7 | public class WeRoleFunctionId implements java.io.Serializable { 8 | 9 | // Fields 10 | 11 | private WeRole weRole; 12 | private WeFunction weFunction; 13 | 14 | // Constructors 15 | 16 | /** default constructor */ 17 | public WeRoleFunctionId() { 18 | } 19 | 20 | /** full constructor */ 21 | public WeRoleFunctionId(WeRole weRole, WeFunction weFunction) { 22 | this.weRole = weRole; 23 | this.weFunction = weFunction; 24 | } 25 | 26 | // Property accessors 27 | 28 | public WeRole getWeRole() { 29 | return this.weRole; 30 | } 31 | 32 | public void setWeRole(WeRole weRole) { 33 | this.weRole = weRole; 34 | } 35 | 36 | public WeFunction getWeFunction() { 37 | return this.weFunction; 38 | } 39 | 40 | public void setWeFunction(WeFunction weFunction) { 41 | this.weFunction = weFunction; 42 | } 43 | 44 | public boolean equals(Object other) { 45 | if ((this == other)) 46 | return true; 47 | if ((other == null)) 48 | return false; 49 | if (!(other instanceof WeRoleFunctionId)) 50 | return false; 51 | WeRoleFunctionId castOther = (WeRoleFunctionId) other; 52 | 53 | return ((this.getWeRole() == castOther.getWeRole()) || (this 54 | .getWeRole() != null 55 | && castOther.getWeRole() != null && this.getWeRole().equals( 56 | castOther.getWeRole()))) 57 | && ((this.getWeFunction() == castOther.getWeFunction()) || (this 58 | .getWeFunction() != null 59 | && castOther.getWeFunction() != null && this 60 | .getWeFunction().equals(castOther.getWeFunction()))); 61 | } 62 | 63 | public int hashCode() { 64 | int result = 17; 65 | 66 | result = 37 * result 67 | + (getWeRole() == null ? 0 : this.getWeRole().hashCode()); 68 | result = 37 69 | * result 70 | + (getWeFunction() == null ? 0 : this.getWeFunction() 71 | .hashCode()); 72 | return result; 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeUser.hbm.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 用户名 18 | 19 | 20 | 21 | 22 | 密码 23 | 24 | 25 | 26 | 27 | 昵称 28 | 29 | 30 | 31 | 32 | 描述 33 | 34 | 35 | 36 | 37 | 角色 38 | 39 | 40 | 41 | 42 | 登陆次数 43 | 44 | 45 | 46 | 47 | 登陆时间 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/model/WeUser.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.model; 2 | 3 | import java.sql.Timestamp; 4 | 5 | import com.thinkgem.webeffect.util.Utils; 6 | 7 | /** 8 | * WeUser entity. @author MyEclipse Persistence Tools 9 | */ 10 | @SuppressWarnings({"serial" }) 11 | public class WeUser implements java.io.Serializable { 12 | 13 | // Fields 14 | 15 | private Integer id; 16 | private String username; 17 | private String password; 18 | private String passwordNew; 19 | private String passwordNew2; 20 | private String nickname; 21 | private String description; 22 | private Integer role; 23 | private Integer loginNum; 24 | private Timestamp loginTime; 25 | 26 | // Constructors 27 | 28 | /** default constructor */ 29 | public WeUser() { 30 | } 31 | 32 | /** minimal constructor */ 33 | public WeUser(String username, String password, String nickname, 34 | Integer role, Integer loginNum, Timestamp loginTime) { 35 | this.username = username; 36 | this.password = password; 37 | this.nickname = nickname; 38 | this.role = role; 39 | this.loginNum = loginNum; 40 | this.loginTime = loginTime; 41 | } 42 | 43 | /** full constructor */ 44 | public WeUser(String username, String password, String nickname, 45 | String description, Integer role, Integer loginNum, 46 | Timestamp loginTime) { 47 | this.username = username; 48 | this.password = password; 49 | this.nickname = nickname; 50 | this.description = description; 51 | this.role = role; 52 | this.loginNum = loginNum; 53 | this.loginTime = loginTime; 54 | } 55 | 56 | // Property accessors 57 | 58 | public Integer getId() { 59 | return this.id; 60 | } 61 | 62 | public void setId(Integer id) { 63 | this.id = id; 64 | } 65 | 66 | public String getUsername() { 67 | return this.username; 68 | } 69 | 70 | public void setUsername(String username) { 71 | this.username = username; 72 | } 73 | 74 | public String getPassword() { 75 | return this.password; 76 | } 77 | 78 | public void setPassword(String password) { 79 | this.password = password; 80 | } 81 | 82 | public String getNickname() { 83 | return this.nickname; 84 | } 85 | 86 | public void setNickname(String nickname) { 87 | this.nickname = nickname; 88 | } 89 | 90 | public String getDescription() { 91 | return this.description; 92 | } 93 | 94 | public void setDescription(String description) { 95 | this.description = description; 96 | } 97 | 98 | public Integer getRole() { 99 | return this.role; 100 | } 101 | 102 | public void setRole(Integer role) { 103 | this.role = role; 104 | } 105 | 106 | public Integer getLoginNum() { 107 | return this.loginNum; 108 | } 109 | 110 | public void setLoginNum(Integer loginNum) { 111 | this.loginNum = loginNum; 112 | } 113 | 114 | public Timestamp getLoginTime() { 115 | return this.loginTime; 116 | } 117 | 118 | public void setLoginTime(Timestamp loginTime) { 119 | this.loginTime = loginTime; 120 | } 121 | 122 | // formatted 123 | 124 | public String getRoleFormatted(){ 125 | String str = ""; 126 | switch(this.role.intValue()){ 127 | case 1: 128 | str = "系统管理员"; 129 | break; 130 | case 2: 131 | str = "普通用户"; 132 | break; 133 | // case 3: 134 | // str = "普通用户"; 135 | default: 136 | str = "未知"; 137 | } 138 | return str; 139 | } 140 | 141 | public String getLoginTimeFormatted(){ 142 | return Utils.dataFormat(this.getLoginTime(), "yyyy-MM-dd"); 143 | } 144 | 145 | public String getPasswordNew() { 146 | return passwordNew; 147 | } 148 | 149 | public void setPasswordNew(String passwordNew) { 150 | this.passwordNew = passwordNew; 151 | } 152 | 153 | public String getPasswordNew2() { 154 | return passwordNew2; 155 | } 156 | 157 | public void setPasswordNew2(String passwordNew2) { 158 | this.passwordNew2 = passwordNew2; 159 | } 160 | 161 | 162 | } -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/service/CategoryService.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.service; 2 | 3 | import java.util.List; 4 | 5 | import com.thinkgem.webeffect.model.WeCategory; 6 | 7 | /** 8 | * 特效分类服务接口 9 | * @author WangZhen 10 | * @version $Id$ 11 | */ 12 | public interface CategoryService { 13 | 14 | /** 15 | * 获得分类对象 16 | * @param id 17 | * @return 18 | */ 19 | WeCategory get(int id); 20 | 21 | /** 22 | * 保存或更新分类对象 23 | * @param effect 24 | */ 25 | void saveOrUpdate(WeCategory category); 26 | 27 | /** 28 | * 保存或更新全部分类对象 29 | * @param effect 30 | */ 31 | void saveOrUpdateAll(List categoryList); 32 | 33 | /** 34 | * 通过分类编号删除 35 | * @param id 分类编号 36 | */ 37 | void delete(int id); 38 | 39 | /** 40 | * 获得特效列表,排序:权重降序 41 | * @return 42 | */ 43 | List list(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/service/EffectService.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.service; 2 | 3 | import java.util.List; 4 | 5 | import com.thinkgem.webeffect.hibernate.Pagination; 6 | import com.thinkgem.webeffect.model.WeComment; 7 | import com.thinkgem.webeffect.model.WeEffect; 8 | import com.thinkgem.webeffect.model.WeFile; 9 | 10 | /** 11 | * 特效服务接口 12 | * @author WangZhen 13 | * @version $Id$ 14 | */ 15 | public interface EffectService { 16 | 17 | /** 18 | * 获得特效对象 19 | * @param id 20 | * @return 21 | */ 22 | WeEffect get(int id); 23 | 24 | /** 25 | * 保存或更新特效对象 26 | * @param effect 27 | */ 28 | void saveOrUpdate(WeEffect effect); 29 | 30 | /** 31 | * 获得特效列表 32 | * @param categoryId 分类编号,若为0则查询全部分类 33 | * @param pageIndex 当前页 34 | * @param pageSize 页面大小 35 | * @param query 查询字符串 36 | * @return 页码对象 37 | */ 38 | Pagination list(int categoryId, int pageIndex, int pageSize, String query); 39 | 40 | /** 41 | * 获得特效最热门点击的特效 42 | * @param categoryId 获得的分类编号,若为0则查询全部分类 43 | * @param top 获得数量 44 | * @return 特效列表 45 | */ 46 | List topClickList(int categoryId, int top); 47 | 48 | /** 49 | * 获得特效最热门下载的特效 50 | * @param categoryId 获得的分类编号,若为0则查询全部分类 51 | * @param top 获得数量 52 | * @return 特效列表 53 | */ 54 | List topDownList(int categoryId, int top); 55 | 56 | 57 | /** 58 | * 获得特效文件 59 | * @param id 60 | * @return 61 | */ 62 | WeFile getFile(int id); 63 | 64 | /** 65 | * 保存特效文件 66 | * @param file 67 | */ 68 | void saveFile(WeFile file); 69 | 70 | /** 71 | * 删除特效信息及特效文件 72 | * @param id 特效编号 73 | */ 74 | boolean delete(int id); 75 | 76 | /** 77 | * 检查用户名是否存在 78 | * @param name 文件名 HASH 值 79 | * @return true: 存在 80 | */ 81 | boolean fileExists(String name); 82 | 83 | /** 84 | * 单击次数加1 85 | * @param id 特效编号 86 | */ 87 | void clickNumAdd(int id); 88 | 89 | /** 90 | * 下载次数加1 91 | * @param id 特效编号 92 | */ 93 | void downNumAdd(int fileId); 94 | 95 | /** 96 | * 评论列表 97 | * @param effectId 特效编号 98 | * @param pageIndex 当前页 99 | * @param pageSize 页面大小 100 | * @return 评论列表页面对象 101 | */ 102 | Pagination commentList(int effectId, int pageIndex, int pageSize); 103 | 104 | /** 105 | * 保存评论列表 106 | * @param comment 107 | */ 108 | void saveComment(WeComment comment); 109 | 110 | /** 111 | * 删除评论内容 112 | * @param commentId 113 | */ 114 | void deleteComment(int commentId); 115 | 116 | /** 117 | * 获得昵称 118 | * @param username 用户名 119 | * @return 120 | */ 121 | String getNickName(String username); 122 | } 123 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.service; 2 | 3 | import com.thinkgem.webeffect.hibernate.Pagination; 4 | import com.thinkgem.webeffect.model.WeUser; 5 | 6 | /** 7 | * 特效用户服务接口 8 | * @author WangZhen 9 | * @version $Id$ 10 | */ 11 | public interface UserService { 12 | 13 | /** 14 | * 通过编号获得用户对象信息 15 | * @param id 用户编号 16 | * @return 17 | */ 18 | WeUser getById(int id); 19 | 20 | /** 21 | * 登陆验证 22 | * @param username 用户名 23 | * @param password 密码 24 | * @return 登陆成功返回用户的对象,失败返回空 25 | */ 26 | WeUser login(String username, String password); 27 | 28 | /** 29 | * 保存新用户对象 30 | * @param user 用户对象 31 | */ 32 | void save(WeUser user); 33 | 34 | /** 35 | * 更新用户对象 36 | * @param user 用户对象 37 | */ 38 | void update(WeUser user); 39 | 40 | /** 41 | * 删除用户 42 | * @param id 用户编号 43 | */ 44 | void delete(int id); 45 | 46 | /** 47 | * 获得用户列表 48 | * @param pageIndex 当前页 49 | * @param pageSize 页面大小 50 | * @return 页码对象 51 | */ 52 | Pagination list(int pageIndex, int pageSize); 53 | 54 | /** 55 | * 检查用户名是否存在 56 | * @param username 用户名 57 | * @return true: 存在 58 | */ 59 | boolean usernameExists(String username); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/service/impl/CategoryServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.service.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.criterion.Order; 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | import org.springframework.transaction.annotation.Transactional; 9 | 10 | import com.thinkgem.webeffect.dao.WeCategoryDao; 11 | import com.thinkgem.webeffect.dao.WeEffectDao; 12 | import com.thinkgem.webeffect.model.WeCategory; 13 | import com.thinkgem.webeffect.service.CategoryService; 14 | 15 | /** 16 | * 特效分类服务 17 | * @author WangZhen 18 | * @version $Id$ 19 | */ 20 | @Service 21 | @Transactional 22 | public class CategoryServiceImpl implements CategoryService { 23 | 24 | @Autowired 25 | private WeCategoryDao categoryDao; 26 | @Autowired 27 | private WeEffectDao effectDao; 28 | 29 | @Transactional(readOnly=true) 30 | public WeCategory get(int id) { 31 | return categoryDao.get(id); 32 | } 33 | 34 | @Transactional(readOnly=true) 35 | public List list() { 36 | return categoryDao.findAll(Order.desc("weight"),Order.asc("id")); 37 | } 38 | 39 | public void saveOrUpdate(WeCategory category) { 40 | categoryDao.saveOrUpdate(category); 41 | } 42 | 43 | public void delete(int id) { 44 | categoryDao.deleteById(id); 45 | } 46 | 47 | public void saveOrUpdateAll(List categoryList) { 48 | categoryDao.saveOrUpdateAll(categoryList); 49 | //更新关联表 50 | for(int i=0; i 27 | * @version $Id$ 28 | */ 29 | @Service 30 | @Transactional 31 | public class EffectServiceImpl implements com.thinkgem.webeffect.service.EffectService { 32 | 33 | @Autowired 34 | private WeEffectDao effectDao; 35 | @Autowired 36 | private WeFileDao fileDao; 37 | @Autowired 38 | private WeCommentDao commentDao; 39 | @Autowired 40 | private WeUserDao userDao; 41 | 42 | 43 | @Transactional(readOnly=true) 44 | public WeEffect get(int id) { 45 | return effectDao.get(id); 46 | } 47 | 48 | public void saveOrUpdate(WeEffect effect) { 49 | //判断是否修改了文件 50 | if (effect.getWeFileNew()!=null){ 51 | if (effect.getWeFileNew().getId() != null && effect.getWeFileNew().getId().intValue() > 0){ 52 | //获得旧文件编号 53 | Integer fileId = effect.getWeFile().getId(); 54 | //设置新文件 55 | effect.setWeFile(effect.getWeFileNew()); 56 | //保存更新特效 57 | effectDao.saveOrUpdate(effect); 58 | //删除旧文件 59 | deleteFile(fileId); 60 | } 61 | }else{ 62 | effectDao.saveOrUpdate(effect); 63 | } 64 | } 65 | 66 | @Transactional(readOnly=true) 67 | public Pagination list(int categoryId, int pageIndex, int pageSize, String query) { 68 | DetachedCriteria dc = effectDao.createDetachedCriteria(); 69 | if (categoryId > 0){ 70 | dc.add(Restrictions.eq("weCategory.id", (Integer)categoryId)); 71 | } 72 | if (query != null && !"".equals(query)){ 73 | dc.add(Restrictions.or(Restrictions.like("title", "%"+query+"%"),Restrictions.like("author", "%"+query+"%"))); 74 | } 75 | dc.addOrder(Order.desc("updated")); 76 | return effectDao.findByCriteriaP(dc, pageIndex, pageSize); 77 | } 78 | 79 | @Transactional(readOnly=true) 80 | @SuppressWarnings("unchecked") 81 | public List topClickList(int categoryId, int top) { 82 | DetachedCriteria dc = effectDao.createDetachedCriteria(); 83 | if (categoryId > 0){ 84 | dc.add(Restrictions.eq("weCategory.id", (Integer)categoryId)); 85 | } 86 | dc.addOrder(Order.desc("clickNum")); 87 | return effectDao.findByCriteria(dc, 1, top); 88 | } 89 | 90 | @Transactional(readOnly=true) 91 | @SuppressWarnings("unchecked") 92 | public List topDownList(int categoryId, int top) { 93 | DetachedCriteria dc = effectDao.createDetachedCriteria(); 94 | if (categoryId > 0){ 95 | dc.add(Restrictions.eq("weCategory.id", (Integer)categoryId)); 96 | } 97 | dc.addOrder(Order.desc("downNum")); 98 | return effectDao.findByCriteria(dc, 1, top); 99 | } 100 | 101 | @Transactional(readOnly=true) 102 | public WeFile getFile(int id){ 103 | return fileDao.get((Integer)id); 104 | } 105 | 106 | public void saveFile(WeFile file){ 107 | fileDao.save(file); 108 | } 109 | 110 | public boolean delete(int id) { 111 | WeEffect e = effectDao.get(id); 112 | Integer fileId = e.getWeFile().getId(); 113 | commentDao.update("delete from WeComment where weEffect.id=?", (Integer)id); 114 | effectDao.delete(e); 115 | return deleteFile(fileId); 116 | } 117 | 118 | public boolean deleteFile(int id){ 119 | WeFile f = fileDao.get((Integer)id); 120 | //从资源文件中删除 121 | String uploads = ServletActionContext.getServletContext().getRealPath("uploads/" + f.getPath() + "/" + f.getName() + "." + f.getExt()); 122 | String preview = ServletActionContext.getServletContext().getRealPath("preview/" + f.getPath() + "/" + f.getName()); 123 | if (FileOperateUtils.delFile(uploads) && FileOperateUtils.delFile(preview)){ 124 | //从数据库中删除 125 | fileDao.delete(f); 126 | return true; 127 | } 128 | return false; 129 | } 130 | 131 | @Transactional(readOnly=true) 132 | public boolean fileExists(String name) { 133 | return fileDao.count("name", name) > 0; 134 | } 135 | 136 | public void clickNumAdd(int id) { 137 | effectDao.update("update WeEffect set clickNum=clickNum+1 where id=?", (Integer)id); 138 | } 139 | 140 | public void downNumAdd(int fileId) { 141 | effectDao.update("update WeEffect set downNum=downNum+1 where weFile.id=?", (Integer)fileId); 142 | } 143 | 144 | public Pagination commentList(int effectId, int pageIndex, int pageSize) { 145 | DetachedCriteria dc = commentDao.createDetachedCriteria(); 146 | if (effectId > 0){ 147 | dc.add(Restrictions.eq("weEffect.id", (Integer)effectId)); 148 | } 149 | dc.addOrder(Order.asc("id")); 150 | return commentDao.findByCriteriaP(dc, pageIndex, pageSize); 151 | } 152 | 153 | public void deleteComment(int commentId) { 154 | commentDao.deleteById(commentId); 155 | } 156 | 157 | public void saveComment(WeComment comment) { 158 | commentDao.save(comment); 159 | } 160 | 161 | public String getNickName(String username) { 162 | WeUser user = userDao.get("username", username); 163 | return user == null ? "" : user.getNickname(); 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.service.impl; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.apache.struts2.ServletActionContext; 8 | import org.hibernate.criterion.Restrictions; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.thinkgem.webeffect.dao.WeUserDao; 14 | import com.thinkgem.webeffect.hibernate.Pagination; 15 | import com.thinkgem.webeffect.model.WeUser; 16 | import com.thinkgem.webeffect.service.UserService; 17 | import com.thinkgem.webeffect.util.Encrypt; 18 | 19 | /** 20 | * 特效用户服务 21 | * @author WangZhen 22 | * @version $Id$ 23 | */ 24 | @Service 25 | @Transactional 26 | public class UserServiceImpl implements UserService { 27 | 28 | @Autowired 29 | private WeUserDao userDao; 30 | 31 | @Transactional(readOnly=true) 32 | public WeUser getById(int id){ 33 | return userDao.get((Integer)id); 34 | } 35 | 36 | @Transactional(readOnly=true) 37 | public Pagination list(int pageIndex, int pageSize) { 38 | return userDao.findAllP(pageIndex, pageSize); 39 | } 40 | 41 | @SuppressWarnings("unchecked") 42 | public WeUser login(String username, String password) { 43 | password = Encrypt.md5(Encrypt.sha(password)); 44 | List list = userDao.findByCriteria( 45 | userDao.createDetachedCriteria( 46 | Restrictions.eq("username", username), 47 | Restrictions.eq("password", password) 48 | ),1,1); 49 | if(list.size() > 0){ 50 | WeUser user = list.get(0); 51 | user.setLoginNum(user.getLoginNum()==null?1:user.getLoginNum()+1); 52 | user.setLoginTime(new Timestamp(new Date().getTime())); 53 | userDao.update("update WeUser set loginNum=?, loginTime=? where id=?", 54 | new Object[]{user.getLoginNum(), user.getLoginTime(), user.getId()}); 55 | return list.get(0); 56 | } 57 | return null; 58 | } 59 | 60 | public void save(WeUser user) { 61 | user.setPassword(Encrypt.md5(Encrypt.sha(user.getPassword()))); 62 | if(user.getLoginNum()==null||user.getLoginNum().intValue()==0){ 63 | user.setLoginNum(1); 64 | } 65 | if(user.getLoginTime()==null){ 66 | user.setLoginTime(new Timestamp(new Date().getTime())); 67 | } 68 | userDao.save(user); 69 | } 70 | 71 | public void update(WeUser user) { 72 | userDao.update(user); 73 | } 74 | 75 | @Transactional(readOnly=true) 76 | public boolean usernameExists(String username) { 77 | Object user = ServletActionContext.getRequest().getSession().getAttribute("user"); 78 | //如果已登录,则排除当前登录用户 79 | if (user!=null){ 80 | return userDao.count(userDao.createDetachedCriteria( 81 | Restrictions.not(Restrictions.eq("username",((WeUser)user).getUsername())), 82 | Restrictions.eq("username", username))) > 0; 83 | }else{ 84 | return userDao.count("username", username) > 0; 85 | } 86 | } 87 | 88 | public void delete(int id) { 89 | userDao.deleteById((Integer)id); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/util/Encrypt.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.util; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.InputStream; 5 | import java.security.MessageDigest; 6 | 7 | /** 8 | * 加密解密 9 | * @author WangZhen 10 | * @version $Id: Encrypt.java 2500 2010-05-21 20:35:46Z wzhen $ 11 | */ 12 | public abstract class Encrypt { 13 | 14 | private static String digest(String s, String a) { 15 | try { 16 | MessageDigest md = MessageDigest.getInstance(a); 17 | md.update(s.getBytes()); 18 | byte[] bytes = md.digest(); 19 | String hax = ""; 20 | for (int i = 0; i < bytes.length; i++) { 21 | hax += Integer 22 | .toHexString((0x000000ff & bytes[i]) | 0xffffff00) 23 | .substring(6); 24 | } 25 | return hax; 26 | } catch (Exception e) { 27 | e.printStackTrace(); 28 | return ""; 29 | } 30 | } 31 | 32 | public static String md5(String s) { 33 | return digest(s, "MD5"); 34 | } 35 | 36 | public static String sha(String s) { 37 | return digest(s, "SHA"); 38 | } 39 | 40 | /** 41 | * 返回文件的md5值 42 | * 43 | * @param filePath 44 | * 文件的全路径 45 | * @return 文件md5值 46 | */ 47 | public static String fileMd5(String filePath) throws Exception { 48 | String hashType = "MD5"; 49 | return getHash(filePath, hashType); 50 | } 51 | 52 | public static char[] hexChar = { '0', '1', '2', '3', '4', '5', '6', '7', 53 | '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; 54 | 55 | public static String getHash(String fileName, String hashType) 56 | throws Exception { 57 | InputStream fis; 58 | fis = new FileInputStream(fileName); 59 | byte[] buffer = new byte[1024]; 60 | MessageDigest md5 = MessageDigest.getInstance(hashType); 61 | int numRead = 0; 62 | while ((numRead = fis.read(buffer)) > 0) { 63 | md5.update(buffer, 0, numRead); 64 | } 65 | fis.close(); 66 | return toHexString(md5.digest()); 67 | 68 | } 69 | 70 | public static String toHexString(byte[] b) { 71 | StringBuilder sb = new StringBuilder(b.length * 2); 72 | for (int i = 0; i < b.length; i++) { 73 | sb.append(hexChar[(b[i] & 0xf0) >>> 4]); 74 | sb.append(hexChar[b[i] & 0x0f]); 75 | } 76 | return sb.toString(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/util/FileUtils.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.util; 2 | 3 | import java.io.BufferedInputStream; 4 | import java.io.BufferedOutputStream; 5 | import java.io.File; 6 | import java.io.FileInputStream; 7 | import java.io.FileOutputStream; 8 | import java.util.Enumeration; 9 | 10 | import org.apache.tools.zip.ZipEntry; 11 | import org.apache.tools.zip.ZipFile; 12 | import org.apache.tools.zip.ZipOutputStream; 13 | 14 | public class FileUtils { 15 | 16 | static final int BUFFER = 2048; 17 | 18 | /** 19 | * 获得文件扩展名 20 | * @param filename 文件名 21 | * @return 扩展名 22 | */ 23 | public static String getExtension(String filename){ 24 | return filename.substring(filename.lastIndexOf(".")+1).toLowerCase(); 25 | } 26 | 27 | /** 28 | * 压缩文件 29 | * @param path 压缩的路径 30 | */ 31 | public static void zip(String filePath, String fileName) { 32 | try { 33 | BufferedInputStream origin = null; 34 | FileOutputStream dest = new FileOutputStream(fileName); 35 | ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream( 36 | dest)); 37 | byte data[] = new byte[BUFFER]; 38 | File f = new File(filePath); 39 | File files[] = f.listFiles(); 40 | 41 | for (int i = 0; i < files.length; i++) { 42 | FileInputStream fi = new FileInputStream(files[i]); 43 | origin = new BufferedInputStream(fi, BUFFER); 44 | ZipEntry entry = new ZipEntry(files[i].getName()); 45 | out.putNextEntry(entry); 46 | int count; 47 | while ((count = origin.read(data, 0, BUFFER)) != -1) { 48 | out.write(data, 0, count); 49 | } 50 | origin.close(); 51 | } 52 | out.close(); 53 | } catch (Exception e) { 54 | e.printStackTrace(); 55 | } 56 | } 57 | 58 | /** 59 | * 解压文件 60 | * @param fileName 需解压的文件 61 | * @param filePath 解压的目标路径 62 | */ 63 | @SuppressWarnings("unchecked") 64 | public static void unZip(String fileName, String filePath) { 65 | try { 66 | ZipFile zipFile = new ZipFile(fileName); 67 | Enumeration emu = zipFile.getEntries(); 68 | while(emu.hasMoreElements()){ 69 | ZipEntry entry = (ZipEntry)emu.nextElement(); 70 | //会把目录作为一个file读出一次,所以只建立目录就可以,之下的文件还会被迭代到。 71 | if (entry.isDirectory()){ 72 | new File(filePath + "/" + entry.getName()).mkdirs(); 73 | continue; 74 | } 75 | BufferedInputStream bis = new BufferedInputStream(zipFile.getInputStream(entry)); 76 | File file = new File(filePath + "/" + entry.getName()); 77 | //加入这个的原因是zipfile读取文件是随机读取的,这就造成可能先读取一个文件 78 | //而这个文件所在的目录还没有出现过,所以要建出目录来。 79 | File parent = file.getParentFile(); 80 | if(parent != null && (!parent.exists())){ 81 | parent.mkdirs(); 82 | } 83 | FileOutputStream fos = new FileOutputStream(file); 84 | BufferedOutputStream bos = new BufferedOutputStream(fos,BUFFER); 85 | 86 | int count; 87 | byte data[] = new byte[BUFFER]; 88 | while ((count = bis.read(data, 0, BUFFER)) != -1){ 89 | bos.write(data, 0, count); 90 | } 91 | bos.flush(); 92 | bos.close(); 93 | bis.close(); 94 | } 95 | zipFile.close(); 96 | } catch (Exception e) { 97 | e.printStackTrace(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /src/java/com/thinkgem/webeffect/util/RequestUtils.java: -------------------------------------------------------------------------------- 1 | package com.thinkgem.webeffect.util; 2 | 3 | import java.io.UnsupportedEncodingException; 4 | import java.net.URLDecoder; 5 | import java.util.Enumeration; 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | import java.util.StringTokenizer; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | import org.apache.commons.lang.StringUtils; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | import com.thinkgem.webeffect.util.RequestUtils; 17 | 18 | /** 19 | * HttpServletRequest帮助类 20 | */ 21 | public class RequestUtils { 22 | private static final Logger log = LoggerFactory 23 | .getLogger(RequestUtils.class); 24 | 25 | /** 26 | * 获取QueryString的参数,并使用URLDecoder以UTF-8格式转码。 27 | * 28 | * @param request 29 | * web请求 30 | * @param name 31 | * 参数名称 32 | * @return 33 | */ 34 | public static String getQueryParam(HttpServletRequest request, String name, 35 | String encoding) { 36 | String s = request.getQueryString(); 37 | if (StringUtils.isBlank(s)) { 38 | return null; 39 | } 40 | try { 41 | s = URLDecoder.decode(s, encoding); 42 | } catch (UnsupportedEncodingException e) { 43 | log.error("encoding " + encoding + " not support.", e); 44 | } 45 | if (StringUtils.isBlank(s)) { 46 | return null; 47 | } 48 | String[] values = parseQueryString(s).get(name); 49 | if (values != null && values.length > 0) { 50 | return values[values.length - 1]; 51 | } else { 52 | return null; 53 | } 54 | } 55 | 56 | /** 57 | * 58 | * Parses a query string passed from the client to the server and builds a 59 | * HashTable object with key-value pairs. The query string 60 | * should be in the form of a string packaged by the GET or POST method, 61 | * that is, it should have key-value pairs in the form key=value, 62 | * with each pair separated from the next by a & character. 63 | * 64 | *

65 | * A key can appear more than once in the query string with different 66 | * values. However, the key appears only once in the hashtable, with its 67 | * value being an array of strings containing the multiple values sent by 68 | * the query string. 69 | * 70 | *

71 | * The keys and values in the hashtable are stored in their decoded form, so 72 | * any + characters are converted to spaces, and characters sent in 73 | * hexadecimal notation (like %xx) are converted to ASCII characters. 74 | * 75 | * @param s 76 | * a string containing the query to be parsed 77 | * 78 | * @return a HashTable object built from the parsed key-value 79 | * pairs 80 | * 81 | * @exception IllegalArgumentException 82 | * if the query string is invalid 83 | * 84 | */ 85 | public static Map parseQueryString(String s) { 86 | String valArray[] = null; 87 | if (s == null) { 88 | throw new IllegalArgumentException(); 89 | } 90 | Map ht = new HashMap(); 91 | StringTokenizer st = new StringTokenizer(s, "&"); 92 | while (st.hasMoreTokens()) { 93 | String pair = (String) st.nextToken(); 94 | int pos = pair.indexOf('='); 95 | if (pos == -1) { 96 | continue; 97 | } 98 | String key = pair.substring(0, pos); 99 | String val = pair.substring(pos + 1, pair.length()); 100 | if (ht.containsKey(key)) { 101 | String oldVals[] = (String[]) ht.get(key); 102 | valArray = new String[oldVals.length + 1]; 103 | for (int i = 0; i < oldVals.length; i++) 104 | valArray[i] = oldVals[i]; 105 | valArray[oldVals.length] = val; 106 | } else { 107 | valArray = new String[1]; 108 | valArray[0] = val; 109 | } 110 | ht.put(key, valArray); 111 | } 112 | return ht; 113 | } 114 | 115 | @SuppressWarnings("unchecked") 116 | public static Map getRequestMap(HttpServletRequest request, 117 | String prefix) { 118 | Map map = new HashMap(); 119 | Enumeration names = request.getParameterNames(); 120 | String name; 121 | while (names.hasMoreElements()) { 122 | name = names.nextElement(); 123 | if (name.startsWith(prefix)) { 124 | request.getParameterValues(name); 125 | map.put(name.substring(prefix.length()), StringUtils.join( 126 | request.getParameterValues(name), ',')); 127 | } 128 | } 129 | return map; 130 | } 131 | 132 | /** 133 | * 获取访问者IP 134 | * 135 | * 在一般情况下使用Request.getRemoteAddr()即可,但是经过nginx等反向代理软件后,这个方法会失效。 136 | * 137 | * 本方法先从Header中获取X-Real-IP,如果不存在再从X-Forwarded-For获得第一个IP(用,分割), 138 | * 如果还不存在则调用Request .getRemoteAddr()。 139 | * 140 | * @param request 141 | * @return 142 | */ 143 | public static String getIpAddr(HttpServletRequest request) { 144 | String ip = request.getHeader("X-Real-IP"); 145 | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { 146 | ip = request.getHeader("X-Forwarded-For"); 147 | } else { 148 | return ip; 149 | } 150 | if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) { 151 | ip = request.getRemoteAddr(); 152 | } else { 153 | // 多次反向代理后会有多个IP值,第一个为真实IP。 154 | int index = ip.indexOf(','); 155 | if (index != -1) { 156 | ip = ip.substring(0, index); 157 | } 158 | } 159 | return ip; 160 | } 161 | 162 | /** 163 | * 获得当的访问路径 164 | * 165 | * HttpServletRequest.getRequestURL+"?"+HttpServletRequest.getQueryString 166 | * 167 | * @param request 168 | * @return 169 | */ 170 | public static String getLocation(HttpServletRequest request) { 171 | StringBuffer sb = request.getRequestURL(); 172 | if (request.getQueryString() != null) { 173 | sb.append("?").append(request.getQueryString()); 174 | } 175 | return sb.toString(); 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /web/403.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 禁止访问 6 | 7 | 8 | 对不起,您没有权限访问该页面。 9 | 10 | -------------------------------------------------------------------------------- /web/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 找不到页面 6 | 7 | 8 | 对不起,您所访问的页面不存在。
9 | 请检查您的访问地址是否正确。 10 | 11 | -------------------------------------------------------------------------------- /web/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 内部错误 6 | 7 | 8 | 页面发生错误,请与管理员联系! 9 | 10 | -------------------------------------------------------------------------------- /web/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /web/WEB-INF/ftl_lib/common.ftl: -------------------------------------------------------------------------------- 1 | <#-- 2 | 主导航栏 3 | --> 4 | <#macro navigation> 5 | <#-- 获得请求URI中的模块名,结果变量 rm --> 6 | <#assign r = request.getRequestURI() /> 7 | <#assign r = r?replace(base,"") /> 8 | <#assign ri = r?index_of("/",2)-1 /> 9 | <#if ri gt 1> 10 | <#assign rm = r[1..ri] /> 11 | <#else> 12 | <#assign rm = "effect" /> 13 | 14 | <#-- 设置导航列表 --> 15 | <#if Session?exists && Session.user?exists && Session.user.role==1> 16 | <#assign navs={ 17 | "特效首页":"/effect/index.jspx", 18 | "系统设置":"/setting/user/index.jspx", 19 | "个人中心":"/center/changeInfo.jspx" 20 | } /> 21 | <#else> 22 | <#assign navs={ 23 | "特效首页":"/effect/index.jspx", 24 | "个人中心":"/center/changeInfo.jspx" 25 | } /> 26 | 27 | <#-- 显示导航列表 --> 28 | <#assign ks=navs?keys> 29 | <#list ks as k> 30 | <#assign v = navs[k] /> 31 | <#assign i = v?index_of("/",2)-1 /> 32 | <#if i gt 1> 33 | <#assign m = v[1..i] /> 34 | 35 |

  • class="on">target="_blank">${k}
  • 36 | 37 | 38 | 39 | <#-- 40 | 权限验证 41 | <#macro auth uri > 42 | <@s.action id="a" name="auth" namespace="/" executeResult="false" uri=uri/> 43 | <#nested a> 44 | 45 | --> -------------------------------------------------------------------------------- /web/WEB-INF/ftl_lib/index.ftl: -------------------------------------------------------------------------------- 1 | <#include "common.ftl"/> -------------------------------------------------------------------------------- /web/WEB-INF/lib/activation.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/activation.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/antlr-2.7.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/antlr-2.7.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/apache-ant-zip.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/apache-ant-zip.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-beanutils-1.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-beanutils-1.7.0.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-chain-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-chain-1.2.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-collections-3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-collections-3.2.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-fileupload-1.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-fileupload-1.2.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-io-1.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-io-1.3.2.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-lang-2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-lang-2.3.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-logging-1.0.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-logging-1.0.4.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/commons-logging-api-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/commons-logging-api-1.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/dom4j-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/dom4j-1.6.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/ehcache-1.6.0-beta3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/ehcache-1.6.0-beta3.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/freemarker-2.3.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/freemarker-2.3.15.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/gson.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/gson.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/hibernate3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/hibernate3.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/idchecker.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/idchecker.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/jta-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/jta-1.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/log4j-1.2.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/log4j-1.2.15.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/mysql.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/mysql.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/ognl-2.7.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/ognl-2.7.3.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/ojdbc14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/ojdbc14.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.aop-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.aop-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.asm-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.asm-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.beans-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.beans-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.context-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.context-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.context.support-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.context.support-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.core-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.core-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.expression-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.expression-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.jdbc-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.jdbc-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.orm-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.orm-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.transaction-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.transaction-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.web-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.web-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/org.springframework.web.struts-3.0.0.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/org.springframework.web.struts-3.0.0.RELEASE.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/proxool-0.9.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/proxool-0.9.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/proxool-cglib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/proxool-cglib.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/slf4j-api-1.5.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/slf4j-api-1.5.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/slf4j-log4j12-1.5.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/slf4j-log4j12-1.5.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/struts2-core-2.1.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/struts2-core-2.1.8.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/struts2-spring-plugin-2.1.8.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/struts2-spring-plugin-2.1.8.1.jar -------------------------------------------------------------------------------- /web/WEB-INF/lib/xwork-core-2.1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/WEB-INF/lib/xwork-core-2.1.6.jar -------------------------------------------------------------------------------- /web/WEB-INF/template/center/changeInfo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <@s.text name='title'/> 6 | <#include "../include/head.html"/> 7 | 8 | 26 | 27 | 28 | <#include "../include/header.html"/> 29 |
    30 |
    31 |
    32 |
    33 |

    个人中心

    34 |
    35 |
    36 |
    37 |
    38 | 42 |
    43 |
    44 |
    45 |
    46 |
    47 |
    48 |
    修改资料
    49 |
    50 | <@s.form id="userForm" action="/center/changeInfo.jspx" method="post"> 51 | 52 | 53 | 54 | 55 | 58 | 59 | 60 | 61 | 64 | 65 | 66 | 67 | 69 | 70 | 71 | 72 | 73 | 76 | 77 | 78 |
    <@s.text name="user.username" disabled="true"/> 56 |   57 |
    <@s.textfield name="user.nickname" cssClass="txt w200"/> 62 |  * 请输入2-20个字符之间的昵称 63 |
    <@s.textarea name="user.description" cssClass="txt" cols="30" rows="4"/> 小于255个字符 68 |
    74 | 75 |
    79 | 80 |
    81 |
    82 |
    83 |
    84 |
    85 |
    86 | <#include "../include/footer.html"/> 87 | 88 | -------------------------------------------------------------------------------- /web/WEB-INF/template/center/changePassword.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <@s.text name='title'/> 6 | <#include "../include/head.html"/> 7 | 8 | 26 | 27 | 28 | <#include "../include/header.html"/> 29 |
    30 |
    31 |
    32 |
    33 |

    个人中心

    34 |
    35 |
    36 |
    37 |
    38 | 42 |
    43 |
    44 |
    45 |
    46 |
    47 |
    48 |
    修改密码
    49 |
    50 | <@s.form id="userForm" action="/center/changePassword.jspx" method="post"> 51 | 52 | 53 | 54 | 55 | 58 | 59 | 60 | 61 | 64 | 65 | 66 | 67 | 70 | 71 | 72 | 73 | 76 | 77 | 78 | 79 | 82 | 83 | 84 | 85 | 86 | 89 | 90 | 91 |
    <@s.text name="user.username" disabled="true"/> 56 |   57 |
    <@s.text name="user.nickname" cssClass="txt w200"/> 62 |    63 |
    <@s.password name="user.password" cssClass="txt w200" value=""/> 68 |   69 |
    <@s.password name="user.passwordNew" cssClass="txt w200" value=""/> 74 |  请输入4-20个字符之间的密码,若不修改密码,请留空。 75 |
    <@s.password name="user.passwordNew2" cssClass="txt w200" value=""/> 80 |  重复输入密码 81 |
    87 | 88 |
    92 | 93 |
    94 |
    95 |
    96 |
    97 |
    98 |
    99 | <#include "../include/footer.html"/> 100 | 101 | -------------------------------------------------------------------------------- /web/WEB-INF/template/effect/comment.html: -------------------------------------------------------------------------------- 1 | <#if pagination?exists && pagination.list?size gt 0> 2 | <#list pagination.list as v> 3 |

    ${(pageIndex-1)*pageSize+v_index+1}#   发表人:${v.username}    发表时间:${v.created}    <#if Session?exists && Session.user?exists && Session.user.role==1>删除

    ${v.content}

    4 | 5 | <#else> 6 | 还没有网友发表评论 7 | 8 | 9 | -------------------------------------------------------------------------------- /web/WEB-INF/template/effect/edit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 |
    编辑特效
    10 |
    11 | <@s.form id="editForm" action="/effect/edit.jspx" method="post"> 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 59 |
    <@s.select name="effect.weCategory.id" list="categoryList" listKey="id" listValue="name" cssClass="txt w200"/> 17 |  *  18 |
    <@s.textfield name="effect.title" cssClass="txt w200"/> 23 |  * 特效标题在1-200个字符之间 24 |
    <@s.textfield name="effect.author" cssClass="txt w200"/> 29 |  * 特效作者在1-200个字符之间 30 |
    35 | 36 | 37 | 38 |  若不修改请留空,小于5M的zip格式文件,zip包中必须包含html文件 39 |
    40 | 41 | ${effect.weFile.title}  新上传的文件文件,会被替换此特效文件 42 |
    <@s.textarea name="effect.description" cssClass="txt" cols="70" rows="10"/> 47 |  *  48 |
    54 | 55 | 56 |
    60 | <@s.hidden name="effect.id"/> 61 | 62 |
    63 |
    64 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/effect/upload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 |
    上传特效
    10 |
    11 | <@s.form id="uploadForm" action="/effect/upload.jspx" enctype="multipart/form-data" method="post"> 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 42 | 43 | 44 | 45 | 48 | 49 | 50 | 51 | 52 | 56 | 57 | 58 |
    <@s.select name="effect.weCategory.id" list="categoryList" listKey="id" listValue="name" value="categoryId" cssClass="txt w200"/> 17 |  *  18 |
    <@s.textfield name="effect.title" cssClass="txt w200"/> 23 |  * 特效标题在1-200个字符之间 24 |
    <@s.textfield name="effect.author" cssClass="txt w200"/> 29 |  * 特效作者在1-200个字符之间 30 |
    35 | 36 | 37 | 38 |  请上传小于5M的zip格式文件,zip包中必须包含html文件 39 |
    40 | 41 |
    <@s.textarea name="effect.description" cssClass="txt" cols="70" rows="10"/> 46 |  *  47 |
    53 | 54 | 55 |
    59 | 60 |
    61 |
    62 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/effect/view.html: -------------------------------------------------------------------------------- 1 | 2 | 44 |
    45 |
    特效预览
    46 |
    47 | 48 | 49 | 50 | 54 | 59 | 62 | 63 | 64 | 65 | 71 | 72 |
    ${effect.title}
    分类:${effect.categoryName}   51 | 作者:${effect.author}   上传者:${effect.username}   52 | 查看:${effect.clickNum}次  下载:${effect.downNum}次   53 |
    55 | 58 |
    使用说明: 60 | <@s.textarea name="effect.description" rows="15" cols="88" cssClass="txt" cssStyle="width:736px;_width:732px;"/> 61 |
    上传时间:${effect.created}  更新时间:${effect.updated}
    66 |   67 |   68 | <#if Session?exists && Session.user?exists && (Session.user.role==1 || Session.user.username==effect.username)>  69 |   70 |  
    73 |
    74 |
    75 |
    76 |
    网友评论
    77 |
    78 | <@s.form id="commentForm" action="/effect/addComment.jspx" method="post"> 79 | 80 | 81 | 82 | 83 | 86 | 87 | 88 | 89 | 90 |
    发表评论: 84 | <@s.textarea id="commentContent" name="comment.content" rows="5" cols="88" cssClass="txt" cssStyle="width:736px;_width:732px;"/> 85 |
      
    91 | <@s.hidden name="comment.weEffect.id" value="${effect.id}"/> 92 | 93 |
    94 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/include/footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/WEB-INF/template/include/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /web/WEB-INF/template/include/header.html: -------------------------------------------------------------------------------- 1 |
    2 | 3 | <#if Session?exists && Session.user?exists> 4 |
    您好,${Session.user.nickname} [ 退出 ]
    5 | <#else> 6 |
    您好,欢迎来到<@s.text name='title'/> [ 登陆 ]
    7 | 8 | 13 |
    14 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/login.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 登录 - <@s.text name='title'/> 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | 22 | 53 | 54 | 55 | 60 | 61 |
    23 |
    24 |

    25 |

    26 | <#if actionErrors.size() gt 0> 27 | <@s.actionerror escape="false" /> 28 | <#elseif actionMessages.size() gt 0> 29 | <@s.actionmessage escape="false"/> 30 | 31 |
    32 |

    33 |

    用户名:

    34 |

    35 | 36 |

    37 |

    密 码:

    38 |

    39 | 40 |

    41 |

    界 面:

    42 |

    43 | 46 |

    47 |

    48 | 49 |

    50 |
    51 | 52 |
    56 | 59 |
    62 | 63 | 64 | -------------------------------------------------------------------------------- /web/WEB-INF/template/message.html: -------------------------------------------------------------------------------- 1 |
    2 |
    <#if actionErrors.size() gt 0>错误信息<#else>提示信息
    3 |
    4 |
    5 | <#if actionErrors.size() gt 0> 6 | <@s.actionerror escape="false" /> 7 | <#elseif actionMessages.size() gt 0> 8 | <@s.actionmessage escape="false"/> 9 | <#else> 10 |
    • 无消息
    11 | 12 |
    13 |
    14 |
    15 | -------------------------------------------------------------------------------- /web/WEB-INF/template/setting/category/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 分类管理 - <@s.text name='title'/> 6 | <#include tplPath+"/include/head.html"/> 7 | 8 | 45 | 46 | 47 | <#include tplPath+"/include/header.html"/> 48 |
    49 |
    50 |
    51 |
    52 |

    分类管理

    53 |
    54 |
    55 |
    56 |
    57 | 61 |
    62 |
    63 |
    64 |
    65 |
    66 |
    分类列表
    67 |
    68 | <@s.form id="categoryForm" action="/setting/category/update.jspx" method="post"> 69 | 70 | 71 | 72 | <#list categoryList as v> 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 |
    名称描述权重操作
    <@s.hidden name="categoryList[${v_index}].id" value=v.id/><@s.textfield name="categoryList[${v_index}].name" value=v.name cssClass="txt w250"/><@s.textfield name="categoryList[${v_index}].description" value=v.description cssClass="txt w350"/><@s.textfield name="categoryList[${v_index}].weight" value=v.weight cssClass="txt w50" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');"/>删除
    <@s.submit value="提交更改" cssClass="btn"/> 添加分类
    83 | 84 |
    85 |
    86 |
    87 |
    88 |
    89 |
    90 | <#include tplPath+"/include/footer.html"/> 91 | 92 | -------------------------------------------------------------------------------- /web/WEB-INF/template/setting/user/add.html: -------------------------------------------------------------------------------- 1 | 20 |
    21 |
    添加用户
    22 |
    23 | <@s.form id="userForm" action="/setting/user/add.jspx" method="post"> 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 |
    <@s.textfield name="user.username" cssClass="txt w200"/> 29 |  * 以字母开头,只能包含字符、下划线、数字,长度在4-20个字符之间 30 |
    <@s.textfield name="user.password" cssClass="txt w200"/> 35 |  * 请输入4-20个字符之间的密码 36 |
    <@s.textfield name="user.nickname" cssClass="txt w200"/> 41 |  * 请输入2-20个字符之间的昵称 42 |
    <@s.textarea name="user.description" cssClass="txt" cols="30" rows="4"/> 小于255个字符 47 |
    <@s.select name="user.role" list="roleMap" listKey="key" listValue="value" cssClass="txt w200"/> 52 |  *  53 |
    59 | 60 | 61 |
    65 | 66 |
    67 |
    68 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/setting/user/edit.html: -------------------------------------------------------------------------------- 1 | 20 |
    21 |
    编辑用户
    22 |
    23 | <@s.form id="userForm" action="/setting/user/edit.jspx" method="post"> 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 64 |
    <@s.hidden name="user.id"/><@s.text name="user.username"/> 29 |   30 |
    <@s.textfield name="user.password" cssClass="txt w200" value=""/> 35 |  请输入4-20个字符之间的密码,若不修改密码,请留空。 36 |
    <@s.textfield name="user.nickname" cssClass="txt w200"/> 41 |  * 请输入2-20个字符之间的昵称 42 |
    <@s.textarea name="user.description" cssClass="txt" cols="30" rows="4"/> 小于255个字符 47 |
    <@s.select name="user.role" list="roleMap" listKey="key" listValue="value" cssClass="txt w200"/> 52 |  *  53 |
    59 | 60 | 61 |
    65 | 66 |
    67 |
    68 |
    -------------------------------------------------------------------------------- /web/WEB-INF/template/setting/user/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 用户管理 - <@s.text name='title'/> 6 | <#include tplPath+"/include/head.html"/> 7 | 8 | 9 | 36 | 37 | 38 | <#include tplPath+"/include/header.html"/> 39 |
    40 |
    41 |
    42 |
    43 |

    用户管理

    44 |
    45 |
    46 |
    47 |
    48 | 52 |
    53 |
    54 |
    55 |
    56 |
    57 |
    用户列表
    58 |
    59 | 60 | 61 | 62 | <#list pagination.list as v> 63 | 64 | 65 | 66 | 67 | 68 | 69 |
    用户名昵称说明角色登陆次数登陆时间操作
    ${v.username}${v.nickname}<#if v.description?length gt 5>${v.description[0..5]}...<#else>${v.description}${v.roleFormatted}${v.loginNum}${v.loginTimeFormatted}编辑 <#if v.username != 'admin' && Session.user.id != v.id>删除
     添加用户
    70 |
    71 |
    72 | 73 |
    74 |
    75 |
    76 | <#include tplPath+"/include/footer.html"/> 77 | 78 | -------------------------------------------------------------------------------- /web/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | WebEffect 8 | 9 | contextConfigLocation 10 | 11 | classpath:/applicationContext.xml 12 | 13 | 14 | 15 | 16 | 17 | proxoolAdmin 18 | org.logicalcobwebs.proxool.admin.servlet.AdminServlet 19 | 20 | 21 | proxoolAdmin 22 | /proxoolAdmin.svl 23 | 24 | 25 | 26 | 27 | encodingFilter 28 | org.springframework.web.filter.CharacterEncodingFilter 29 | 30 | encoding 31 | UTF-8 32 | 33 | 34 | forceEncoding 35 | true 36 | 37 | 38 | 39 | 40 | hibernateFilter 41 | org.springframework.orm.hibernate3.support.OpenSessionInViewFilter 42 | 43 | 44 | 45 | strutsFilter 46 | org.apache.struts2.dispatcher.FilterDispatcher 47 | 48 | 49 | 50 | 51 | encodingFilter 52 | *.do 53 | 54 | 55 | encodingFilter 56 | *.jspx 57 | 58 | 59 | 60 | strutsFilter 61 | *.do 62 | 63 | 64 | strutsFilter 65 | *.jspx 66 | 67 | 68 | 69 | hibernateFilter 70 | *.do 71 | 72 | 73 | hibernateFilter 74 | *.jspx 75 | 76 | 77 | org.springframework.web.context.ContextLoaderListener 78 | 79 | 80 | 81 | org.springframework.web.util.IntrospectorCleanupListener 82 | 83 | 84 | 85 | 86 | 20 87 | 88 | 89 | 403 90 | /403.html 91 | 92 | 93 | 404 94 | /404.html 95 | 96 | 97 | 500 98 | /500.html 99 | 100 | 101 | index.jspx 102 | 103 | 104 | -------------------------------------------------------------------------------- /web/index.jspx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/index.jspx -------------------------------------------------------------------------------- /web/resource/global.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";/* OpenWan CSS */ 2 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;} 3 | table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;} 4 | address,caption,cite,code,dfn,th,var{font-style:normal;font-weight:normal;} 5 | ol,ul,li{list-style:none;}caption,th{text-align:left;} 6 | h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;} 7 | q:before,q:after{content:'';}abbr,acronym{border:0;} 8 | object:focus{outline: none;star:expression(this.onFocus=this.blur());} 9 | body{font-size:12px;font-family: Verdana, Geneva, sans-serif;background-color:#fff;color:#282828;} 10 | a:link,a:visited{color:#282828;text-decoration:none;} 11 | a:hover,a:active{color:#f00;text-decoration:underline;} 12 | .clear{clear:both;height:0px;display:block;}.clear10{clear:both;height:10px;display:block;} 13 | .inline{display:inline;}.pointer{cursor:pointer;} 14 | .left{float:left;}.right{float:right;} 15 | .show{display:block;}.hide{display:none;} 16 | .f12{font-size:12px;}.f14{font-size:14px;} 17 | .tl{text-align:left;}.tr{text-align:right;}.tc{text-align:center;}.tm{vertical-align:middle;} 18 | .m10{margin:10px;}.mt10{margin-top:10px;}.ml10{margin-left:10px;} 19 | .p5{padding:5px;}.p10{padding:10px;}.pt0{padding-top:0;} 20 | /* Layout 980, 150 820, 200 770, 200 380 380, 200 430 260,200 385 375 */ 21 | .w980{width:980px;} 22 | .w150{width:150px;}.w820{width:820px;} 23 | .w200{width:200px;}.w770{width:770px;}.w380{width:380px;_width:378px;} 24 | .w428{width:428px;}.w332{width:332px;} 25 | .w385{width:385px;}.w375{width:375px;} 26 | .w50{width:50px;}.w70{width:70px;}.w100{width:100px;}.w250{width:250px;} 27 | .w255{width:255px;}.w260{width:260px;}.w350{width:350px;} 28 | /* Form */ 29 | .txt,.btn{padding:2px;margin:2px;margin-left:0;border:1px solid;border-color:#666 #ccc #ccc #666;background:#f9f9f9;color:#333;vertical-align:middle;} 30 | .txt:hover, .txt:focus {border-color: #09c;background: #f5f9fd;} 31 | .btn {padding:2px 5px;*padding:4px 2px 1px;margin:3px 0;border-color:#ddd #666 #666 #ddd;background:#ddd;color:#000;cursor:pointer;margin-right:8px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;} 32 | .lbl {font-weight:bold;color:#666;} .req, .error {color:#c00;font-weight:bold;} .desc {color:#aaa;} 33 | /* Radius */ 34 | .rtl0{-moz-border-radius-topleft:0;-khtml-border-top-left-radius:0;-webkit-border-top-left-radius:0;border-top-left-radius:0;} 35 | .rtr0{-moz-border-radius-topright:0;-khtml-border-top-right-radius:0;-webkit-border-top-right-radius:0;border-top-right-radius:0;} 36 | .rbl0{-moz-border-radius-bottomleft:0;-khtml-border-bottom-left-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;} 37 | .rbr0{-moz-border-radius-bottomright:0;-khtml-border-bottom-right-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;} 38 | .r3{-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;} 39 | .r5{-moz-border-radius:5px;-khtml-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;} 40 | .r10{-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;} -------------------------------------------------------------------------------- /web/resource/global.js: -------------------------------------------------------------------------------- 1 | // JavaScript */ 2 | function tab(tname, cname, lenght, j) { 3 | for (i = 1; i <= lenght; i++) { 4 | $("#" + tname + i).removeClass("current"); 5 | } 6 | $("#" + tname + j).addClass("current"); 7 | for (i = 1; i <= lenght; i++) { 8 | $("#" + cname + i).hide(); 9 | $("#" + cname + j).show(); 10 | } 11 | } 12 | 13 | function addFavorite(sURL, sTitle){ 14 | try{ 15 | window.external.addFavorite(sURL, sTitle); 16 | }catch (e){ 17 | try{ 18 | window.sidebar.addPanel(sTitle, sURL, ""); 19 | }catch (e){ 20 | alert("加入收藏失败,请使用Ctrl+D进行添加"); 21 | } 22 | } 23 | } 24 | 25 | function loading(e, text){ 26 | var html = '
    loading...'; 27 | if (text) html += '

    ' + text; 28 | html += '
    '; 29 | $(e).html(html); 30 | } 31 | -------------------------------------------------------------------------------- /web/resource/iepngfix.htc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 103 | 104 | -------------------------------------------------------------------------------- /web/resource/images/add.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/add.gif -------------------------------------------------------------------------------- /web/resource/images/bottom_bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/bottom_bg.jpg -------------------------------------------------------------------------------- /web/resource/images/box_title1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/box_title1.gif -------------------------------------------------------------------------------- /web/resource/images/box_title2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/box_title2.gif -------------------------------------------------------------------------------- /web/resource/images/box_title3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/box_title3.gif -------------------------------------------------------------------------------- /web/resource/images/box_title4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/box_title4.gif -------------------------------------------------------------------------------- /web/resource/images/cancelbutton.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/cancelbutton.gif -------------------------------------------------------------------------------- /web/resource/images/li.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/li.gif -------------------------------------------------------------------------------- /web/resource/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/loading.gif -------------------------------------------------------------------------------- /web/resource/images/login_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/login_bg.gif -------------------------------------------------------------------------------- /web/resource/images/login_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/login_logo.gif -------------------------------------------------------------------------------- /web/resource/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/logo.gif -------------------------------------------------------------------------------- /web/resource/images/logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/logo.psd -------------------------------------------------------------------------------- /web/resource/images/nav_on.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/nav_on.gif -------------------------------------------------------------------------------- /web/resource/images/top_bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/top_bg.gif -------------------------------------------------------------------------------- /web/resource/images/top_bg_.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/top_bg_.gif -------------------------------------------------------------------------------- /web/resource/images/tree/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/Thumbs.db -------------------------------------------------------------------------------- /web/resource/images/tree/base.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/base.gif -------------------------------------------------------------------------------- /web/resource/images/tree/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/close.gif -------------------------------------------------------------------------------- /web/resource/images/tree/empty.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/empty.gif -------------------------------------------------------------------------------- /web/resource/images/tree/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/folder.gif -------------------------------------------------------------------------------- /web/resource/images/tree/folderopen.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/folderopen.gif -------------------------------------------------------------------------------- /web/resource/images/tree/join.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/join.gif -------------------------------------------------------------------------------- /web/resource/images/tree/joinbottom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/joinbottom.gif -------------------------------------------------------------------------------- /web/resource/images/tree/line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/line.gif -------------------------------------------------------------------------------- /web/resource/images/tree/minus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/minus.gif -------------------------------------------------------------------------------- /web/resource/images/tree/minusbottom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/minusbottom.gif -------------------------------------------------------------------------------- /web/resource/images/tree/open.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/open.gif -------------------------------------------------------------------------------- /web/resource/images/tree/page.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/page.gif -------------------------------------------------------------------------------- /web/resource/images/tree/plus.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/plus.gif -------------------------------------------------------------------------------- /web/resource/images/tree/plusbottom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thinkgem/webeffect/a31cbadf6fb4304fa36a1a28680dacab5435adaf/web/resource/images/tree/plusbottom.gif -------------------------------------------------------------------------------- /web/resource/jquery.bgiframe-2.1.1.js: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) 2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 4 | * 5 | * $LastChangedDate: 2007-07-21 18:45:56 -0500 (Sat, 21 Jul 2007) $ 6 | * $Rev: 2447 $ 7 | * 8 | * Version 2.1.1 9 | */ 10 | (function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='