├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── .settings ├── .jsdtscope ├── com.genuitec.eclipse.core.prefs ├── com.genuitec.eclipse.migration.prefs ├── com.genuitec.runtime.libraries.xml ├── org.eclipse.core.resources.prefs ├── org.eclipse.jdt.core.prefs ├── org.eclipse.m2e.core.prefs ├── org.eclipse.wst.common.component ├── org.eclipse.wst.common.project.facet.core.prefs.xml ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.wst.jsdt.ui.superType.name └── org.eclipse.wst.validation.prefs ├── .springBeans ├── README.md ├── WebRoot ├── META-INF │ └── MANIFEST.MF ├── WEB-INF │ ├── dispatcherServlet-servlet.xml │ ├── lib │ │ ├── bce-java-sdk-0.10.28-javadoc.jar │ │ ├── bce-java-sdk-0.10.28-sources.jar │ │ ├── bce-java-sdk-0.10.28.jar │ │ ├── commons-codec-1.9.jar │ │ ├── guava-17.0.jar │ │ ├── httpasyncclient-4.0.2.jar │ │ ├── httpclient-4.3.5.jar │ │ ├── httpcore-4.3.2.jar │ │ ├── httpcore-nio-4.3.2.jar │ │ ├── jcl-over-slf4j-1.7.7.jar │ │ ├── joda-time-2.3.jar │ │ ├── logback-classic-1.1.2.jar │ │ ├── logback-core-1.1.2.jar │ │ └── slf4j-api-1.7.7.jar │ ├── spring-form.tld │ ├── spring.tld │ └── web.xml ├── admin │ ├── addQuestionFirstType.jsp │ ├── addQuestionSecondType.jsp │ ├── addQuestionThreeType.jsp │ ├── changepassword.jsp │ ├── index.jsp │ ├── login.jsp │ ├── questionList.jsp │ ├── questionType.jsp │ ├── updateQuestion.jsp │ ├── updateQuestionFirstType.jsp │ ├── updateQuestionSecondType.jsp │ ├── updateQuestionThreeType.jsp │ ├── updateUser.jsp │ └── userList.jsp ├── css │ ├── adminia-responsive.css │ ├── adminia.css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ ├── demos.css │ ├── example.css │ ├── font-awesome.css │ ├── forgetPsw.css │ ├── index.css │ ├── jquery-weui.css │ ├── knowledgeAnswer.css │ ├── login.css │ ├── myindex.css │ ├── pages │ │ ├── dashboard.css │ │ ├── demos.css │ │ ├── faq.css │ │ ├── login.css │ │ └── plans.css │ ├── register.css │ ├── sm-extend.css │ ├── sm.css │ └── weui.css ├── error.jsp ├── font │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.svgz │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── fontawesome-webfont_162a16fe.eot ├── forgetPsw.jsp ├── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── charts │ │ ├── area.js │ │ ├── bar.js │ │ ├── line.js │ │ └── pie.js │ ├── config.js │ ├── demos.js │ ├── excanvas.min.js │ ├── faq.js │ ├── index.js │ ├── jquery-1.7.2.min.js │ ├── jquery-1.7.2.min_74e92c4.js │ ├── jquery-3.2.1.js │ ├── jquery-weui.js │ ├── jquery.flot.js │ ├── jquery.flot.orderBars.js │ ├── jquery.flot.pie.js │ ├── jquery.flot.resize.js │ ├── jquery.form.js │ ├── knowledgeAnswer.js │ ├── login_register.js │ ├── sm-city-picker.js │ ├── sm-extend.js │ ├── sm.js │ ├── vue.js │ └── zepto.js ├── login.jsp ├── register.jsp ├── resource │ └── images │ │ ├── Exit.png │ │ ├── arrow.png │ │ ├── arrow_white.png │ │ ├── banner_01.png │ │ ├── banner_02.png │ │ ├── bg1.jpg │ │ ├── body-bg.png │ │ ├── content_topic.png │ │ ├── find.jpg │ │ ├── headshot.png │ │ ├── icon1.png │ │ ├── icon2.png │ │ ├── icon_nav_answer.png │ │ ├── icon_nav_people.png │ │ ├── icon_tabbar.png │ │ ├── logo.jpg │ │ └── selection │ │ ├── 1.png │ │ ├── 2.png │ │ ├── 3.png │ │ └── 4.png ├── success.jsp ├── user │ ├── index.jsp │ └── knowleage.jsp └── wechatuser │ ├── index.jsp │ ├── index2.jsp │ └── knowleage.jsp ├── answerWeb.sql ├── config ├── applicationContext.xml ├── dbconfig.properties ├── mapper │ ├── AdminsMapper.xml │ ├── OptionsMapper.xml │ ├── QuestionMapper.xml │ ├── QuestionTypeMapper.xml │ ├── RecordsMapper.xml │ ├── TempUrlMapper.xml │ ├── UserMapper.xml │ ├── WeChatUserMapper.xml │ └── testMapper.xml └── mybatis-config.xml ├── mysqlGeneratorConfig.xml ├── pom.xml ├── repository └── org │ ├── apache │ ├── apache │ │ ├── 3 │ │ │ ├── _remote.repositories │ │ │ ├── apache-3.pom │ │ │ └── apache-3.pom.sha1 │ │ └── 10 │ │ │ ├── _remote.repositories │ │ │ ├── apache-10.pom │ │ │ └── apache-10.pom.sha1 │ └── maven │ │ ├── maven-parent │ │ ├── 5 │ │ │ ├── _remote.repositories │ │ │ ├── maven-parent-5.pom │ │ │ └── maven-parent-5.pom.sha1 │ │ └── 21 │ │ │ ├── _remote.repositories │ │ │ ├── maven-parent-21.pom │ │ │ └── maven-parent-21.pom.sha1 │ │ ├── maven-plugin-api │ │ └── 2.0.6 │ │ │ ├── _remote.repositories │ │ │ ├── maven-plugin-api-2.0.6.jar.sha1 │ │ │ ├── maven-plugin-api-2.0.6.pom │ │ │ └── maven-plugin-api-2.0.6.pom.sha1 │ │ ├── maven │ │ └── 2.0.6 │ │ │ ├── _remote.repositories │ │ │ ├── maven-2.0.6.pom │ │ │ └── maven-2.0.6.pom.sha1 │ │ └── plugins │ │ ├── maven-clean-plugin │ │ └── 2.5 │ │ │ ├── _remote.repositories │ │ │ ├── maven-clean-plugin-2.5.jar.sha1 │ │ │ ├── maven-clean-plugin-2.5.pom │ │ │ └── maven-clean-plugin-2.5.pom.sha1 │ │ └── maven-plugins │ │ └── 22 │ │ ├── _remote.repositories │ │ ├── maven-plugins-22.pom │ │ └── maven-plugins-22.pom.sha1 │ ├── codehaus │ └── plexus │ │ └── plexus-utils │ │ └── 3.0 │ │ ├── _remote.repositories │ │ ├── plexus-utils-3.0.jar.sha1 │ │ ├── plexus-utils-3.0.pom │ │ └── plexus-utils-3.0.pom.sha1 │ └── sonatype │ ├── forge │ └── forge-parent │ │ └── 5 │ │ ├── _remote.repositories │ │ ├── forge-parent-5.pom │ │ └── forge-parent-5.pom.sha1 │ └── spice │ └── spice-parent │ └── 16 │ ├── _remote.repositories │ ├── spice-parent-16.pom │ └── spice-parent-16.pom.sha1 └── src └── cn └── edu └── lingnan ├── controller ├── AdminController.java ├── AnswerController.java ├── BaseController.java ├── OptionsController.java ├── QuestionController.java ├── QuestionTypeController.java ├── RecordsController.java ├── TestController.java ├── UserController.java └── WeChatController.java ├── dao ├── AdminsMapper.java ├── OptionsMapper.java ├── QuestionMapper.java ├── QuestionTypeMapper.java ├── QuestionTypePlus.java ├── RecordsMapper.java ├── TempUrlMapper.java ├── TestMapper.java ├── UserMapper.java └── WeChatUserMapper.java ├── filter ├── CommonInterceptor.java └── UserFilter.java ├── pojo ├── Admins.java ├── AdminsExample.java ├── Options.java ├── OptionsExample.java ├── OptionsList.java ├── Question.java ├── QuestionExample.java ├── QuestionOption.java ├── QuestionType.java ├── QuestionTypeExample.java ├── Records.java ├── RecordsExample.java ├── TempUrl.java ├── TempUrlExample.java ├── Test.java ├── UploadFile.java ├── User.java ├── UserExample.java ├── WeChatUser.java ├── WeChatUserExample.java └── wechatpojo │ ├── Article.java │ ├── AutowebParams.java │ ├── BaseMessage.java │ ├── NewsMessage.java │ └── TextMessage.java ├── service ├── AdminsService.java ├── AnswerService.java ├── OptionsService.java ├── QuestionService.java ├── QuestionTypeService.java ├── RecordsService.java ├── TaskService.java ├── TempUrlService.java ├── TestService.java ├── UserService.java └── WeChatService.java └── utils ├── BOSUtil.java ├── GeneratorSqlmap.java ├── HttpUtil.java ├── MailUtil.java ├── SignUtil.java ├── TransmisstionProtected.java └── WeChatMessageUtil.java /.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 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.js linguist-language=java -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.ear 17 | *.zip 18 | *.tar.gz 19 | *.rar 20 | 21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 22 | hs_err_pid* 23 | /target 24 | 25 | 26 | /文档资料 -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnswerWeb 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | com.genuitec.eclipse.springframework.springbuilder 35 | 36 | 37 | 38 | 39 | 40 | com.genuitec.eclipse.springframework.springnature 41 | org.eclipse.m2e.core.maven2Nature 42 | org.eclipse.jem.workbench.JavaEMFNature 43 | org.eclipse.wst.common.modulecore.ModuleCoreNature 44 | org.eclipse.wst.common.project.facet.core.nature 45 | org.eclipse.jdt.core.javanature 46 | org.eclipse.wst.jsdt.core.jsNature 47 | 48 | 49 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/com.genuitec.eclipse.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | validator.Checked=WebRoot/admin/newemplist.jsp,WebRoot/admin/userList.jsp 3 | validator.Unchecked= 4 | -------------------------------------------------------------------------------- /.settings/com.genuitec.eclipse.migration.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | performed.operation.resolve.unknown.runtime=1.0 3 | -------------------------------------------------------------------------------- /.settings/com.genuitec.runtime.libraries.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | =\=\=\=\=\=\= 2 | <<<<<<<=HEAD 3 | >>>>>>>=41033a556e611c51b7c9d7d893178613630e2d95 4 | eclipse.preferences.version=1 5 | encoding/=UTF-8 6 | encoding/src=UTF-8 7 | -------------------------------------------------------------------------------- /.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.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning 8 | org.eclipse.jdt.core.compiler.source=1.7 9 | -------------------------------------------------------------------------------- /.settings/org.eclipse.m2e.core.prefs: -------------------------------------------------------------------------------- 1 | activeProfiles= 2 | eclipse.preferences.version=1 3 | resolveWorkspaceProjects=true 4 | version=1 5 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.prefs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.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 -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.validation.prefs: -------------------------------------------------------------------------------- 1 | disabled=06target 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /.springBeans: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1 4 | 5 | 6 | 7 | 8 | 9 | 10 | config/applicationContext.xml 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 在线答题系统 2 | 3 | > 知识答题系统是一个网上答题系统,本系统设计可供为学习或娱乐。系统设计的题目题型目前只支持选择题。系统设计的题目类型多样,可以支持文本类型题目、图片类型题目、视频类型题目以及音频类型题目,用户在答题后会显示正确答案以及解题过程或者是理论概念。为了方便用户使用,系统除了Web端以外还开发了微信网页端,让用户可以随时使用微信进行答题学习。 4 | 5 | - 系统 6 | - 分为客户端,管理端,微信端 7 | - 技术框架 8 | - 使用SSM+Vue的形式来实现,SSM框架用于处理后台的数据逻辑,Vue框架用于前端的数据显示 9 | - 使用git和maven管理项目 10 | - 注意事项 11 | - 数据库文件在一级目录下,命名为answerWeb.sql,部署时,需要在answerWeb/config/dbconfig.properties配置文件中配置好数据库 12 | - 管理端用户表为‘admins’表 13 | - 客户端用户表为‘user’表,用户端登录页登录帐号为邮箱 14 | - 管理端,在创建题目时,在选择完图片后,图片会立即上传到百度云BOS对象存储中(需要在util包的BOSUtil工具类你的BOS对象存储),未点击添加题目时,此时试题的资源(图片,视频)是在BOS的临时文件夹下(在QuestionController类定义路径),当点击添加题目后,会把此试题的资源添加到目标文件夹下(在QuestionController类定义路径),临时文件夹下的东西可以设置任务调度器进行定时删除,防止浪费BOS存储空间。 15 | - 微信端是利用公众号的形式进行开发,如果需要使用到微信端,需要提前申请公众号 16 | - 项目的jar包除了用maven管理外,有一部分jar需要手动导入(answerWeb/WebRoot/WEB-INF/lib) 17 | 18 | - 部分页面 19 | - 登录页 20 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E7%99%BB%E5%BD%95%E9%A1%B5.png) 21 | - 首页 22 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E9%A6%96%E9%A1%B5.png) 23 | - 答题页 24 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E7%AD%94%E9%A2%98%E9%A1%B5%E9%9D%A2%E4%B8%80.png) 25 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E7%AD%94%E9%A2%98%E9%A1%B5%E9%9D%A2%E4%BA%8C.png) 26 | - 管理端编辑试题页面 27 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E7%AE%A1%E7%90%86%E7%AB%AF%E7%BC%96%E8%BE%91%E8%AF%95%E9%A2%98%E9%A1%B5%E9%9D%A2.png) 28 | - 微信页 29 | 30 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E5%BE%AE%E4%BF%A1%E7%AB%AF%E7%AD%94%E9%A2%98%E9%A1%B5%E9%9D%A2%E4%B8%80.png) 31 | ![](https://malizhi-blog-1252037601.cos.ap-guangzhou.myqcloud.com/AnswerWeb-README/%E5%BE%AE%E4%BF%A1%E7%AB%AF%E7%AD%94%E9%A2%98%E9%A1%B5%E9%9D%A2%E4%BA%8C.png) -------------------------------------------------------------------------------- /WebRoot/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/dispatcherServlet-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 12 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28-javadoc.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28-sources.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/bce-java-sdk-0.10.28.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/commons-codec-1.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/commons-codec-1.9.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/guava-17.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/guava-17.0.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/httpasyncclient-4.0.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/httpasyncclient-4.0.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/httpclient-4.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/httpclient-4.3.5.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/httpcore-4.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/httpcore-4.3.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/httpcore-nio-4.3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/httpcore-nio-4.3.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/jcl-over-slf4j-1.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/jcl-over-slf4j-1.7.7.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/joda-time-2.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/joda-time-2.3.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/logback-classic-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/logback-classic-1.1.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/logback-core-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/logback-core-1.1.2.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/lib/slf4j-api-1.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/WEB-INF/lib/slf4j-api-1.7.7.jar -------------------------------------------------------------------------------- /WebRoot/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnswerWeb 4 | 5 | index.html 6 | index.htm 7 | login.jsp 8 | default.html 9 | default.htm 10 | default.jsp 11 | 12 | 13 | org.springframework.web.context.ContextLoaderListener 14 | 15 | 16 | contextConfigLocation 17 | classpath:applicationContext.xml 18 | 19 | 20 | dispatcherServlet 21 | org.springframework.web.servlet.DispatcherServlet 22 | 1 23 | 24 | 25 | dispatcherServlet 26 | / 27 | 28 | 29 | CharacterEncodingFilter 30 | org.springframework.web.filter.CharacterEncodingFilter 31 | 32 | encoding 33 | UTF-8 34 | 35 | 36 | forceRequestEncoding 37 | true 38 | 39 | 40 | forceResponseEncoding 41 | true 42 | 43 | 44 | 45 | CharacterEncodingFilter 46 | /* 47 | 48 | 49 | HiddenHttpMethodFilter 50 | org.springframework.web.filter.HiddenHttpMethodFilter 51 | 52 | 53 | HiddenHttpMethodFilter 54 | /* 55 | 56 | 57 | HttpPutFormContentFilter 58 | org.springframework.web.filter.HttpPutFormContentFilter 59 | 60 | 61 | HttpPutFormContentFilter 62 | /* 63 | 64 | 65 | UserFilter 66 | cn.edu.lingnan.filter.UserFilter 67 | 68 | 69 | UserFilter 70 | /user/* 71 | 72 | -------------------------------------------------------------------------------- /WebRoot/admin/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 | %> 6 | 7 | 8 | 9 | 10 | 11 | 12 | My JSP 'index.jsp' starting page 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | This is my JSP page.
25 | 26 | 27 | -------------------------------------------------------------------------------- /WebRoot/admin/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <% 3 | String path = request.getContextPath(); 4 | String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() 5 | + path + "/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 登录 13 | 14 | 16 | 17 | 18 | 19 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 71 | 72 | 73 | 74 |
75 | 76 | 77 |
78 | 79 |

登录

80 | 81 |
82 | 83 |
84 |
85 |
86 |

${loginError}

87 |
88 | 89 |
90 | 92 |
93 |
94 |
95 | 96 |
97 | 99 |
100 |
101 | 102 |
103 | 104 |
105 | 107 |
108 | 109 |
110 | 112 | 113 |
114 | 115 | 116 |
117 | 118 |
119 | 120 | 121 |
122 | 123 | 124 | 125 | 126 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /WebRoot/css/adminia-responsive.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------ 2 | 3 | [Dashboard Stylesheet] 4 | 5 | Project: Adminia Admin 6 | Version: 1.0 7 | Last change: 05/11/2012 8 | Assigned to: Rod Howard (rh) 9 | 10 | 11 | 12 | [Table of contents] 13 | 14 | 1. Max Width: 979px 15 | 2. Max Width: 767px 16 | 17 | -------------------------------------------------------------------*/ 18 | 19 | 20 | 21 | /*------------------------------------------------------------------ 22 | [1. Max Width: 979px] 23 | */ 24 | 25 | @media (max-width: 979px) { 26 | 27 | #content { 28 | padding-top: 15px; 29 | } 30 | 31 | } 32 | 33 | 34 | 35 | 36 | /*------------------------------------------------------------------ 37 | [2. Max Width: 767px] 38 | */ 39 | 40 | @media (max-width: 767px) { 41 | 42 | #content { 43 | padding-top: 0; 44 | } 45 | 46 | .sidebar-extra { 47 | display: none; 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /WebRoot/css/demos.css: -------------------------------------------------------------------------------- 1 | body, html { 2 | height: 100%; 3 | -webkit-tap-highlight-color: transparent; 4 | } 5 | .demos-title { 6 | text-align: center; 7 | font-size: 34px; 8 | color: #3cc51f; 9 | font-weight: 400; 10 | margin: 0 15%; 11 | } 12 | 13 | .demos-sub-title { 14 | text-align: center; 15 | color: #888; 16 | font-size: 14px; 17 | } 18 | 19 | .demos-header { 20 | padding: 35px 0; 21 | } 22 | 23 | .demos-content-padded { 24 | padding: 15px; 25 | } 26 | 27 | .demos-second-title { 28 | text-align: center; 29 | font-size: 24px; 30 | color: #3cc51f; 31 | font-weight: 400; 32 | margin: 0 15%; 33 | } 34 | 35 | footer { 36 | text-align: center; 37 | font-size: 14px; 38 | padding: 20px; 39 | } 40 | 41 | footer a { 42 | color: #999; 43 | text-decoration: none; 44 | } 45 | -------------------------------------------------------------------------------- /WebRoot/css/forgetPsw.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | list-style: none; 6 | } 7 | 8 | .box{ 9 | position: absolute; 10 | top: 0; 11 | left: 0; 12 | bottom: 0; 13 | right: 0; 14 | margin: auto; 15 | width: 600px; 16 | height: 300px; 17 | text-align: center; 18 | background: #f9f9f9; 19 | box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.5); 20 | } 21 | .text1{ 22 | width: 500px; 23 | height: 50px; 24 | line-height: 50px; 25 | margin: 0 auto; 26 | font-size: 20px; 27 | text-align: center; 28 | border-bottom: 1px solid darkgray; 29 | margin-bottom: 10px; 30 | } 31 | .text2{ 32 | width: 500px; 33 | height: 50px; 34 | line-height: 50px; 35 | margin: 0 auto; 36 | font-size: 12px; 37 | text-align: center; 38 | 39 | } 40 | .email_error{ 41 | text-align: left; 42 | color: red; 43 | margin-left: 134px; 44 | } 45 | input{ 46 | width: 318px; 47 | height: 38px; 48 | font-size: 16px; 49 | margin: 0 auto; 50 | padding-left: 10px; 51 | border: 1px solid #CECECF; 52 | box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1); 53 | margin-bottom: 20px; 54 | } 55 | input[type="submit"]{ 56 | width: 330px; 57 | height: 50px; 58 | color: #fff; 59 | font-weight: bold; 60 | background: #63c5da; 61 | border-radius: 5px; 62 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, .3); 63 | outline: none; 64 | border: none; 65 | transition: ease-in 0.2s; 66 | } 67 | input[type="submit"]:hover{ 68 | background-color: #56bbd1; 69 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, 0.8); 70 | 71 | } 72 | -------------------------------------------------------------------------------- /WebRoot/css/login.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | list-style: none; 6 | } 7 | a{ 8 | text-decoration: none; 9 | color: #999; 10 | font-weight: bold; 11 | } 12 | a:hover{ 13 | color: #000; 14 | text-decoration: underline; 15 | } 16 | .container{ 17 | position: relative; 18 | height: 660px; 19 | min-width: 1000px; 20 | } 21 | .banner{ 22 | position: absolute; 23 | top: 0; 24 | left: 0; 25 | width: 100%; 26 | height: 100%; 27 | min-width: 1000px; 28 | } 29 | .bg{ 30 | position: absolute; 31 | top: 0; 32 | left: 0; 33 | width: 100%; 34 | height: 660px; 35 | min-width: 1000px; 36 | background-repeat: no-repeat; 37 | background-size: 100% 100%; 38 | } 39 | .bg1{background-image: url(../resource/images/banner_01.png);} 40 | .bg2{background-image: url(../resource/images/banner_02.png); display: none;} 41 | 42 | 43 | .login{ 44 | position: absolute; 45 | top: 70px; 46 | right: 9%; 47 | width: 400px; 48 | height: 500px; 49 | border-radius: 3px; 50 | background: #fff; 51 | opacity: 0.95; 52 | } 53 | .topic{ 54 | height: 70px; 55 | line-height: 70px; 56 | text-align: center; 57 | font-size: 20px; 58 | font-weight: bold; 59 | margin-bottom: 11px; 60 | } 61 | 62 | .error_m{ 63 | /*display: none;*/ 64 | font-size: 12px; 65 | margin-left: 107px; 66 | color: red; 67 | } 68 | .error_m a{ 69 | color: blue; 70 | } 71 | 72 | .form{ 73 | width: 330px; 74 | height: 300px; 75 | margin: auto; 76 | /*margin-top: 22px;*/ 77 | } 78 | .input{ 79 | line-height: 40px; 80 | font-size: 20px; 81 | color: #999; 82 | font-weight: bold; 83 | margin-bottom: 25px; 84 | } 85 | label{ 86 | display: inline-block; 87 | width: 60px; 88 | } 89 | input{ 90 | width: 246px;; 91 | height: 40px; 92 | font-size: 16px; 93 | margin-left: 6px; 94 | padding-left: 10px; 95 | border: 1px solid #CECECF; 96 | box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1); 97 | } 98 | input[type="submit"]{ 99 | width: 330px; 100 | height: 50px; 101 | color: #fff; 102 | font-weight: bold; 103 | margin-left: 0; 104 | background: #63c5da; 105 | border-radius: 5px; 106 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, .3); 107 | outline: none; 108 | border: none; 109 | transition: ease-in 0.2s; 110 | } 111 | input[type="submit"]:hover{ 112 | background-color: #56bbd1; 113 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, 0.8); 114 | 115 | } 116 | .bottom ul{ 117 | float: right; 118 | } 119 | .bottom ul li{ 120 | float: left; 121 | margin-left: 10px; 122 | } 123 | .bottom ul b{ 124 | float: left; 125 | width: 10px; 126 | height: 14px; 127 | margin-top: 5px; 128 | border-right:1px solid darkgrey ; 129 | } 130 | -------------------------------------------------------------------------------- /WebRoot/css/myindex.css: -------------------------------------------------------------------------------- 1 | .firsttab{ 2 | width: 100%; 3 | height: 33%; 4 | } 5 | 6 | .firsttab .my_img{ 7 | width: 100%; 8 | height: 100%; 9 | 10 | } -------------------------------------------------------------------------------- /WebRoot/css/pages/dashboard.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------ 2 | 3 | [Dashboard Stylesheet] 4 | 5 | Project: Adminia Admin 6 | Version: 1.0 7 | Last change: 05/11/2012 8 | Assigned to: Rod Howard (rh) 9 | 10 | 11 | 12 | [Table of contents] 13 | 14 | 1. Stats / .stat-container 15 | 16 | -------------------------------------------------------------------*/ 17 | 18 | 19 | 20 | 21 | 22 | /*------------------------------------------------------------------ 23 | [1. Stats / .stat-container] 24 | */ 25 | 26 | .stat-container { 27 | display: table; 28 | 29 | margin-bottom: 1.5em; 30 | 31 | width: 100%; 32 | } 33 | 34 | .stat-holder { 35 | display: table-cell; 36 | 37 | width: 25%; 38 | } 39 | 40 | .stat span { 41 | display: block; 42 | margin-bottom: .4em; 43 | font-size: 32px; 44 | font-weight: 600; 45 | font-style: normal; 46 | color: #4A515B; 47 | } 48 | 49 | .stat { 50 | height: 50px; 51 | padding: 15px; 52 | margin-right: 1em; 53 | 54 | font-size: 12px; 55 | font-style: italic; 56 | text-align: center; 57 | color: #888; 58 | 59 | background: #FFF; 60 | 61 | border: 1px solid #CCC; 62 | 63 | border-radius: 5px; 64 | 65 | text-shadow: 1px 1px 2px rgba(255,255,255,.5); 66 | } 67 | 68 | 69 | .stat-container .stat-holder:last-child .stat { 70 | margin: 0; 71 | } 72 | 73 | 74 | @media (max-width: 767px) { 75 | 76 | .stat-container { 77 | float: left; 78 | display: block; 79 | 80 | margin-bottom: 1em; 81 | } 82 | 83 | .stat-holder { 84 | float: left; 85 | display: block; 86 | 87 | width: 50%; 88 | margin-bottom: 1em; 89 | } 90 | 91 | .stat { 92 | margin: 0 1em; 93 | } 94 | 95 | .stat-container .stat-holder:last-child .stat { 96 | margin: 0 1em; 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /WebRoot/css/pages/demos.css: -------------------------------------------------------------------------------- 1 | .grid-demo .row { 2 | text-align: center; 3 | } 4 | .grid-demo .row + .row { 5 | margin-top: 0.75rem; 6 | } 7 | .grid-demo .row > [class*=col-] { 8 | border: 1px solid #ddd; 9 | } 10 | .icons-demo .icon { 11 | width: 2.5rem; 12 | height: 2.5rem; 13 | margin: 0.15rem; 14 | font-size: 1.2rem; 15 | line-height: 2.5rem; 16 | text-align: center; 17 | background-color: #fff; 18 | border: 1px solid #ddd; 19 | border-radius: 1.25rem; 20 | display: inline-block; 21 | } 22 | .icon.icon-f7 { 23 | width: 1.45rem; 24 | height: 1.45rem; 25 | background-image: url("../img/i-f7.png"); 26 | } 27 | .icon.icon-form-name { 28 | width: 1.45rem; 29 | height: 1.45rem; 30 | background-image: url("../img/i-form-name.png"); 31 | } 32 | .icon.icon-form-password { 33 | width: 1.45rem; 34 | height: 1.45rem; 35 | background-image: url("../img/i-form-password.png"); 36 | } 37 | .icon.icon-form-email { 38 | width: 1.45rem; 39 | height: 1.45rem; 40 | background-image: url("../img/i-form-email.png"); 41 | } 42 | .icon.icon-form-calendar { 43 | width: 1.45rem; 44 | height: 1.45rem; 45 | background-image: url("../img/i-form-calendar.png"); 46 | } 47 | .icon.icon-form-tel { 48 | width: 1.45rem; 49 | height: 1.45rem; 50 | background-image: url("../img/i-form-tel.png"); 51 | } 52 | .icon.icon-form-gender { 53 | width: 1.45rem; 54 | height: 1.45rem; 55 | background-image: url("../img/i-form-gender.png"); 56 | } 57 | .icon.icon-form-toggle { 58 | width: 1.45rem; 59 | height: 1.45rem; 60 | background-image: url("../img/i-form-toggle.png"); 61 | } 62 | .icon.icon-form-comment { 63 | width: 1.45rem; 64 | height: 1.45rem; 65 | background-image: url("../img/i-form-comment.png"); 66 | } 67 | .icon.icon-form-settings { 68 | width: 1.45rem; 69 | height: 1.45rem; 70 | background-image: url("../img/i-form-settings.png"); 71 | } 72 | .icon.icon-form-url { 73 | width: 1.45rem; 74 | height: 1.45rem; 75 | background-image: url("../img/i-form-url.png"); 76 | } 77 | -------------------------------------------------------------------------------- /WebRoot/css/pages/faq.css: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------ 3 | 4 | [FAQ Page] 5 | 6 | Project: Bootstrap Landing Template 7 | Version: 1.0 8 | Last change: 04/26/2012 9 | Assigned to: Rod Howard (rh) 10 | 11 | 12 | -------------------------------------------------------------------*/ 13 | 14 | 15 | 16 | 17 | .faq-search { 18 | margin-bottom: 2em; 19 | 20 | text-align: right; 21 | } 22 | 23 | .faq-search input { 24 | width: 96%; 25 | display: block; 26 | padding: 2%; 27 | } 28 | 29 | 30 | 31 | .faq-empty { 32 | display: none; 33 | } 34 | 35 | 36 | 37 | .faq-toc { 38 | padding: 1.5em 0; 39 | margin: 2em 0 0; 40 | 41 | border: 1px dotted #CCC; 42 | border-right: none; 43 | border-left: none; 44 | } 45 | 46 | .faq-toc ol { 47 | padding: 0; 48 | margin: 0; 49 | } 50 | 51 | .faq-toc li { 52 | margin-bottom: .75em; 53 | 54 | list-style: none; 55 | } 56 | 57 | .faq-toc a { 58 | margin-left: .5em; 59 | } 60 | 61 | 62 | 63 | .faq-list { 64 | padding: 0; 65 | margin: 3em 0 0; 66 | 67 | list-style: none; 68 | } 69 | 70 | .faq-list li { 71 | display: table; 72 | margin-bottom: 2em; 73 | } 74 | 75 | .faq-icon { 76 | display: table-cell; 77 | padding-right: 1.25em; 78 | vertical-align: top; 79 | } 80 | 81 | .faq-text { 82 | display: table-cell; 83 | vertical-align: top; 84 | 85 | } 86 | 87 | 88 | .faq-number { 89 | width: 32px; 90 | height: 32px; 91 | 92 | font-size: 14px; 93 | font-weight: 600; 94 | text-align: center; 95 | line-height: 32px; 96 | color: #FFF; 97 | 98 | background: #F90; 99 | 100 | border: 3px solid #FFF; 101 | 102 | box-shadow: 1px 1px 3px rgba(0,0,0,.4); 103 | 104 | border-radius: 100px; 105 | 106 | text-shadow: 1px 1px 2px rgba(0,0,0,.4); 107 | } 108 | 109 | 110 | 111 | 112 | .btn-support-ask { 113 | display: block; font-size: 22px; padding: 14px 0; font-weight: 600; margin-bottom: .75em; 114 | } 115 | 116 | .btn-support-contact { 117 | display: block; padding: 12px 0; font-size: 18px; font-weight: 600; 118 | } -------------------------------------------------------------------------------- /WebRoot/css/pages/login.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------ 2 | 3 | [Login Stylesheet] 4 | 5 | Project: Adminia Admin 6 | Version: 1.0 7 | Last change: 05/11/2012 8 | Assigned to: Rod Howard (rh) 9 | 10 | 11 | [Table of contents] 12 | 13 | 1. Container / #login-container 14 | 2. Header / #login-header 15 | 3. Content / #login-content 16 | 4. Extra / #login-extra 17 | 5. Max Width: 480px 18 | 19 | -------------------------------------------------------------------*/ 20 | 21 | 22 | 23 | /*------------------------------------------------------------------ 24 | [1. Container / #login-container] 25 | */ 26 | 27 | #login-container { 28 | width: 425px; 29 | margin: 120px auto 0; 30 | 31 | } 32 | 33 | 34 | 35 | 36 | /*------------------------------------------------------------------ 37 | [2. Header / #login-header] 38 | */ 39 | 40 | #login-header { 41 | 42 | padding: 12px 20px; 43 | margin-bottom: 1em; 44 | 45 | background: #3C4049; 46 | background:-moz-linear-gradient(top, #4A515B 0%, #3C4049 100%); /* FF3.6+ */ 47 | background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#4A515B), color-stop(100%,#3C4049)); /* Chrome,Safari4+ */ 48 | background:-webkit-linear-gradient(top, #4A515B 0%,#3C4049 100%); /* Chrome10+,Safari5.1+ */ 49 | background:-o-linear-gradient(top, #4A515B 0%,#3C4049 100%); /* Opera11.10+ */ 50 | background:-ms-linear-gradient(top, #4A515B 0%,#3C4049 100%); /* IE10+ */ 51 | background:linear-gradient(top, #4A515B 0%,#3C4049 100%); /* W3C */ 52 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049'); 53 | -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#4A515B', endColorstr='#3C4049')"; 54 | 55 | border-radius: 5px; 56 | 57 | text-shadow: 1px 1px 2px rgba(0,0,0,.5); 58 | } 59 | 60 | #login-header h3 { 61 | margin-bottom: 0; 62 | 63 | font-size: 16px; 64 | color: #FFF; 65 | 66 | text-decoration: 1px 1px 2px rgba(0,0,0,.4); 67 | } 68 | 69 | 70 | 71 | /*------------------------------------------------------------------ 72 | [3. Content / #login-content] 73 | */ 74 | 75 | #login-content { 76 | padding: 20px; 77 | 78 | background: #FFF; 79 | 80 | border: 1px solid #DDD; 81 | 82 | border-radius: 5px; 83 | 84 | box-shadow: 0 0 6px rgba(0,0,0,.10); 85 | } 86 | 87 | #login-content input { 88 | width: 96%; 89 | padding: 2% 2%; 90 | } 91 | 92 | #login-content #remember-me { 93 | margin-top: 3px; 94 | } 95 | 96 | #login-content #remember-me input { 97 | display: inline-block; 98 | 99 | width: auto; 100 | padding: 0; 101 | } 102 | 103 | #login-content #remember-me label { 104 | position: relative; 105 | top: 2px; 106 | 107 | display: inline-block; 108 | 109 | margin-left: .5em; 110 | } 111 | 112 | 113 | 114 | /*------------------------------------------------------------------ 115 | [4. Extra / #login-extra] 116 | */ 117 | 118 | #login-extra { 119 | margin-top: 1.5em; 120 | 121 | text-align: center; 122 | } 123 | 124 | #login-extra p { 125 | font-size: 12px; 126 | 127 | color: #888; 128 | } 129 | 130 | 131 | 132 | 133 | /*------------------------------------------------------------------ 134 | [5. Max Width: 480px] 135 | */ 136 | 137 | @media (max-width: 480px) { 138 | #login-container { 139 | width: 100%; 140 | margin: 40px auto 0; 141 | } 142 | } -------------------------------------------------------------------------------- /WebRoot/css/pages/plans.css: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------ 3 | 4 | [Pricing Plans Stylesheet] 5 | 6 | Project: Bootstrap Landing Template 7 | Version: 1.0 8 | Last change: 04/26/2012 9 | Assigned to: Rod Howard (rh) 10 | 11 | 12 | -------------------------------------------------------------------*/ 13 | 14 | 15 | /*-- Plan Container --*/ 16 | 17 | .plan-container { 18 | position: relative; 19 | float: left; 20 | } 21 | 22 | /*-- Plan --*/ 23 | 24 | .plan { 25 | margin-right: 6px; 26 | 27 | border-radius: 4px; 28 | } 29 | 30 | 31 | /*-- Plan Header --*/ 32 | 33 | .plan-header { 34 | text-align: center; 35 | color: #FFF; 36 | 37 | background-color: #686868; 38 | 39 | -webkit-border-top-left-radius: 4px; 40 | -webkit-border-top-right-radius: 4px; 41 | -moz-border-radius-topleft: 4px; 42 | -moz-border-radius-topright: 4px; 43 | border-top-left-radius: 4px; 44 | border-top-right-radius: 4px; 45 | 46 | text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4); 47 | } 48 | 49 | .plan-title { 50 | padding: 10px 0; 51 | 52 | font-size: 16px; 53 | color: #FFF; 54 | 55 | border-bottom: 1px solid #FFF; 56 | border-bottom: 1px solid rgba(0, 0, 0, 0.3); 57 | 58 | border-radius: 4px 4px 0 0; 59 | } 60 | 61 | .plan-price { 62 | padding: 20px 0 10px; 63 | 64 | font-size: 66px; 65 | line-height: 0.8em; 66 | 67 | background-color: #797979; 68 | 69 | border-top: 1px solid rgba(255, 255, 255, 0.2); 70 | } 71 | 72 | .plan-price span.term { 73 | display: block; 74 | margin-bottom: 0; 75 | 76 | font-size: 13px; 77 | line-height: 0; 78 | padding: 2em 0 1em; 79 | } 80 | 81 | .plan-price span.note { 82 | position: relative; 83 | top: -40px; 84 | 85 | display: inline; 86 | 87 | font-size: 17px; 88 | line-height: 0.8em; 89 | } 90 | 91 | 92 | 93 | /*-- Plan Features --*/ 94 | 95 | .plan-features { 96 | border: 1px solid #DDD; 97 | border-bottom: none; 98 | } 99 | 100 | .plan-features { 101 | padding-bottom: 1em; 102 | } 103 | 104 | .plan-features ul { 105 | padding: 0; 106 | margin: 0; 107 | 108 | list-style: none; 109 | } 110 | 111 | .plan-features li { 112 | padding: 1em 0; 113 | margin: 0 2em; 114 | 115 | text-align: center; 116 | 117 | border-bottom: 1px dotted #CCC; 118 | } 119 | 120 | .plan-features li:last-child { 121 | border-bottom: none; 122 | } 123 | 124 | 125 | /*-- Plan Actions --*/ 126 | 127 | .plan-actions { 128 | padding: 1.15em 0; 129 | 130 | background: #F2F2F2; 131 | 132 | background-color: whiteSmoke; 133 | background-image: -moz-linear-gradient(top, #F8F8F8, #E6E6E6); 134 | background-image: -ms-linear-gradient(top, #F8F8F8, #E6E6E6); 135 | background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#F8F8F8), to(#E6E6E6)); 136 | background-image: -webkit-linear-gradient(top, #F8F8F8, #E6E6E6); 137 | background-image: -o-linear-gradient(top, #F8F8F8, #E6E6E6); 138 | background-image: linear-gradient(top, #F8F8F8, #E6E6E6); 139 | background-repeat: repeat-x; 140 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0); 141 | border-color: #E6E6E6 #E6E6E6 #BFBFBF; 142 | border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); 143 | filter: progid:dximagetransform.microsoft.gradient(enabled=false); 144 | 145 | border: 1px solid #DDD; 146 | 147 | -webkit-border-bottom-right-radius: 4px; 148 | -webkit-border-bottom-left-radius: 4px; 149 | -moz-border-radius-bottomright: 4px; 150 | -moz-border-radius-bottomleft: 4px; 151 | border-bottom-right-radius: 4px; 152 | border-bottom-left-radius: 4px; 153 | } 154 | 155 | .plan-actions .btn { 156 | padding: 1em 0; 157 | margin: 0 2em; 158 | 159 | display: block; 160 | 161 | font-size: 16px; 162 | font-weight: 600; 163 | } 164 | 165 | 166 | 167 | /*-- Columns --*/ 168 | 169 | .pricing-plans.plans-1 .plan-container { 170 | width: 100%; 171 | } 172 | .pricing-plans.plans-2 .plan-container { 173 | width: 50%; 174 | } 175 | 176 | .pricing-plans.plans-3 .plan-container { 177 | width: 33.33%; 178 | } 179 | 180 | .pricing-plans.plans-4 .plan-container { 181 | width: 25%; 182 | } 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | /*-- Best Value Highlight --*/ 192 | 193 | .plan.best-value .plan-header { 194 | background-color: #677E30; 195 | } 196 | 197 | .plan.best-value .plan-price { 198 | background-color: #81994D; 199 | } 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | .plan.skyblue .plan-header { 208 | background-color: #3D7AB8; 209 | } 210 | 211 | .plan.skyblue .plan-price { 212 | background-color: #69C; 213 | } 214 | 215 | 216 | 217 | .plan.lavendar .plan-header { 218 | background-color: #754F75; 219 | } 220 | 221 | .plan.lavendar .plan-price { 222 | background-color: #969; 223 | } 224 | 225 | 226 | 227 | .plan.teal .plan-header { 228 | background-color: #257272; 229 | } 230 | 231 | .plan.teal .plan-price { 232 | background-color: #399; 233 | } 234 | 235 | 236 | 237 | 238 | .plan.pink .plan-header { 239 | background-color: #FF3778; 240 | } 241 | 242 | .plan.pink .plan-price { 243 | background-color: #F69; 244 | } 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | .plan.black .plan-header { 253 | background-color: #222; 254 | } 255 | 256 | .plan.black .plan-price { 257 | background-color: #333; 258 | } 259 | 260 | 261 | 262 | 263 | 264 | .plan.yellow .plan-header { 265 | background-color: #C69E00; 266 | } 267 | 268 | .plan.yellow .plan-price { 269 | background-color: #E8B900; 270 | } 271 | 272 | 273 | 274 | .plan.purple .plan-header { 275 | background-color: #4E2675; 276 | } 277 | 278 | .plan.purple .plan-price { 279 | background-color: #639; 280 | } 281 | 282 | 283 | 284 | 285 | 286 | .plan.red .plan-header { 287 | background-color: #A40000; 288 | } 289 | 290 | .plan.red .plan-price { 291 | background-color: #C00; 292 | } 293 | 294 | 295 | 296 | .plan.orange .plan-header { 297 | background-color: #D98200; 298 | } 299 | 300 | .plan.orange .plan-price { 301 | background-color: #F90; 302 | } 303 | 304 | 305 | 306 | .plan.blue .plan-header { 307 | background-color: #0052A4; 308 | } 309 | 310 | .plan.blue .plan-price { 311 | background-color: #06C; 312 | } 313 | 314 | 315 | 316 | 317 | /*-- Green Plan --*/ 318 | 319 | .plan.green .plan-header { 320 | background-color: #677E30; 321 | } 322 | 323 | .plan.green .plan-price { 324 | background-color: #81994D; 325 | } 326 | 327 | 328 | 329 | 330 | 331 | /*------------------------------------------------------------------ 332 | [2. Min Width: 767px / Max Width: 979px] 333 | */ 334 | 335 | @media (min-width: 767px) and (max-width: 979px) { 336 | 337 | .pricing-plans .plan-container { 338 | width: 50% !important; 339 | margin-bottom: 2em; 340 | } 341 | 342 | } 343 | 344 | 345 | 346 | @media (max-width: 767px) { 347 | 348 | .pricing-plans .plan-container { 349 | width: 100% !important; 350 | margin-bottom: 2em; 351 | } 352 | 353 | } -------------------------------------------------------------------------------- /WebRoot/css/register.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin: 0; 3 | padding: 0; 4 | border: 0; 5 | list-style: none; 6 | } 7 | a{ 8 | text-decoration: none; 9 | color: #999; 10 | font-weight: bold; 11 | } 12 | a:hover{ 13 | text-decoration: underline; 14 | } 15 | .container{ 16 | position: relative; 17 | height: 660px; 18 | min-width: 1000px; 19 | } 20 | .banner{ 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | width: 100%; 25 | height: 100%; 26 | min-width: 1000px; 27 | } 28 | .bg{ 29 | position: absolute; 30 | top: 0; 31 | left: 0; 32 | width: 100%; 33 | height: 660px; 34 | min-width: 1000px; 35 | background-repeat: no-repeat; 36 | background-size: 100% 100%; 37 | } 38 | .bg1{background-image: url(../resource/images/banner_01.png);} 39 | .bg2{background-image: url(../resource/images/banner_02.png); display: none;} 40 | 41 | 42 | .login{ 43 | position: absolute; 44 | top: 70px; 45 | right: 9%; 46 | width: 400px; 47 | height: 500px; 48 | border-radius: 3px; 49 | background: #fff; 50 | opacity: 0.95; 51 | } 52 | .topic{ 53 | height: 70px; 54 | line-height: 70px; 55 | text-align: center; 56 | font-size: 20px; 57 | font-weight: bold; 58 | } 59 | .form{ 60 | width: 330px; 61 | height: 300px; 62 | margin: auto; 63 | margin-top: 22px; 64 | } 65 | .error { 66 | font-size: 18px; 67 | margin-left: 180px; 68 | color: red; 69 | } 70 | .input{ 71 | line-height: 40px; 72 | font-size: 20px; 73 | color: #999; 74 | font-weight: bold; 75 | margin-bottom: 22px; 76 | } 77 | label{ 78 | display: inline-block; 79 | width: 60px; 80 | } 81 | input{ 82 | width: 246px; 83 | height: 40px; 84 | font-size: 16px; 85 | margin-left: 6px; 86 | padding-left: 10px; 87 | border: 1px solid #CECECF; 88 | box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.1); 89 | } 90 | input[type="submit"]{ 91 | width: 330px; 92 | height: 50px; 93 | color: #fff; 94 | font-weight: bold; 95 | margin-left: 0; 96 | background: #63c5da; 97 | border-radius: 5px; 98 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, .3); 99 | outline: none; 100 | border: none; 101 | transition: ease-in 0.2s; 102 | } 103 | input[type="submit"]:hover{ 104 | background-color: #56bbd1; 105 | box-shadow: 0 5px 10px 0 rgba(99, 196, 218, 0.8); 106 | 107 | } 108 | input[type="radio"]{ 109 | width: 63px; 110 | height: 18px; 111 | box-shadow: none; 112 | margin-left: 49px; 113 | } 114 | 115 | .email_error{ 116 | color: red; 117 | font-size: 16px; 118 | margin-left: 73px; 119 | } 120 | 121 | .bottom ul{ 122 | float: right; 123 | } 124 | .bottom ul li{ 125 | float: left; 126 | margin-left: 10px; 127 | } 128 | .bottom ul li a{ 129 | color: #005AA0; 130 | } 131 | 132 | -------------------------------------------------------------------------------- /WebRoot/error.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 错误 9 | 10 | 17 | 18 | 19 |
20 |
21 | ${error},将在5秒后跳转到登录界面
22 | 若浏览器无反应点击此处跳转 23 |
24 |
25 | 26 | 39 | -------------------------------------------------------------------------------- /WebRoot/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /WebRoot/font/fontawesome-webfont.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/font/fontawesome-webfont.svgz -------------------------------------------------------------------------------- /WebRoot/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /WebRoot/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /WebRoot/font/fontawesome-webfont_162a16fe.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/font/fontawesome-webfont_162a16fe.eot -------------------------------------------------------------------------------- /WebRoot/forgetPsw.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3 | <% 4 | String path = request.getContextPath(); 5 | String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 6 | %> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 找回密码 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 |
29 |
30 | 找回密码 31 |
32 |
33 | 请输入你的注册邮箱,获取密码。 34 |
35 | 43 |
44 |
45 |
46 | 47 |
48 |
49 | 50 |
51 |
52 |
53 |
54 | 55 | 56 | -------------------------------------------------------------------------------- /WebRoot/js/charts/area.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | // we use an inline data source in the example, usually data would 3 | // be fetched from a server 4 | var data = [], totalPoints = 200; 5 | function getRandomData() { 6 | if (data.length > 0) 7 | data = data.slice(1); 8 | 9 | while (data.length < totalPoints) { 10 | var prev = data.length > 0 ? data[data.length - 1] : 50; 11 | var y = prev + Math.random() * 10 - 5; 12 | if (y < 0) 13 | y = 0; 14 | if (y > 100) 15 | y = 100; 16 | data.push(y); 17 | } 18 | 19 | var res = []; 20 | for (var i = 0; i < data.length; ++i) 21 | res.push([i, data[i]]) 22 | return res; 23 | } 24 | 25 | // setup plot 26 | var options = { 27 | yaxis: { min: 0, max: 100 }, 28 | xaxis: { min: 0, max: 100 }, 29 | colors: ["#F90", "#3C4049", "#666", "#BBB"], 30 | series: { 31 | lines: { 32 | lineWidth: 2, 33 | fill: true, 34 | fillColor: { colors: [ { opacity: 0.6 }, { opacity: 0.2 } ] }, 35 | steps: false 36 | 37 | } 38 | } 39 | }; 40 | 41 | var plot = $.plot($("#area-chart"), [ getRandomData() ], options); 42 | }); -------------------------------------------------------------------------------- /WebRoot/js/charts/bar.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var data = new Array (); 3 | var ds = new Array(); 4 | 5 | data.push ([[1,25],[2,34],[3,37],[4,45],[5,56]]); 6 | data.push ([[1,13],[2,29],[3,25],[4,23],[5,31]]); 7 | data.push ([[1,8],[2,13],[3,19],[4,15],[5,14]]); 8 | data.push ([[1,20],[2,43],[3,29],[4,23],[5,25]]); 9 | 10 | for (var i=0, j=data.length; i'+label+'
'+Math.round(series.percent)+'%'; 20 | }, 21 | threshold: 0.1 22 | } 23 | } 24 | }, 25 | legend: { 26 | show: true, 27 | noColumns: 1, // number of colums in legend table 28 | labelFormatter: null, // fn: string -> string 29 | labelBoxBorderColor: "#888", // border color for the little label boxes 30 | container: null, // container (as jQuery object) to put legend in, null means default on top of graph 31 | position: "ne", // position of default legend container within plot 32 | margin: [5, 10], // distance from grid edge to default legend container within plot 33 | backgroundOpacity: 0 // set to 0 to avoid background 34 | }, 35 | grid: { 36 | hoverable: false, 37 | clickable: false 38 | }, 39 | }); 40 | 41 | }); -------------------------------------------------------------------------------- /WebRoot/js/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 存放对 msui 的 config,需在 zepto 之后 msui 之前加载 3 | * 4 | * Created by bd on 15/12/21. 5 | */ 6 | $.config = { 7 | // 路由功能开关过滤器,返回 false 表示当前点击链接不使用路由 8 | routerFilter: function($link) { 9 | // 某个区域的 a 链接不想使用路由功能 10 | if ($link.is('.disable-router a')) { 11 | return false; 12 | } 13 | 14 | return true; 15 | } 16 | }; 17 | -------------------------------------------------------------------------------- /WebRoot/js/faq.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @name FAQ Plugin 3 | * @author Rod Howard 4 | * @url http://goideate.com 5 | * @date April 28, 2012 6 | * @license GNU/GPL Version 3 7 | * 8 | * 9 | * Example: 10 | * 11 | * $(function() { 12 | * $("element, #id, .class").technify({ 13 | * // #{EDIT-HERE}# Your run-time options go here ... 14 | * }); 15 | * }); 16 | */ 17 | /** 18 | * Create an anonymous function to avoid library conflicts 19 | */ 20 | (function($) { 21 | /** 22 | * Add our plugin to the jQuery.fn object 23 | */ 24 | $.fn.goFaq = function(options) { 25 | /** 26 | * Define some default settings 27 | */ 28 | var defaults = { 29 | enableSearch: true, 30 | enableToc: true, 31 | enableStyling: true, 32 | //numberHtml: '{{#}}.', 33 | numberHtml: '
{{#}}
' 34 | }; 35 | /** 36 | * Merge the runtime options with the default settings 37 | */ 38 | var options = $.extend({}, defaults, options); 39 | /** 40 | * Iterate through the collection of elements and 41 | * return the object to preserve method chaining 42 | */ 43 | return this.each(function(i) { 44 | /** 45 | * Wrap the current element in an instance of jQuery 46 | */ 47 | var $this = $(this); 48 | 49 | var $container = $this.wrap ('
'); 50 | 51 | $this.addClass ('faq-list'); 52 | 53 | if (options.enableSearch) { 54 | var $form = generateSearchForm (); 55 | $form.insertBefore ($this); 56 | } 57 | 58 | if (options.enableToc) { 59 | var $toc = generateToc ($this); 60 | $toc.insertBefore ($this); 61 | } 62 | 63 | 64 | var $empty = generateEmptySearch (); 65 | $empty.appendTo ($container); 66 | 67 | generateAnswerNumbers ($this); 68 | 69 | }); 70 | 71 | function search (e) { 72 | var el, container, filter, count, pattern, container, answers, toc, tocs, empty; 73 | 74 | el = $(this); 75 | container = el.parents ('.faq-container'); 76 | filter = el.val (); 77 | toc = container.find ('.faq-toc'); 78 | answers = container.find ('.faq-list').find ('li'); 79 | tocs = container.find ('.faq-toc').find('li'); 80 | empty = container.find ('.faq-empty'); 81 | pattern = new RegExp (filter, 'i'); 82 | 83 | answers.hide (); 84 | tocs.hide (); 85 | 86 | $.grep (answers.find ('.faq-text'), function (input) { 87 | if (pattern.test ($(input).text ())) { 88 | $(input).parents ('li').show (); 89 | 90 | var index = $(input).parents ('li').index (); 91 | tocs.eq (index).show (); 92 | } 93 | }); 94 | 95 | if (!answers.is (':visible')) { 96 | empty.show (); 97 | toc.hide (); 98 | } else { 99 | empty.hide (); 100 | toc.show (); 101 | } 102 | } 103 | 104 | 105 | function generateEmptySearch () { 106 | var $empty = $('
', { 'class': 'faq-empty' }); 107 | 108 | return $empty.html ('Nothing Found'); 109 | } 110 | 111 | function generateSearchForm () { 112 | 113 | var $form = $('
', { 'class': 'faq-search' }); 114 | var $input = $('', { 'type': 'text', 'name': 'search', 'placeholder': 'Search by Keyword' }); 115 | 116 | $input.appendTo ($form); 117 | 118 | $input.bind ('keyup', search) 119 | 120 | return $form; 121 | } 122 | 123 | function generateAnswerNumbers ($list) { 124 | $list.find ('li').each (function (i) { 125 | var id = parseInt (i+1); 126 | 127 | 128 | $(this).wrapInner ('
'); 129 | 130 | 131 | if (options.enableStyling) { 132 | var icon = '
' + options.numberHtml + '
'; 133 | 134 | icon = icon.replace ('{{#}}', id); 135 | $(this).prepend (icon); 136 | } 137 | }); 138 | } 139 | 140 | function generateToc ($list) { 141 | var html = '
    '; 142 | 143 | $list.find ('li').each (function (i) { 144 | var id = parseInt (i+1); 145 | html += '
  1. ' + id + '. ' + $(this).find ('h4').text () + '
  2. '; 146 | $(this).attr ('id', 'faq-' + id); 147 | }); 148 | 149 | html += '
'; 150 | 151 | var $toc = $('
', { 'class': 'faq-toc' }); 152 | 153 | $toc.html (html); 154 | 155 | return $toc; 156 | 157 | } 158 | }; 159 | })(jQuery); -------------------------------------------------------------------------------- /WebRoot/js/index.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | 3 | //个人信息和用户名之间的间隙~动态变化 4 | var distance=110; // 5 | var width=$('.user').width(); //获取宽度 6 | $('.info').css('right',distance+(width-115)); 7 | 8 | var box_height; 9 | var time=null; 10 | function height_change(){ 11 | time=setInterval(function(){ 12 | box_height=$(document).outerHeight(true); 13 | $('.box').css('height',box_height); 14 | $('.box .box1').css('height',$(window).height()); 15 | },100) 16 | } 17 | height_change(); 18 | 19 | 20 | //菜单栏 21 | $('.menu p').click(function(){ 22 | $(this).parent().find('.second').slideToggle(); 23 | $(this).parent().siblings().find('.second').slideUp(); 24 | $(this).addClass('active'); 25 | $(this).parent().siblings().find('p').removeClass('active'); 26 | }) 27 | 28 | //点击菜单,显示右边内容 29 | $('.menu li').click(function(){ 30 | var id= $(this).attr("id");//获取属性为id的值 31 | if(id!=undefined){ 32 | var str=".content_"+id; 33 | $(str).show().siblings().hide(); 34 | 35 | } 36 | }) 37 | 38 | //用户信息 39 | $('.info ul li:nth-of-type(1)').click(function(e){ 40 | e.stopPropagation(); 41 | $('.alter').fadeToggle(); 42 | 43 | }) 44 | 45 | $('div.info ul li.alter').click(function(e){ 46 | e.stopPropagation(); 47 | }) 48 | 49 | $('#alterInfo').click(function(e){ 50 | e.stopPropagation(); 51 | $('.box').show(); 52 | $('.box_alterInfo').show(); 53 | box.loaduserinfo(); 54 | }) 55 | $('#alterPsw').click(function(e){ 56 | e.stopPropagation(); 57 | $('.box').show(); 58 | $('.box_alterPsw').show(); 59 | }) 60 | $('#showrecords').click(function(e){ 61 | e.stopPropagation(); 62 | $('.box').show(); 63 | $('.box_showrecords').show(); 64 | box.loadrecords(); 65 | }) 66 | 67 | $(document).click(function(e){ 68 | var name=e.target.className; 69 | if(name!="box" && name!="box1" &&name!="x_p" && name!="box_alterInfo" && name!="box_alterPsw" 70 | && name!="box_showrecords"){ 71 | $('.alter').fadeOut(); //点击其他地方,个人信息菜单收起来 72 | } else { 73 | //重置input内容 74 | $('#oldpsw').val(""); 75 | $('#newpsw').val(""); 76 | $('#confirmpsw').val(""); 77 | $("#username").attr("readonly","readonly"); 78 | $("#sex").css("display","block"); 79 | $("#radiosex").css("display","none"); 80 | $("#email").attr("readonly","readonly"); 81 | $("#updateinfo").css("display","block"); 82 | $("#confirmupdate").css("display","none"); 83 | } 84 | if(name=="box"||name=="box1"){ 85 | $('.box').hide(); 86 | $('.box_alterInfo').hide(); 87 | $('.box_alterPsw').hide(); 88 | $('.box_showrecords').hide(); 89 | } 90 | }) 91 | 92 | $('.x p').click(function(){ 93 | $('.box').hide(); 94 | $('.box_alterInfo').hide(); 95 | $('.box_alterPsw').hide(); 96 | $('.box_showrecords').hide(); 97 | 98 | }) 99 | 100 | $("#updateinfo").click(function(){ 101 | $("#username").removeAttr("readonly"); 102 | $("#sex").css("display","none"); 103 | $("#radiosex").css("display","block"); 104 | $("#email").removeAttr("readonly"); 105 | $(this).css("display","none"); 106 | $("#confirmupdate").css("display","block"); 107 | }); 108 | 109 | }); 110 | 111 | function is_email(email){ 112 | reg=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; 113 | if(email == ""){ 114 | return false; 115 | } 116 | else if(! reg.test(email)) { 117 | return false; 118 | } 119 | return true; 120 | }; -------------------------------------------------------------------------------- /WebRoot/js/jquery.flot.orderBars.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Flot plugin to order bars side by side. 3 | * 4 | * Released under the MIT license by Benjamin BUFFET, 20-Sep-2010. 5 | * 6 | * This plugin is an alpha version. 7 | * 8 | * To activate the plugin you must specify the parameter "order" for the specific serie : 9 | * 10 | * $.plot($("#placeholder"), [{ data: [ ... ], bars :{ order = null or integer }]) 11 | * 12 | * If 2 series have the same order param, they are ordered by the position in the array; 13 | * 14 | * The plugin adjust the point by adding a value depanding of the barwidth 15 | * Exemple for 3 series (barwidth : 0.1) : 16 | * 17 | * first bar décalage : -0.15 18 | * second bar décalage : -0.05 19 | * third bar décalage : 0.05 20 | * 21 | */ 22 | 23 | (function($){ 24 | function init(plot){ 25 | var orderedBarSeries; 26 | var nbOfBarsToOrder; 27 | var borderWidth; 28 | var borderWidthInXabsWidth; 29 | var pixelInXWidthEquivalent = 1; 30 | var isHorizontal = false; 31 | 32 | /* 33 | * This method add shift to x values 34 | */ 35 | function reOrderBars(plot, serie, datapoints){ 36 | var shiftedPoints = null; 37 | 38 | if(serieNeedToBeReordered(serie)){ 39 | checkIfGraphIsHorizontal(serie); 40 | calculPixel2XWidthConvert(plot); 41 | retrieveBarSeries(plot); 42 | calculBorderAndBarWidth(serie); 43 | 44 | if(nbOfBarsToOrder >= 2){ 45 | var position = findPosition(serie); 46 | var decallage = 0; 47 | 48 | var centerBarShift = calculCenterBarShift(); 49 | 50 | if (isBarAtLeftOfCenter(position)){ 51 | decallage = -1*(sumWidth(orderedBarSeries,position-1,Math.floor(nbOfBarsToOrder / 2)-1)) - centerBarShift; 52 | }else{ 53 | decallage = sumWidth(orderedBarSeries,Math.ceil(nbOfBarsToOrder / 2),position-2) + centerBarShift + borderWidthInXabsWidth*2; 54 | } 55 | 56 | shiftedPoints = shiftPoints(datapoints,serie,decallage); 57 | datapoints.points = shiftedPoints; 58 | } 59 | } 60 | return shiftedPoints; 61 | } 62 | 63 | function serieNeedToBeReordered(serie){ 64 | return serie.bars != null 65 | && serie.bars.show 66 | && serie.bars.order != null; 67 | } 68 | 69 | function calculPixel2XWidthConvert(plot){ 70 | var gridDimSize = isHorizontal ? plot.getPlaceholder().innerHeight() : plot.getPlaceholder().innerWidth(); 71 | var minMaxValues = isHorizontal ? getAxeMinMaxValues(plot.getData(),1) : getAxeMinMaxValues(plot.getData(),0); 72 | var AxeSize = minMaxValues[1] - minMaxValues[0]; 73 | pixelInXWidthEquivalent = AxeSize / gridDimSize; 74 | } 75 | 76 | function getAxeMinMaxValues(series,AxeIdx){ 77 | var minMaxValues = new Array(); 78 | for(var i = 0; i < series.length; i++){ 79 | minMaxValues[0] = series[i].data[0][AxeIdx]; 80 | minMaxValues[1] = series[i].data[series[i].data.length - 1][AxeIdx]; 81 | } 82 | return minMaxValues; 83 | } 84 | 85 | function retrieveBarSeries(plot){ 86 | orderedBarSeries = findOthersBarsToReOrders(plot.getData()); 87 | nbOfBarsToOrder = orderedBarSeries.length; 88 | } 89 | 90 | function findOthersBarsToReOrders(series){ 91 | var retSeries = new Array(); 92 | 93 | for(var i = 0; i < series.length; i++){ 94 | if(series[i].bars.order != null && series[i].bars.show){ 95 | retSeries.push(series[i]); 96 | } 97 | } 98 | 99 | return retSeries.sort(sortByOrder); 100 | } 101 | 102 | function sortByOrder(serie1,serie2){ 103 | var x = serie1.bars.order; 104 | var y = serie2.bars.order; 105 | return ((x < y) ? -1 : ((x > y) ? 1 : 0)); 106 | } 107 | 108 | function calculBorderAndBarWidth(serie){ 109 | borderWidth = serie.bars.lineWidth ? serie.bars.lineWidth : 2; 110 | borderWidthInXabsWidth = borderWidth * pixelInXWidthEquivalent; 111 | } 112 | 113 | function checkIfGraphIsHorizontal(serie){ 114 | if(serie.bars.horizontal){ 115 | isHorizontal = true; 116 | } 117 | } 118 | 119 | function findPosition(serie){ 120 | var pos = 0 121 | for (var i = 0; i < orderedBarSeries.length; ++i) { 122 | if (serie == orderedBarSeries[i]){ 123 | pos = i; 124 | break; 125 | } 126 | } 127 | 128 | return pos+1; 129 | } 130 | 131 | function calculCenterBarShift(){ 132 | var width = 0; 133 | 134 | if(nbOfBarsToOrder%2 != 0) 135 | width = (orderedBarSeries[Math.ceil(nbOfBarsToOrder / 2)].bars.barWidth)/2; 136 | 137 | return width; 138 | } 139 | 140 | function isBarAtLeftOfCenter(position){ 141 | return position <= Math.ceil(nbOfBarsToOrder / 2); 142 | } 143 | 144 | function sumWidth(series,start,end){ 145 | var totalWidth = 0; 146 | 147 | for(var i = start; i <= end; i++){ 148 | totalWidth += series[i].bars.barWidth+borderWidthInXabsWidth*2; 149 | } 150 | 151 | return totalWidth; 152 | } 153 | 154 | function shiftPoints(datapoints,serie,dx){ 155 | var ps = datapoints.pointsize; 156 | var points = datapoints.points; 157 | var j = 0; 158 | for(var i = isHorizontal ? 1 : 0;i < points.length; i += ps){ 159 | points[i] += dx; 160 | //Adding the new x value in the serie to be abble to display the right tooltip value, 161 | //using the index 3 to not overide the third index. 162 | serie.data[j][3] = points[i]; 163 | j++; 164 | } 165 | 166 | return points; 167 | } 168 | 169 | plot.hooks.processDatapoints.push(reOrderBars); 170 | 171 | } 172 | 173 | var options = { 174 | series : { 175 | bars: {order: null} // or number/string 176 | } 177 | }; 178 | 179 | $.plot.plugins.push({ 180 | init: init, 181 | options: options, 182 | name: "orderBars", 183 | version: "0.2" 184 | }); 185 | 186 | })(jQuery) -------------------------------------------------------------------------------- /WebRoot/js/jquery.flot.resize.js: -------------------------------------------------------------------------------- 1 | /* 2 | Flot plugin for automatically redrawing plots when the placeholder 3 | size changes, e.g. on window resizes. 4 | 5 | It works by listening for changes on the placeholder div (through the 6 | jQuery resize event plugin) - if the size changes, it will redraw the 7 | plot. 8 | 9 | There are no options. If you need to disable the plugin for some 10 | plots, you can just fix the size of their placeholders. 11 | */ 12 | 13 | 14 | /* Inline dependency: 15 | * jQuery resize event - v1.1 - 3/14/2010 16 | * http://benalman.com/projects/jquery-resize-plugin/ 17 | * 18 | * Copyright (c) 2010 "Cowboy" Ben Alman 19 | * Dual licensed under the MIT and GPL licenses. 20 | * http://benalman.com/about/license/ 21 | */ 22 | (function($,h,c){var a=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g()}},teardown:function(){if(!e[f]&&this[k]){return false}var l=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i)}},add:function(l){if(!e[f]&&this[k]){return false}var n;function m(s,o,p){var q=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments)}if($.isFunction(l)){n=l;return m}else{n=l.handler;l.handler=m}}};function g(){i=h[k](function(){a.each(function(){var n=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l])}});g()},e[b])}})(jQuery,this); 23 | 24 | 25 | (function ($) { 26 | var redrawing = 0; 27 | var options = { }; // no options 28 | 29 | function init(plot) { 30 | function bindEvents(plot, eventHolder) { 31 | if (!redrawing) 32 | plot.getPlaceholder().resize(onResize); 33 | 34 | function onResize() { 35 | var placeholder = plot.getPlaceholder(); 36 | 37 | // somebody might have hidden us and we can't plot 38 | // when we don't have the dimensions 39 | if (placeholder.width() == 0 || placeholder.height() == 0) 40 | return; 41 | 42 | ++redrawing; 43 | $.plot(placeholder, plot.getData(), plot.getOptions()); 44 | --redrawing; 45 | } 46 | } 47 | 48 | plot.hooks.bindEvents.push(bindEvents); 49 | } 50 | 51 | $.plot.plugins.push({ 52 | init: init, 53 | options: options, 54 | name: 'resize', 55 | version: '1.0' 56 | }); 57 | })(jQuery); -------------------------------------------------------------------------------- /WebRoot/js/knowledgeAnswer.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/js/knowledgeAnswer.js -------------------------------------------------------------------------------- /WebRoot/js/login_register.js: -------------------------------------------------------------------------------- 1 | $(function(){ 2 | var num=1; 3 | var time=null; 4 | function change(){ //背景图片切换 5 | time=setInterval(function(){ 6 | num++; 7 | if(num>2) num=1; 8 | var str=".bg"+num; 9 | $(str).fadeIn().siblings().fadeOut(); 10 | },3000) 11 | } 12 | change(); 13 | 14 | 15 | //验证邮箱 16 | $('#email').blur(function(){ 17 | var email=$('#email').val(); 18 | if(is_email(email)){ 19 | $('.email_error').html(""); 20 | }else{ 21 | $('.email_error').html("电子邮箱格式不正确"); 22 | } 23 | 24 | }) 25 | 26 | function is_email(email){ 27 | reg=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/; 28 | if(email == ""){ 29 | return false; 30 | } 31 | else if(! reg.test(email)) { 32 | return false; 33 | } 34 | return true; 35 | } 36 | 37 | }) -------------------------------------------------------------------------------- /WebRoot/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 登录 9 | 10 | 11 | 12 | 13 | 14 |
15 | 19 | 48 |
49 | 50 | -------------------------------------------------------------------------------- /WebRoot/register.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 注册 9 | 10 | 11 | 12 | 13 | 14 |
15 | 19 | 56 |
57 | 58 | -------------------------------------------------------------------------------- /WebRoot/resource/images/Exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/Exit.png -------------------------------------------------------------------------------- /WebRoot/resource/images/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/arrow.png -------------------------------------------------------------------------------- /WebRoot/resource/images/arrow_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/arrow_white.png -------------------------------------------------------------------------------- /WebRoot/resource/images/banner_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/banner_01.png -------------------------------------------------------------------------------- /WebRoot/resource/images/banner_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/banner_02.png -------------------------------------------------------------------------------- /WebRoot/resource/images/bg1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/bg1.jpg -------------------------------------------------------------------------------- /WebRoot/resource/images/body-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/body-bg.png -------------------------------------------------------------------------------- /WebRoot/resource/images/content_topic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/content_topic.png -------------------------------------------------------------------------------- /WebRoot/resource/images/find.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/find.jpg -------------------------------------------------------------------------------- /WebRoot/resource/images/headshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/headshot.png -------------------------------------------------------------------------------- /WebRoot/resource/images/icon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/icon1.png -------------------------------------------------------------------------------- /WebRoot/resource/images/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/icon2.png -------------------------------------------------------------------------------- /WebRoot/resource/images/icon_nav_answer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/icon_nav_answer.png -------------------------------------------------------------------------------- /WebRoot/resource/images/icon_nav_people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/icon_nav_people.png -------------------------------------------------------------------------------- /WebRoot/resource/images/icon_tabbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/icon_tabbar.png -------------------------------------------------------------------------------- /WebRoot/resource/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/logo.jpg -------------------------------------------------------------------------------- /WebRoot/resource/images/selection/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/selection/1.png -------------------------------------------------------------------------------- /WebRoot/resource/images/selection/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/selection/2.png -------------------------------------------------------------------------------- /WebRoot/resource/images/selection/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/selection/3.png -------------------------------------------------------------------------------- /WebRoot/resource/images/selection/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malizhigithub/answerWeb/75d419d7396b4085a33f282506422e3c16daa05d/WebRoot/resource/images/selection/4.png -------------------------------------------------------------------------------- /WebRoot/success.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 成功 9 | 10 | 17 | 18 | 19 |
20 |
21 | ${success},将在5秒后跳转到登录界面
22 | 若浏览器无反应点击此处跳转 23 |
24 |
25 | 26 | 39 | -------------------------------------------------------------------------------- /WebRoot/wechatuser/index2.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 9 | 类型 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 43 | 44 | 45 | 46 |
47 |
48 |
49 |
下拉刷新
50 |
释放刷新
51 |
正在刷新
52 |
53 | 71 | 72 | 124 | -------------------------------------------------------------------------------- /config/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 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 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /config/dbconfig.properties: -------------------------------------------------------------------------------- 1 | jdbc.jdbcUrl=jdbc:mysql://xxx.xxx.xxx.xxx:3306/answerWeb?characterEncoding=utf8 2 | jdbc.driverClass=com.mysql.jdbc.Driver 3 | jdbc.user=xxx 4 | jdbc.password=xxx -------------------------------------------------------------------------------- /config/mapper/testMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /config/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /mysqlGeneratorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 54 |
55 |
56 | 57 | 58 | 59 |
60 |
-------------------------------------------------------------------------------- /repository/org/apache/apache/10/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:35 CST 2018 3 | apache-10.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/apache/10/apache-10.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 48296e511366fa13aad48c58d8e09721774abec6 -------------------------------------------------------------------------------- /repository/org/apache/apache/3/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:36 CST 2018 3 | apache-3.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/apache/3/apache-3.pom: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 21 | 4.0.0 22 | 23 | 25 | org.apache 26 | apache 27 | 3 28 | pom 29 | The Apache Software Foundation 30 | 31 | The Apache Software Foundation provides support for the Apache community of open-source software projects. 32 | The Apache projects are characterized by a collaborative, consensus based development process, an open and 33 | pragmatic software license, and a desire to create high quality software that leads the way in its field. 34 | We consider ourselves not simply a group of projects sharing a server, but rather a community of developers 35 | and users. 36 | 37 | 38 | 39 | The Apache Software License, Version 2.0 40 | http://www.apache.org/licenses/LICENSE-2.0.txt 41 | repo 42 | 43 | 44 | 45 | Apache Software Foundation 46 | http://www.apache.org/ 47 | 48 | http://www.apache.org/ 49 | 50 | 51 | apache.snapshots 52 | Apache Snapshot Repository 53 | http://people.apache.org/repo/m2-snapshot-repository 54 | 55 | false 56 | 57 | 58 | 59 | 60 | 61 | 62 | apache.releases 63 | Apache Release Distribution Repository 64 | scp://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository 65 | 66 | 67 | apache.snapshots 68 | Apache Development Snapshot Repository 69 | scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository 70 | 71 | 72 | 73 | 74 | Apache Announce List 75 | announce-subscribe@apache.org 76 | announce-unsubscribe@apache.org 77 | announce@apache.org 78 | http://mail-archives.apache.org/mod_mbox/www-announce/ 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /repository/org/apache/apache/3/apache-3.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 1bc0010136a890e2fd38d901a0b7ecdf0e3f9871 -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-parent/21/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:35 CST 2018 3 | maven-parent-21.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-parent/21/maven-parent-21.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 0ecebf1043d9c7bdd3d32a4184ad4ef9ad3ea744 -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-parent/5/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:36 CST 2018 3 | maven-parent-5.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-parent/5/maven-parent-5.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 5c1ab38decaca1ccd08294aeab135047ebbae00d -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-plugin-api/2.0.6/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:38 CST 2018 3 | maven-plugin-api-2.0.6.pom>alimaven= 4 | maven-plugin-api-2.0.6.jar>alimaven= 5 | -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar.sha1: -------------------------------------------------------------------------------- 1 | 2 | 52b32fd980c8ead7a3858d057330bda1ace72d9d -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 24 | maven 25 | org.apache.maven 26 | 2.0.6 27 | 28 | 4.0.0 29 | maven-plugin-api 30 | Maven Plugin API 31 | 32 | 33 | junit 34 | junit 35 | 3.8.1 36 | test 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 3af72b052dfefb73ecfae742613012b5396c8863 -------------------------------------------------------------------------------- /repository/org/apache/maven/maven/2.0.6/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:36 CST 2018 3 | maven-2.0.6.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/maven/maven/2.0.6/maven-2.0.6.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 1991be0ed3e1820e135201406d5acabf8c08d426 -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-clean-plugin/2.5/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:35 CST 2018 3 | maven-clean-plugin-2.5.jar>alimaven= 4 | maven-clean-plugin-2.5.pom>alimaven= 5 | -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.jar.sha1: -------------------------------------------------------------------------------- 1 | 2 | 75653decaefa85ca8114ff3a4f869bb2ee6d605d -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 22 | 23 | 4.0.0 24 | 25 | 26 | org.apache.maven.plugins 27 | maven-plugins 28 | 22 29 | ../maven-plugins/pom.xml 30 | 31 | 32 | maven-clean-plugin 33 | 2.5 34 | maven-plugin 35 | 36 | Maven Clean Plugin 37 | 38 | The Maven Clean Plugin is a plugin that removes files generated at build-time in a project's directory. 39 | 40 | 2001 41 | 42 | 43 | ${mavenVersion} 44 | 45 | 46 | 47 | scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-clean-plugin-2.5 48 | scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-clean-plugin-2.5 49 | http://svn.apache.org/viewvc/maven/plugins/tags/maven-clean-plugin-2.5 50 | 51 | 52 | JIRA 53 | http://jira.codehaus.org/browse/MCLEAN 54 | 55 | 56 | 57 | 2.0.6 58 | 59 | 60 | 61 | 62 | org.apache.maven 63 | maven-plugin-api 64 | ${mavenVersion} 65 | 66 | 67 | org.codehaus.plexus 68 | plexus-utils 69 | 3.0 70 | 71 | 72 | 73 | 74 | org.apache.maven.shared 75 | maven-plugin-testing-harness 76 | 1.1 77 | test 78 | 79 | 80 | 81 | 82 | 83 | run-its 84 | 85 | 86 | 87 | 88 | org.apache.maven.plugins 89 | maven-invoker-plugin 90 | 91 | true 92 | true 93 | src/it 94 | ${project.build.directory}/it 95 | 96 | */pom.xml 97 | 98 | setup 99 | verify 100 | ${project.build.directory}/local-repo 101 | src/it/settings.xml 102 | 103 | clean 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | 8571a1cd21bed4fe28656c3303526fa7d1e582ad -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-plugins/22/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:35 CST 2018 3 | maven-plugins-22.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | beff44ae4eff1e5c79c01972083cd11fa6982462 -------------------------------------------------------------------------------- /repository/org/codehaus/plexus/plexus-utils/3.0/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:38 CST 2018 3 | plexus-utils-3.0.pom>alimaven= 4 | plexus-utils-3.0.jar>alimaven= 5 | -------------------------------------------------------------------------------- /repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar.sha1: -------------------------------------------------------------------------------- 1 | 2 | d63aa0daf60d573bada235e2b4207617dcf24959 -------------------------------------------------------------------------------- /repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | 19 | 20 | 4.0.0 21 | 22 | 23 | org.sonatype.spice 24 | spice-parent 25 | 16 26 | 27 | 28 | org.codehaus.plexus 29 | plexus-utils 30 | 3.0 31 | 32 | Plexus Common Utilities 33 | A collection of various utility classes to ease working with strings, files, command lines, XML and more. 34 | http://plexus.codehaus.org/plexus-utils 35 | 36 | 37 | scm:git:git@github.com:sonatype/plexus-utils.git 38 | scm:git:git@github.com:sonatype/plexus-utils.git 39 | http://github.com/sonatype/plexus-utils 40 | 41 | 42 | JIRA 43 | http://jira.codehaus.org/browse/PLXUTILS 44 | 45 | 46 | 47 | 48 | plexus-releases 49 | Plexus Release Repository 50 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 51 | 52 | 53 | plexus-snapshots 54 | Plexus Snapshot Repository 55 | ${plexusDistMgmtSnapshotsUrl} 56 | 57 | 58 | codehaus.org 59 | dav:https://dav.codehaus.org/plexus 60 | 61 | 62 | 63 | 64 | 65 | junit 66 | junit 67 | 3.8.2 68 | test 69 | 70 | 71 | 72 | 73 | 74 | 75 | org.apache.maven.plugins 76 | maven-compiler-plugin 77 | 2.3.2 78 | 79 | 1.5 80 | 1.5 81 | 82 | 83 | 84 | org.apache.maven.plugins 85 | maven-release-plugin 86 | 2.1 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-source-plugin 91 | 2.1.2 92 | 93 | 94 | org.apache.maven.plugins 95 | maven-deploy-plugin 96 | 2.6 97 | 98 | 99 | org.apache.maven.plugins 100 | maven-surefire-plugin 101 | 102 | 103 | true 104 | 105 | org/codehaus/plexus/util/FileBasedTestCase.java 106 | **/Test*.java 107 | 108 | 109 | 110 | JAVA_HOME 111 | ${JAVA_HOME} 112 | 113 | 114 | M2_HOME 115 | ${M2_HOME} 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | fe3d8457b0cf4e219fd8e3edad5054b8e38f17b0 -------------------------------------------------------------------------------- /repository/org/sonatype/forge/forge-parent/5/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:37 CST 2018 3 | forge-parent-5.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/sonatype/forge/forge-parent/5/forge-parent-5.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | a557514263bbd4a6daef8f125ab80e78413292d3 -------------------------------------------------------------------------------- /repository/org/sonatype/spice/spice-parent/16/_remote.repositories: -------------------------------------------------------------------------------- 1 | #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. 2 | #Sat Mar 24 09:59:37 CST 2018 3 | spice-parent-16.pom>alimaven= 4 | -------------------------------------------------------------------------------- /repository/org/sonatype/spice/spice-parent/16/spice-parent-16.pom.sha1: -------------------------------------------------------------------------------- 1 | 2 | aefd3135046b7c3f5835283bcc3b670fc46692b9 -------------------------------------------------------------------------------- /src/cn/edu/lingnan/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.controller; 2 | 3 | import java.util.Map; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | 9 | import cn.edu.lingnan.pojo.Admins; 10 | import cn.edu.lingnan.service.AdminsService; 11 | 12 | @Controller 13 | public class AdminController extends BaseController { 14 | 15 | @Autowired 16 | private AdminsService adminsService; 17 | 18 | /** 19 | * 管理员登入 20 | * @param admins 21 | * @param map 22 | * @author lizhi 23 | */ 24 | @RequestMapping("/adminLogin") 25 | public String adminLogin(Admins admins,Map map){ 26 | if(adminsService.login(admins).size()<=0){ 27 | map.put("loginError", "帐号或密码错误"); 28 | return "/admin/login"; 29 | } 30 | super.session.setAttribute("admins", adminsService.login(admins).get(0)); 31 | return "redirect:/selectUserByExample"; 32 | } 33 | 34 | /** 35 | * 更新管理员资料(修改密码) 36 | * @param admins 37 | * @author lizhi 38 | */ 39 | @RequestMapping("/changeAdminPassword") 40 | public String changeAdminPassword(Admins admins){ 41 | adminsService.updateSelective(admins); 42 | return "redirect:/selectUserByExample"; 43 | } 44 | 45 | /** 46 | * 注销 47 | * @return 48 | */ 49 | @RequestMapping("/logout") 50 | public String logout(){ 51 | session.invalidate(); 52 | return "/admin/login"; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/controller/AnswerController.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.HashMap; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | import org.springframework.web.servlet.ModelAndView; 15 | 16 | import cn.edu.lingnan.pojo.Options; 17 | import cn.edu.lingnan.pojo.Question; 18 | import cn.edu.lingnan.pojo.QuestionOption; 19 | import cn.edu.lingnan.pojo.QuestionType; 20 | import cn.edu.lingnan.pojo.User; 21 | import cn.edu.lingnan.pojo.WeChatUser; 22 | import cn.edu.lingnan.service.AnswerService; 23 | 24 | @Controller 25 | public class AnswerController extends BaseController { 26 | 27 | public static final int QUESTION_NUMBER = 10; 28 | 29 | @Autowired 30 | private AnswerService answerService; 31 | 32 | /** 33 | * @author huang 34 | * 获取题目基础类型 35 | */ 36 | @ResponseBody 37 | @RequestMapping(value="user/getType") 38 | public Map getQuestionType() { 39 | Map map = new HashMap(); 40 | List firstlist = answerService.findType(); 41 | if (firstlist.size() <= 0) { 42 | map.put("error", "系统错误:一级菜单获取失败"); 43 | } else { 44 | map.put("firstlist", firstlist); 45 | } 46 | return map; 47 | } 48 | 49 | /** 50 | * @author huang 51 | * 获取题目具体类型 52 | */ 53 | @ResponseBody 54 | @RequestMapping(value="user/getType/{id}") 55 | public Map getQuestionType(@PathVariable int id) { 56 | Map map = new HashMap(); 57 | List secondlist = answerService.findType(id); 58 | if (secondlist.size() <= 0) { 59 | map.put("error", id); 60 | } else { 61 | //判断是否为3级菜单 62 | List thirdList = answerService.findType(secondlist.get(0).getTypeno()); 63 | if(thirdList.size() <= 0) 64 | map.put("grade", "two"); 65 | else 66 | map.put("grade", "third"); 67 | map.put("secondlist", secondlist); 68 | } 69 | return map; 70 | } 71 | 72 | /** 73 | * @author huang 74 | * 根据类型获取题目 75 | */ 76 | @ResponseBody 77 | @RequestMapping(value="user/getQuestion/{typeno}") 78 | public Map getQuestion(@PathVariable int typeno) { 79 | Map map = new HashMap(); 80 | List questionList = answerService.getQuestionByType(typeno); 81 | List questionOptionsList = new ArrayList(); 82 | for (Question q : questionList) { 83 | List optionlist = answerService.getOptionsByQuestion(q.getQuestionno()); 84 | QuestionOption questionOption = new QuestionOption(q,optionlist); 85 | questionOptionsList.add(questionOption); 86 | } 87 | map.put("question",questionOptionsList); 88 | map.put("maxnumber", QUESTION_NUMBER); 89 | map.put("title", answerService.getQuestionTypeByID(typeno).getTypename()); 90 | return map; 91 | } 92 | 93 | /** 94 | * @author huang 95 | * 用户答题更新记录 96 | */ 97 | @RequestMapping(value="user/refreshRecord/{typeno}/{status}") 98 | public void refreshRecord(@PathVariable int typeno, @PathVariable int status){ 99 | User user = (User) super.session.getAttribute("user"); 100 | WeChatUser weuser = (WeChatUser) super.session.getAttribute("weChatUser"); 101 | if (user != null) 102 | answerService.answerRecord(user.getUserno(), typeno, status, 0); 103 | else if (weuser != null) 104 | answerService.answerRecord(weuser.getWechatuserno(), typeno, status, 1); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/controller/BaseController.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.controller; 2 | 3 | import javax.servlet.ServletContext; 4 | import javax.servlet.http.HttpServletRequest; 5 | import javax.servlet.http.HttpServletResponse; 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.springframework.context.ApplicationContext; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | import org.springframework.web.servlet.mvc.support.RedirectAttributes; 11 | 12 | public class BaseController { 13 | 14 | protected HttpServletRequest request; 15 | protected HttpServletResponse response; 16 | protected HttpSession session; 17 | protected RedirectAttributes redirectAttributes; 18 | protected ServletContext application; 19 | 20 | @ModelAttribute 21 | public void setReqAndRes(HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes ) { 22 | this.request = request; 23 | this.response = response; 24 | this.redirectAttributes = redirectAttributes; 25 | this.session = request.getSession(); 26 | this.application = this.session.getServletContext(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/controller/OptionsController.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.controller; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestParam; 10 | 11 | import com.github.pagehelper.PageHelper; 12 | import com.github.pagehelper.PageInfo; 13 | 14 | import cn.edu.lingnan.pojo.Options; 15 | import cn.edu.lingnan.pojo.OptionsExample; 16 | import cn.edu.lingnan.service.OptionsService; 17 | 18 | @Controller 19 | public class OptionsController extends BaseController { 20 | 21 | @Autowired 22 | private OptionsService optionsService; 23 | 24 | /** 25 | * 可根据条件分页查询所有候选答案 26 | * @return 27 | * @author lizhi 28 | */ 29 | @RequestMapping("/selectOptions") 30 | public String selectOptions(OptionsExample options, Map map, 31 | @RequestParam(value = "pn", defaultValue = "1") Integer pn) { 32 | // 每页显示八条数据,且当前页是参数pn 33 | PageHelper.startPage(pn, 8); 34 | List list = optionsService.selectOptionsByExample(options); 35 | // 对数据进行分页处理 36 | PageInfo pageInfo = new PageInfo(list); 37 | map.put("optionsListPageInfo", pageInfo); 38 | // 到时候前端写出网页后再修改到具体的页面 39 | return "admin/index"; 40 | } 41 | 42 | /** 43 | * 更新候选答案 44 | * @return 45 | * @author lizhi 46 | */ 47 | @RequestMapping("/updateOptions") 48 | public String updateOptions(Options options){ 49 | optionsService.updateByPrimaryKey(options); 50 | return "admin/index"; 51 | } 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/controller/RecordsController.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.controller; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.ResponseBody; 12 | 13 | import com.github.pagehelper.PageHelper; 14 | import com.github.pagehelper.PageInfo; 15 | 16 | import cn.edu.lingnan.pojo.Records; 17 | import cn.edu.lingnan.pojo.RecordsExample; 18 | import cn.edu.lingnan.pojo.RecordsExample.Criteria; 19 | import cn.edu.lingnan.service.QuestionTypeService; 20 | import cn.edu.lingnan.service.RecordsService; 21 | 22 | @Controller 23 | public class RecordsController extends BaseController { 24 | 25 | @Autowired 26 | private RecordsService recordsService; 27 | @Autowired 28 | private QuestionTypeService questionTypeService; 29 | 30 | /** 31 | * 对记录表进行分页条件查询 32 | * @param recordsExample 33 | * @param pn 34 | * @param map 35 | * @author lizhi 36 | */ 37 | @RequestMapping("/selectRecords") 38 | public String selectRecords(RecordsExample recordsExample, @RequestParam("pn") Integer pn, 39 | Map map) { 40 | // 每页显示八条数据,且当前页是参数pn 41 | PageHelper.startPage(pn, 8); 42 | List list = recordsService.selectRecordsByExample(recordsExample); 43 | // 对数据进行分页处理 44 | PageInfo pageInfo = new PageInfo(list); 45 | map.put("recordsListPageInfo", pageInfo); 46 | // 到时候前端写出网页后再修改到具体的页面 47 | return "/admin/index"; 48 | } 49 | 50 | /** 51 | * 根据id更新记录表(可用于冲钱用户重置记录) 52 | * @param records 53 | * @author lizhi 54 | */ 55 | @RequestMapping("/updateRecords") 56 | public String updateRecords(Records records){ 57 | recordsService.updateRecords(records); 58 | return "/admin/index"; 59 | } 60 | 61 | /** 62 | * 增加记录(可用于新增用户选择答题类型时添加答题记录) 63 | * @param userNo 64 | * @param typeNo 65 | * @author lizhi 66 | */ 67 | @RequestMapping("/addRecords") 68 | public String addRecords(@RequestParam("userNo") Integer userNo,@RequestParam("typeNo") Integer typeNo){ 69 | Records records = new Records(); 70 | records.setUserno(userNo); 71 | records.setTypeno(typeNo); 72 | recordsService.addRecords(records); 73 | return "/admin/index"; 74 | } 75 | 76 | /** 77 | * 删除记录 78 | * @param userNo 79 | * @author lizhi 80 | */ 81 | @RequestMapping("/deleteRecords") 82 | public String deleteRecords(@RequestParam("userNo") Integer userNo){ 83 | recordsService.deleteRecords(userNo); 84 | return "/admin/index"; 85 | } 86 | 87 | /** 88 | * 微信端个人信息中显示个人答题记录 89 | * @return 90 | */ 91 | @ResponseBody 92 | @RequestMapping("/getAllRecords") 93 | public List getAllRecords(Integer wechatuserno){ 94 | RecordsExample recordsExample = new RecordsExample(); 95 | Criteria criteria = recordsExample.createCriteria(); 96 | criteria.andWechatusernoEqualTo(wechatuserno); 97 | List list = new ArrayList(); 98 | list = recordsService.selectRecordsByExample(recordsExample); 99 | for(int i=0;i map){ 21 | List list = testService.selectTest(); 22 | //springmvc会自动把map中的数据放到请求域中 23 | map.put("testList",list); 24 | return "test"; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/AdminsMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.Admins; 4 | import cn.edu.lingnan.pojo.AdminsExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface AdminsMapper { 9 | long countByExample(AdminsExample example); 10 | 11 | int deleteByExample(AdminsExample example); 12 | 13 | int deleteByPrimaryKey(Integer adminid); 14 | 15 | int insert(Admins record); 16 | 17 | int insertSelective(Admins record); 18 | 19 | List selectByExample(AdminsExample example); 20 | 21 | Admins selectByPrimaryKey(Integer adminid); 22 | 23 | int updateByExampleSelective(@Param("record") Admins record, @Param("example") AdminsExample example); 24 | 25 | int updateByExample(@Param("record") Admins record, @Param("example") AdminsExample example); 26 | 27 | int updateByPrimaryKeySelective(Admins record); 28 | 29 | int updateByPrimaryKey(Admins record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/OptionsMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.Options; 4 | import cn.edu.lingnan.pojo.OptionsExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface OptionsMapper { 9 | long countByExample(OptionsExample example); 10 | 11 | int deleteByExample(OptionsExample example); 12 | 13 | int deleteByPrimaryKey(Integer optionsno); 14 | 15 | int insert(Options record); 16 | 17 | int insertSelective(Options record); 18 | 19 | List selectByExample(OptionsExample example); 20 | 21 | Options selectByPrimaryKey(Integer optionsno); 22 | 23 | int updateByExampleSelective(@Param("record") Options record, @Param("example") OptionsExample example); 24 | 25 | int updateByExample(@Param("record") Options record, @Param("example") OptionsExample example); 26 | 27 | int updateByPrimaryKeySelective(Options record); 28 | 29 | int updateByPrimaryKey(Options record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/QuestionMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.Question; 4 | import cn.edu.lingnan.pojo.QuestionExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface QuestionMapper { 9 | long countByExample(QuestionExample example); 10 | 11 | int deleteByExample(QuestionExample example); 12 | 13 | int deleteByPrimaryKey(Integer questionno); 14 | 15 | int insert(Question record); 16 | 17 | int insertSelective(Question record); 18 | 19 | List selectByExample(QuestionExample example); 20 | 21 | Question selectByPrimaryKey(Integer questionno); 22 | 23 | int updateByExampleSelective(@Param("record") Question record, @Param("example") QuestionExample example); 24 | 25 | int updateByExample(@Param("record") Question record, @Param("example") QuestionExample example); 26 | 27 | int updateByPrimaryKeySelective(Question record); 28 | 29 | int updateByPrimaryKey(Question record); 30 | //从数据库随机获取数据 31 | List randSelectQuestion(@Param("typeno")int typeno, @Param("number")int number); 32 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/QuestionTypeMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.QuestionType; 4 | import cn.edu.lingnan.pojo.QuestionTypeExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface QuestionTypeMapper { 9 | long countByExample(QuestionTypeExample example); 10 | 11 | int deleteByExample(QuestionTypeExample example); 12 | 13 | int deleteByPrimaryKey(Integer typeno); 14 | 15 | int insert(QuestionType record); 16 | 17 | int insertSelective(QuestionType record); 18 | 19 | List selectByExample(QuestionTypeExample example); 20 | 21 | QuestionType selectByPrimaryKey(Integer typeno); 22 | 23 | int updateByExampleSelective(@Param("record") QuestionType record, @Param("example") QuestionTypeExample example); 24 | 25 | int updateByExample(@Param("record") QuestionType record, @Param("example") QuestionTypeExample example); 26 | 27 | int updateByPrimaryKeySelective(QuestionType record); 28 | 29 | int updateByPrimaryKey(QuestionType record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/QuestionTypePlus.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.QuestionType; 4 | 5 | public class QuestionTypePlus { 6 | 7 | private QuestionType questionType; 8 | //第几级目录 9 | private Integer status; 10 | //记录页码数 11 | private Integer pn; 12 | 13 | public QuestionType getQuestionType() { 14 | return questionType; 15 | } 16 | 17 | public void setQuestionType(QuestionType questionType) { 18 | this.questionType = questionType; 19 | } 20 | 21 | public Integer getStatus() { 22 | return status; 23 | } 24 | 25 | public void setStatus(Integer status) { 26 | this.status = status; 27 | } 28 | 29 | public Integer getPn() { 30 | return pn; 31 | } 32 | 33 | public void setPn(Integer pn) { 34 | this.pn = pn; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/RecordsMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.Records; 4 | import cn.edu.lingnan.pojo.RecordsExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface RecordsMapper { 9 | long countByExample(RecordsExample example); 10 | 11 | int deleteByExample(RecordsExample example); 12 | 13 | int deleteByPrimaryKey(Integer recordsno); 14 | 15 | int insert(Records record); 16 | 17 | int insertSelective(Records record); 18 | 19 | List selectByExample(RecordsExample example); 20 | 21 | Records selectByPrimaryKey(Integer recordsno); 22 | 23 | int updateByExampleSelective(@Param("record") Records record, @Param("example") RecordsExample example); 24 | 25 | int updateByExample(@Param("record") Records record, @Param("example") RecordsExample example); 26 | 27 | int updateByPrimaryKeySelective(Records record); 28 | 29 | int updateByPrimaryKey(Records record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/TempUrlMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.TempUrl; 4 | import cn.edu.lingnan.pojo.TempUrlExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface TempUrlMapper { 9 | long countByExample(TempUrlExample example); 10 | 11 | int deleteByExample(TempUrlExample example); 12 | 13 | int deleteByPrimaryKey(Integer tempurlid); 14 | 15 | int insert(TempUrl record); 16 | 17 | int insertSelective(TempUrl record); 18 | 19 | List selectByExample(TempUrlExample example); 20 | 21 | TempUrl selectByPrimaryKey(Integer tempurlid); 22 | 23 | int updateByExampleSelective(@Param("record") TempUrl record, @Param("example") TempUrlExample example); 24 | 25 | int updateByExample(@Param("record") TempUrl record, @Param("example") TempUrlExample example); 26 | 27 | int updateByPrimaryKeySelective(TempUrl record); 28 | 29 | int updateByPrimaryKey(TempUrl record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/TestMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.stereotype.Repository; 6 | 7 | public interface TestMapper { 8 | 9 | // 查询test表 10 | public List selectTest(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/UserMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.User; 4 | import cn.edu.lingnan.pojo.UserExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface UserMapper { 9 | long countByExample(UserExample example); 10 | 11 | int deleteByExample(UserExample example); 12 | 13 | int deleteByPrimaryKey(Integer userno); 14 | 15 | int insert(User record); 16 | 17 | int insertSelective(User record); 18 | 19 | List selectByExample(UserExample example); 20 | 21 | User selectByPrimaryKey(Integer userno); 22 | 23 | int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example); 24 | 25 | int updateByExample(@Param("record") User record, @Param("example") UserExample example); 26 | 27 | int updateByPrimaryKeySelective(User record); 28 | 29 | int updateByPrimaryKey(User record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/dao/WeChatUserMapper.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.dao; 2 | 3 | import cn.edu.lingnan.pojo.WeChatUser; 4 | import cn.edu.lingnan.pojo.WeChatUserExample; 5 | import java.util.List; 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | public interface WeChatUserMapper { 9 | long countByExample(WeChatUserExample example); 10 | 11 | int deleteByExample(WeChatUserExample example); 12 | 13 | int deleteByPrimaryKey(Integer wechatuserno); 14 | 15 | int insert(WeChatUser record); 16 | 17 | int insertSelective(WeChatUser record); 18 | 19 | List selectByExample(WeChatUserExample example); 20 | 21 | WeChatUser selectByPrimaryKey(Integer wechatuserno); 22 | 23 | int updateByExampleSelective(@Param("record") WeChatUser record, @Param("example") WeChatUserExample example); 24 | 25 | int updateByExample(@Param("record") WeChatUser record, @Param("example") WeChatUserExample example); 26 | 27 | int updateByPrimaryKeySelective(WeChatUser record); 28 | 29 | int updateByPrimaryKey(WeChatUser record); 30 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/filter/CommonInterceptor.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.filter; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpServletResponse; 7 | 8 | import org.springframework.web.servlet.HandlerInterceptor; 9 | import org.springframework.web.servlet.ModelAndView; 10 | 11 | public class CommonInterceptor implements HandlerInterceptor { 12 | 13 | private List excludedUrls; 14 | 15 | 16 | @Override 17 | public void afterCompletion(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, Exception arg3) 18 | throws Exception { 19 | // TODO Auto-generated method stub 20 | 21 | } 22 | 23 | @Override 24 | public void postHandle(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2, ModelAndView arg3) 25 | throws Exception { 26 | // TODO Auto-generated method stub 27 | 28 | } 29 | 30 | @Override 31 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object arg2) throws Exception { 32 | 33 | 34 | if (request.getSession().getAttribute("admins") == null) { 35 | String XRequested = request.getHeader("X-Requested-With"); 36 | if ("XMLHttpRequest".equals(XRequested)) { 37 | response.getWriter().write("IsAjax"); 38 | } else { 39 | response.sendRedirect("admin/login.jsp"); 40 | } 41 | return false; 42 | } 43 | return true; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/filter/UserFilter.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.filter; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.Filter; 6 | import javax.servlet.FilterChain; 7 | import javax.servlet.FilterConfig; 8 | import javax.servlet.ServletException; 9 | import javax.servlet.ServletRequest; 10 | import javax.servlet.ServletResponse; 11 | import javax.servlet.http.HttpServletRequest; 12 | import javax.servlet.http.HttpServletResponse; 13 | 14 | /** 15 | * @author huang 16 | * 拦截未登录用户 17 | */ 18 | public class UserFilter implements Filter { 19 | 20 | @Override 21 | public void destroy() { 22 | 23 | } 24 | 25 | @Override 26 | public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) 27 | throws IOException, ServletException { 28 | // HttpServletRequest req = (HttpServletRequest) arg0; 29 | // HttpServletResponse resp = (HttpServletResponse) arg1; 30 | // Object user = req.getSession().getAttribute("user"); 31 | // Object wechatuser = req.getSession().getAttribute("weChatUser"); 32 | // if(user == null && wechatuser == null) 33 | // resp.sendRedirect(req.getContextPath() + "/login.jsp"); 34 | arg2.doFilter(arg0, arg1); 35 | } 36 | 37 | @Override 38 | public void init(FilterConfig arg0) throws ServletException { 39 | 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/Admins.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class Admins { 4 | private Integer adminid; 5 | 6 | private String adminname; 7 | 8 | private String password; 9 | 10 | private Integer adminflag; 11 | 12 | public Integer getAdminid() { 13 | return adminid; 14 | } 15 | 16 | public void setAdminid(Integer adminid) { 17 | this.adminid = adminid; 18 | } 19 | 20 | public String getAdminname() { 21 | return adminname; 22 | } 23 | 24 | public void setAdminname(String adminname) { 25 | this.adminname = adminname == null ? null : adminname.trim(); 26 | } 27 | 28 | public String getPassword() { 29 | return password; 30 | } 31 | 32 | public void setPassword(String password) { 33 | this.password = password == null ? null : password.trim(); 34 | } 35 | 36 | public Integer getAdminflag() { 37 | return adminflag; 38 | } 39 | 40 | public void setAdminflag(Integer adminflag) { 41 | this.adminflag = adminflag; 42 | } 43 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/Options.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class Options { 4 | private Integer optionsno; 5 | 6 | private Integer questionno; 7 | 8 | private String content; 9 | 10 | private Integer status; 11 | 12 | public Integer getOptionsno() { 13 | return optionsno; 14 | } 15 | 16 | public void setOptionsno(Integer optionsno) { 17 | this.optionsno = optionsno; 18 | } 19 | 20 | public Integer getQuestionno() { 21 | return questionno; 22 | } 23 | 24 | public void setQuestionno(Integer questionno) { 25 | this.questionno = questionno; 26 | } 27 | 28 | public String getContent() { 29 | return content; 30 | } 31 | 32 | public void setContent(String content) { 33 | this.content = content == null ? null : content.trim(); 34 | } 35 | 36 | public Integer getStatus() { 37 | return status; 38 | } 39 | 40 | public void setStatus(Integer status) { 41 | this.status = status; 42 | } 43 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/OptionsList.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | import java.util.List; 4 | 5 | public class OptionsList { 6 | 7 | private List optionsList; 8 | 9 | public List getOptionsList() { 10 | return optionsList; 11 | } 12 | 13 | public void setOptionsList(List optionsList) { 14 | this.optionsList = optionsList; 15 | } 16 | 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/Question.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class Question { 4 | private Integer questionno; 5 | 6 | private String content; 7 | 8 | private String description; 9 | 10 | private Integer constatus; 11 | 12 | private Integer desstatus; 13 | 14 | private Integer typeno; 15 | 16 | public Integer getQuestionno() { 17 | return questionno; 18 | } 19 | 20 | public void setQuestionno(Integer questionno) { 21 | this.questionno = questionno; 22 | } 23 | 24 | public String getContent() { 25 | return content; 26 | } 27 | 28 | public void setContent(String content) { 29 | this.content = content == null ? null : content.trim(); 30 | } 31 | 32 | public String getDescription() { 33 | return description; 34 | } 35 | 36 | public void setDescription(String description) { 37 | this.description = description == null ? null : description.trim(); 38 | } 39 | 40 | public Integer getConstatus() { 41 | return constatus; 42 | } 43 | 44 | public void setConstatus(Integer constatus) { 45 | this.constatus = constatus; 46 | } 47 | 48 | public Integer getDesstatus() { 49 | return desstatus; 50 | } 51 | 52 | public void setDesstatus(Integer desstatus) { 53 | this.desstatus = desstatus; 54 | } 55 | 56 | public Integer getTypeno() { 57 | return typeno; 58 | } 59 | 60 | public void setTypeno(Integer typeno) { 61 | this.typeno = typeno; 62 | } 63 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/QuestionOption.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * 7 | * @author huang 8 | * 题目以及题目选项的组合 9 | */ 10 | public class QuestionOption { 11 | 12 | private Question question; //题目 13 | private List option; //选项 14 | 15 | public QuestionOption(Question question, List option){ 16 | this.option = option; 17 | this.question = question; 18 | } 19 | 20 | public Question getQuestion() { 21 | return question; 22 | } 23 | public void setQuestion(Question question) { 24 | this.question = question; 25 | } 26 | public List getOption() { 27 | return option; 28 | } 29 | public void setOption(List option) { 30 | this.option = option; 31 | } 32 | 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/QuestionType.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | import javax.validation.constraints.NotNull; 4 | 5 | public class QuestionType { 6 | private Integer typeno; 7 | @NotNull 8 | private String typename; 9 | 10 | private Integer belongtypeno; 11 | @NotNull 12 | private String imageurl; 13 | 14 | public Integer getTypeno() { 15 | return typeno; 16 | } 17 | 18 | public void setTypeno(Integer typeno) { 19 | this.typeno = typeno; 20 | } 21 | 22 | public String getTypename() { 23 | return typename; 24 | } 25 | 26 | public void setTypename(String typename) { 27 | this.typename = typename == null ? null : typename.trim(); 28 | } 29 | 30 | public Integer getBelongtypeno() { 31 | return belongtypeno; 32 | } 33 | 34 | public void setBelongtypeno(Integer belongtypeno) { 35 | this.belongtypeno = belongtypeno; 36 | } 37 | 38 | public String getImageurl() { 39 | return imageurl; 40 | } 41 | 42 | public void setImageurl(String imageurl) { 43 | this.imageurl = imageurl == null ? null : imageurl.trim(); 44 | } 45 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/Records.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class Records { 4 | private Integer recordsno; 5 | 6 | private Integer userno; 7 | 8 | private Integer typeno; 9 | 10 | private Integer acnumber; 11 | 12 | private Integer erunmber; 13 | 14 | private Integer wechatuserno; 15 | 16 | private String typename; 17 | 18 | public Integer getRecordsno() { 19 | return recordsno; 20 | } 21 | 22 | public void setRecordsno(Integer recordsno) { 23 | this.recordsno = recordsno; 24 | } 25 | 26 | public Integer getUserno() { 27 | return userno; 28 | } 29 | 30 | public void setUserno(Integer userno) { 31 | this.userno = userno; 32 | } 33 | 34 | public Integer getTypeno() { 35 | return typeno; 36 | } 37 | 38 | public void setTypeno(Integer typeno) { 39 | this.typeno = typeno; 40 | } 41 | 42 | public Integer getAcnumber() { 43 | return acnumber; 44 | } 45 | 46 | public void setAcnumber(Integer acnumber) { 47 | this.acnumber = acnumber; 48 | } 49 | 50 | public Integer getErunmber() { 51 | return erunmber; 52 | } 53 | 54 | public void setErunmber(Integer erunmber) { 55 | this.erunmber = erunmber; 56 | } 57 | 58 | public Integer getWechatuserno() { 59 | return wechatuserno; 60 | } 61 | 62 | public void setWechatuserno(Integer wechatuserno) { 63 | this.wechatuserno = wechatuserno; 64 | } 65 | 66 | public String getTypename() { 67 | return typename; 68 | } 69 | 70 | public void setTypename(String typename) { 71 | this.typename = typename; 72 | } 73 | 74 | 75 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/TempUrl.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | import java.util.Date; 4 | 5 | public class TempUrl { 6 | private Integer tempurlid; 7 | 8 | private String fileurl; 9 | 10 | private String newdate; 11 | 12 | 13 | public TempUrl(String fileurl, String newdate) { 14 | this.fileurl = fileurl; 15 | this.newdate = newdate; 16 | } 17 | 18 | public TempUrl(Integer tempurlid, String fileurl, String newdate) { 19 | this.tempurlid = tempurlid; 20 | this.fileurl = fileurl; 21 | this.newdate = newdate; 22 | } 23 | 24 | public Integer getTempurlid() { 25 | return tempurlid; 26 | } 27 | 28 | public void setTempurlid(Integer tempurlid) { 29 | this.tempurlid = tempurlid; 30 | } 31 | 32 | public String getFileurl() { 33 | return fileurl; 34 | } 35 | 36 | public void setFileurl(String fileurl) { 37 | this.fileurl = fileurl == null ? null : fileurl.trim(); 38 | } 39 | 40 | public String getNewdate() { 41 | return newdate; 42 | } 43 | 44 | public void setNewdate(String newdate) { 45 | this.newdate = newdate == null ? null : newdate.trim(); 46 | } 47 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/Test.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class Test { 4 | 5 | public String name; 6 | 7 | public String getName() { 8 | return name; 9 | } 10 | 11 | public void setName(String name) { 12 | this.name = name; 13 | } 14 | 15 | @Override 16 | public String toString() { 17 | return "Test [name=" + name + "]"; 18 | } 19 | 20 | 21 | 22 | 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/UploadFile.java: -------------------------------------------------------------------------------- 1 | 2 | package cn.edu.lingnan.pojo; 3 | 4 | import java.io.ByteArrayInputStream; 5 | import java.io.File; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | import org.springframework.mock.web.MockMultipartHttpServletRequest; 10 | import org.springframework.util.Assert; 11 | import org.springframework.util.FileCopyUtils; 12 | import org.springframework.web.multipart.MultipartFile; 13 | 14 | /** 15 | * Mock implementation of the {@link org.springframework.web.multipart.MultipartFile} 16 | * interface. 17 | * 18 | *

Useful in conjunction with a {@link MockMultipartHttpServletRequest} 19 | * for testing application controllers that access multipart uploads. 20 | * 21 | * @author Juergen Hoeller 22 | * @author Eric Crampton 23 | * @since 2.0 24 | * @see MockMultipartHttpServletRequest 25 | */ 26 | public class UploadFile implements MultipartFile { 27 | 28 | private final String name; 29 | 30 | private String originalFilename; 31 | 32 | private String contentType; 33 | 34 | private final byte[] content; 35 | 36 | 37 | /** 38 | * Create a new MockMultipartFile with the given content. 39 | * @param name the name of the file 40 | * @param content the content of the file 41 | */ 42 | public UploadFile(String name, byte[] content) { 43 | this(name, "", null, content); 44 | } 45 | 46 | /** 47 | * Create a new MockMultipartFile with the given content. 48 | * @param name the name of the file 49 | * @param contentStream the content of the file as stream 50 | * @throws IOException if reading from the stream failed 51 | */ 52 | public UploadFile(String name, InputStream contentStream) throws IOException { 53 | this(name, "", null, FileCopyUtils.copyToByteArray(contentStream)); 54 | } 55 | 56 | /** 57 | * Create a new MockMultipartFile with the given content. 58 | * @param name the name of the file 59 | * @param originalFilename the original filename (as on the client's machine) 60 | * @param contentType the content type (if known) 61 | * @param content the content of the file 62 | */ 63 | public UploadFile(String name, String originalFilename, String contentType, byte[] content) { 64 | Assert.hasLength(name, "Name must not be null"); 65 | this.name = name; 66 | this.originalFilename = (originalFilename != null ? originalFilename : ""); 67 | this.contentType = contentType; 68 | this.content = (content != null ? content : new byte[0]); 69 | } 70 | 71 | /** 72 | * Create a new MockMultipartFile with the given content. 73 | * @param name the name of the file 74 | * @param originalFilename the original filename (as on the client's machine) 75 | * @param contentType the content type (if known) 76 | * @param contentStream the content of the file as stream 77 | * @throws IOException if reading from the stream failed 78 | */ 79 | public UploadFile(String name, String originalFilename, String contentType, InputStream contentStream) 80 | throws IOException { 81 | 82 | this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream)); 83 | } 84 | 85 | @Override 86 | public String getName() { 87 | return this.name; 88 | } 89 | 90 | @Override 91 | public String getOriginalFilename() { 92 | return this.originalFilename; 93 | } 94 | 95 | @Override 96 | public String getContentType() { 97 | return this.contentType; 98 | } 99 | 100 | @Override 101 | public boolean isEmpty() { 102 | return (this.content.length == 0); 103 | } 104 | 105 | @Override 106 | public long getSize() { 107 | return this.content.length; 108 | } 109 | 110 | @Override 111 | public byte[] getBytes() throws IOException { 112 | return this.content; 113 | } 114 | 115 | @Override 116 | public InputStream getInputStream() throws IOException { 117 | return new ByteArrayInputStream(this.content); 118 | } 119 | 120 | @Override 121 | public void transferTo(File dest) throws IOException, IllegalStateException { 122 | FileCopyUtils.copy(this.content, dest); 123 | } 124 | 125 | } 126 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/User.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class User { 4 | private Integer userno; 5 | 6 | private String username; 7 | 8 | private String password; 9 | 10 | private String email; 11 | 12 | private String sex; 13 | 14 | private Integer status; 15 | 16 | private String newdate; 17 | 18 | public Integer getUserno() { 19 | return userno; 20 | } 21 | 22 | public void setUserno(Integer userno) { 23 | this.userno = userno; 24 | } 25 | 26 | public String getUsername() { 27 | return username; 28 | } 29 | 30 | public void setUsername(String username) { 31 | this.username = username == null ? null : username.trim(); 32 | } 33 | 34 | public String getPassword() { 35 | return password; 36 | } 37 | 38 | public void setPassword(String password) { 39 | this.password = password == null ? null : password.trim(); 40 | } 41 | 42 | public String getEmail() { 43 | return email; 44 | } 45 | 46 | public void setEmail(String email) { 47 | this.email = email == null ? null : email.trim(); 48 | } 49 | 50 | public String getSex() { 51 | return sex; 52 | } 53 | 54 | public void setSex(String sex) { 55 | this.sex = sex == null ? null : sex.trim(); 56 | } 57 | 58 | public Integer getStatus() { 59 | return status; 60 | } 61 | 62 | public void setStatus(Integer status) { 63 | this.status = status; 64 | } 65 | 66 | public String getNewdate() { 67 | return newdate; 68 | } 69 | 70 | public void setNewdate(String newdate) { 71 | this.newdate = newdate == null ? null : newdate.trim(); 72 | } 73 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/WeChatUser.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo; 2 | 3 | public class WeChatUser { 4 | private Integer wechatuserno; 5 | 6 | private String openid; 7 | 8 | private String nickname; 9 | 10 | private String sex; 11 | 12 | private String province; 13 | 14 | private String city; 15 | 16 | private String country; 17 | 18 | private String headimgurl; 19 | 20 | private Integer userno; 21 | 22 | @Override 23 | public String toString() { 24 | return "openid=" + openid + "\nnickname=" + nickname 25 | + "\nsex=" + sex + "\nprovince=" + province 26 | + "\ncity=" + city + "\ncountry=" + country 27 | + "\nheadimgurl=" + headimgurl + "\nwechatuserno=" + wechatuserno; 28 | } 29 | 30 | public Integer getWechatuserno() { 31 | return wechatuserno; 32 | } 33 | 34 | public void setWechatuserno(Integer wechatuserno) { 35 | this.wechatuserno = wechatuserno; 36 | } 37 | 38 | public String getOpenid() { 39 | return openid; 40 | } 41 | 42 | public void setOpenid(String openid) { 43 | this.openid = openid == null ? null : openid.trim(); 44 | } 45 | 46 | public String getNickname() { 47 | return nickname; 48 | } 49 | 50 | public void setNickname(String nickname) { 51 | this.nickname = nickname == null ? null : nickname.trim(); 52 | } 53 | 54 | public String getSex() { 55 | return sex; 56 | } 57 | 58 | public void setSex(String sex) { 59 | this.sex = sex == null ? null : sex.trim(); 60 | } 61 | 62 | public String getProvince() { 63 | return province; 64 | } 65 | 66 | public void setProvince(String province) { 67 | this.province = province == null ? null : province.trim(); 68 | } 69 | 70 | public String getCity() { 71 | return city; 72 | } 73 | 74 | public void setCity(String city) { 75 | this.city = city == null ? null : city.trim(); 76 | } 77 | 78 | public String getCountry() { 79 | return country; 80 | } 81 | 82 | public void setCountry(String country) { 83 | this.country = country == null ? null : country.trim(); 84 | } 85 | 86 | public String getHeadimgurl() { 87 | return headimgurl; 88 | } 89 | 90 | public void setHeadimgurl(String headimgurl) { 91 | this.headimgurl = headimgurl == null ? null : headimgurl.trim(); 92 | } 93 | 94 | public Integer getUserno() { 95 | return userno; 96 | } 97 | 98 | public void setUserno(Integer userno) { 99 | this.userno = userno; 100 | } 101 | } -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/wechatpojo/Article.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo.wechatpojo; 2 | 3 | public class Article { 4 | 5 | private String Title; //标题 6 | private String Description; //描述 7 | private String PicUrl; //图片链接 8 | private String Url; //点击后跳转链接 9 | 10 | public String getTitle() { 11 | return Title; 12 | } 13 | public void setTitle(String title) { 14 | this.Title = title; 15 | } 16 | public String getDescription() { 17 | return Description; 18 | } 19 | public void setDescription(String description) { 20 | this.Description = description; 21 | } 22 | public String getPicUrl() { 23 | return PicUrl; 24 | } 25 | public void setPicUrl(String picUrl) { 26 | this.PicUrl = picUrl; 27 | } 28 | public String getUrl() { 29 | return Url; 30 | } 31 | public void setUrl(String url) { 32 | this.Url = url; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/wechatpojo/AutowebParams.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo.wechatpojo; 2 | 3 | /** 4 | * 5 | * @author huang 6 | * 获取微信用户的access_token 7 | */ 8 | 9 | public class AutowebParams { 10 | 11 | private String access_token; 12 | private String expires_in; //使用时间 13 | private String refresh_token; //刷新access_token的id 14 | private String openid; //用户唯一标识 15 | private String scope; //授权作用域 16 | 17 | public String getAccess_token() { 18 | return access_token; 19 | } 20 | public void setAccess_token(String access_token) { 21 | this.access_token = access_token; 22 | } 23 | public String getExpires_in() { 24 | return expires_in; 25 | } 26 | public void setExpires_in(String expires_in) { 27 | this.expires_in = expires_in; 28 | } 29 | public String getRefresh_token() { 30 | return refresh_token; 31 | } 32 | public void setRefresh_token(String refresh_token) { 33 | this.refresh_token = refresh_token; 34 | } 35 | public String getOpenid() { 36 | return openid; 37 | } 38 | public void setOpenid(String openid) { 39 | this.openid = openid; 40 | } 41 | public String getScope() { 42 | return scope; 43 | } 44 | public void setScope(String scope) { 45 | this.scope = scope; 46 | } 47 | 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/wechatpojo/BaseMessage.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo.wechatpojo; 2 | 3 | public class BaseMessage { 4 | 5 | private String ToUserName; //给谁发送 6 | private String FromUserName; //从哪里发送 7 | private long CreateTime; //消息创建时间 8 | private String MsgType; //消息类型 9 | 10 | public String getToUserName() { 11 | return ToUserName; 12 | } 13 | public void setToUserName(String toUserName) { 14 | this.ToUserName = toUserName; 15 | } 16 | public String getFromUserName() { 17 | return FromUserName; 18 | } 19 | public void setFromUserName(String fromUserName) { 20 | this.FromUserName = fromUserName; 21 | } 22 | public long getCreateTime() { 23 | return CreateTime; 24 | } 25 | public void setCreateTime(long createTime) { 26 | this.CreateTime = createTime; 27 | } 28 | public String getMsgType() { 29 | return MsgType; 30 | } 31 | public void setMsgType(String msgType) { 32 | this.MsgType = msgType; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/wechatpojo/NewsMessage.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo.wechatpojo; 2 | 3 | import java.util.List; 4 | 5 | import cn.edu.lingnan.utils.WeChatMessageUtil; 6 | 7 | 8 | public class NewsMessage extends BaseMessage { 9 | 10 | private int ArticleCount; //图文消息数量 11 | private List

Articles; //图文消息 12 | 13 | public NewsMessage(){ 14 | super.setMsgType(WeChatMessageUtil.RESPONR_NEWS_MESSAGE); 15 | } 16 | public NewsMessage(String toUserName, String fromUserName) { 17 | super.setFromUserName(fromUserName); 18 | super.setToUserName(toUserName); 19 | super.setMsgType(WeChatMessageUtil.RESPONR_NEWS_MESSAGE); 20 | } 21 | 22 | public int getArticleCount() { 23 | return ArticleCount; 24 | } 25 | public void setArticleCount(int articleCount) { 26 | this.ArticleCount = articleCount; 27 | } 28 | public List
getArticles() { 29 | return Articles; 30 | } 31 | public void setArticles(List
articles) { 32 | this.Articles = articles; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/pojo/wechatpojo/TextMessage.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.pojo.wechatpojo; 2 | 3 | import cn.edu.lingnan.utils.WeChatMessageUtil; 4 | 5 | public class TextMessage extends BaseMessage { 6 | 7 | private String Content; //文本消息内容 8 | 9 | public TextMessage(){ 10 | super.setMsgType(WeChatMessageUtil.TEXT_MESSAGE); 11 | } 12 | public TextMessage(String toUserName, String fromUserName){ 13 | super.setFromUserName(fromUserName); 14 | super.setToUserName(toUserName); 15 | super.setMsgType(WeChatMessageUtil.TEXT_MESSAGE); 16 | } 17 | 18 | public String getContent() { 19 | return Content; 20 | } 21 | 22 | public void setContent(String content) { 23 | this.Content = content; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/AdminsService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.AdminsMapper; 9 | import cn.edu.lingnan.pojo.Admins; 10 | import cn.edu.lingnan.pojo.AdminsExample; 11 | import cn.edu.lingnan.pojo.AdminsExample.Criteria; 12 | 13 | @Service 14 | public class AdminsService { 15 | 16 | @Autowired 17 | private AdminsMapper adminsMapper; 18 | 19 | public List login(Admins admins) { 20 | AdminsExample adminsExample = new AdminsExample(); 21 | Criteria criteria = adminsExample.createCriteria(); 22 | criteria.andAdminnameEqualTo(admins.getAdminname()); 23 | criteria.andPasswordEqualTo(admins.getPassword()); 24 | return adminsMapper.selectByExample(adminsExample); 25 | } 26 | 27 | 28 | public void updateSelective(Admins admins) { 29 | adminsMapper.updateByPrimaryKeySelective(admins); 30 | } 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/AnswerService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.Collections; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | 10 | import cn.edu.lingnan.controller.AnswerController; 11 | import cn.edu.lingnan.dao.OptionsMapper; 12 | import cn.edu.lingnan.dao.QuestionMapper; 13 | import cn.edu.lingnan.dao.QuestionTypeMapper; 14 | import cn.edu.lingnan.dao.RecordsMapper; 15 | import cn.edu.lingnan.pojo.Options; 16 | import cn.edu.lingnan.pojo.OptionsExample; 17 | import cn.edu.lingnan.pojo.Question; 18 | import cn.edu.lingnan.pojo.QuestionExample; 19 | import cn.edu.lingnan.pojo.QuestionType; 20 | import cn.edu.lingnan.pojo.QuestionTypeExample; 21 | import cn.edu.lingnan.pojo.RecordsExample; 22 | import cn.edu.lingnan.pojo.QuestionTypeExample.Criteria; 23 | import cn.edu.lingnan.pojo.Records; 24 | 25 | @Service 26 | public class AnswerService { 27 | 28 | @Autowired 29 | private QuestionTypeMapper qtypeMapper; 30 | @Autowired 31 | private QuestionMapper questionMapper; 32 | @Autowired 33 | private OptionsMapper optionMapper; 34 | @Autowired 35 | private RecordsMapper recordsMapper; 36 | 37 | /** 38 | * @author huang 39 | * 查询一级菜单 40 | */ 41 | public List findType() { 42 | QuestionTypeExample example = new QuestionTypeExample(); 43 | Criteria criteria = example.createCriteria(); 44 | criteria.andBelongtypenoIsNull(); 45 | List list = qtypeMapper.selectByExample(example); 46 | return list; 47 | } 48 | 49 | /** 50 | * @author huang 51 | * 查询二级菜单 52 | */ 53 | public List findType(int typeID) { 54 | QuestionTypeExample example = new QuestionTypeExample(); 55 | Criteria criteria = example.createCriteria(); 56 | criteria.andBelongtypenoEqualTo(typeID); 57 | List list = qtypeMapper.selectByExample(example); 58 | return list; 59 | } 60 | 61 | /** 62 | * @author huang 63 | * 根据题目类型返回题目 64 | */ 65 | public List getQuestionByType(int typeno) { 66 | QuestionExample questionExample = new QuestionExample(); 67 | cn.edu.lingnan.pojo.QuestionExample.Criteria criteria = questionExample.createCriteria(); 68 | criteria.andTypenoEqualTo(typeno); 69 | List list = questionMapper.randSelectQuestion(typeno, AnswerController.QUESTION_NUMBER); 70 | return list; 71 | } 72 | 73 | /** 74 | * @author huang 75 | * 根据题目获取选项 76 | */ 77 | public List getOptionsByQuestion(int questionno) { 78 | OptionsExample optionsExample = new OptionsExample(); 79 | cn.edu.lingnan.pojo.OptionsExample.Criteria criteria = optionsExample.createCriteria(); 80 | criteria.andQuestionnoEqualTo(questionno); 81 | 82 | List list = optionMapper.selectByExample(optionsExample); 83 | //将list的数据重新随机排列 84 | Collections.shuffle(list); 85 | return list; 86 | } 87 | 88 | /** 89 | * @author huang 90 | * 根据id获取类型名称 91 | */ 92 | public QuestionType getQuestionTypeByID(int typeno) { 93 | return qtypeMapper.selectByPrimaryKey(typeno); 94 | } 95 | 96 | /** 97 | * @author huang 98 | * @param userno 用户编号 99 | * @param typeno 题目类型编号 100 | * @param status 答题情况,1:正确, 2:错误 101 | * 更新用户答题记录 102 | */ 103 | public void answerRecord(int userno, int typeno, int status, int flag) { 104 | //判断用户是否有该类型记录 105 | RecordsExample recordsExample = new RecordsExample(); 106 | cn.edu.lingnan.pojo.RecordsExample.Criteria recordCria = recordsExample.createCriteria(); 107 | if (flag == 0) 108 | recordCria.andUsernoEqualTo(userno).andTypenoEqualTo(typeno); 109 | else 110 | recordCria.andWechatusernoEqualTo(userno).andTypenoEqualTo(typeno); 111 | List recordsList = recordsMapper.selectByExample(recordsExample); 112 | if (recordsList.size() <= 0) { 113 | //不存在就插入一条记录 114 | Records records = new Records(); 115 | records.setTypeno(typeno); 116 | if(flag==0) 117 | records.setUserno(userno); 118 | else 119 | records.setWechatuserno(userno); 120 | if (status == 1) 121 | records.setAcnumber(1); 122 | else 123 | records.setErunmber(1); 124 | recordsMapper.insertSelective(records); 125 | return ; 126 | } else { 127 | //存在就更新记录 128 | Records rec = recordsList.get(0); 129 | if(status == 1) 130 | rec.setAcnumber(rec.getAcnumber()+1); 131 | else 132 | rec.setErunmber(rec.getErunmber()+1); 133 | recordsMapper.updateByPrimaryKey(rec); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/OptionsService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.OptionsMapper; 9 | import cn.edu.lingnan.pojo.Options; 10 | import cn.edu.lingnan.pojo.OptionsExample; 11 | import cn.edu.lingnan.pojo.OptionsExample.Criteria; 12 | 13 | @Service 14 | public class OptionsService { 15 | 16 | @Autowired 17 | private OptionsMapper optionsMapper; 18 | 19 | /** 20 | * 多条件查询 21 | * @param options 22 | * @return 23 | */ 24 | public List selectOptionsByExample(OptionsExample options) { 25 | return optionsMapper.selectByExample(options); 26 | } 27 | 28 | /** 29 | * 更新 30 | * @param options 31 | */ 32 | public void updateByPrimaryKey(Options options) { 33 | optionsMapper.updateByPrimaryKeySelective(options); 34 | } 35 | 36 | 37 | public List getQuestionOptions(Integer questionno){ 38 | OptionsExample example = new OptionsExample(); 39 | Criteria criteria = example.createCriteria(); 40 | criteria.andQuestionnoEqualTo(questionno); 41 | return optionsMapper.selectByExample(example); 42 | } 43 | 44 | public void insert(Options options) { 45 | optionsMapper.insert(options); 46 | } 47 | 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/QuestionService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.QuestionMapper; 9 | import cn.edu.lingnan.pojo.Options; 10 | import cn.edu.lingnan.pojo.Question; 11 | import cn.edu.lingnan.pojo.QuestionExample; 12 | import cn.edu.lingnan.pojo.QuestionExample.Criteria; 13 | 14 | @Service 15 | public class QuestionService { 16 | 17 | @Autowired 18 | private QuestionMapper questionMapper; 19 | 20 | /** 21 | * 多条件查询试题 22 | * @param question 23 | * @author lizhi 24 | */ 25 | public List selectQuestionByExample(Question question) { 26 | QuestionExample example = new QuestionExample(); 27 | Criteria criteria = example.createCriteria(); 28 | if(question.getQuestionno()!=null){ 29 | criteria.andQuestionnoEqualTo(question.getQuestionno()); 30 | } 31 | if(question.getConstatus()!=null&&!question.getConstatus().equals("")){ 32 | criteria.andConstatusEqualTo(question.getConstatus()); 33 | } 34 | if(question.getTypeno()!=null){ 35 | criteria.andTypenoEqualTo(question.getTypeno()); 36 | } 37 | List list = questionMapper.selectByExample(example); 38 | return list; 39 | } 40 | 41 | public void updateByPrimaryKey(Question question) { 42 | questionMapper.updateByPrimaryKeySelective(question); 43 | } 44 | 45 | public void updateSelective(Question question){ 46 | questionMapper.updateByPrimaryKeySelective(question); 47 | } 48 | 49 | 50 | public void insertQuestion(Question question) { 51 | questionMapper.insert(question); 52 | } 53 | 54 | public void deleteQuestion(Integer id) { 55 | questionMapper.deleteByPrimaryKey(id); 56 | } 57 | 58 | public Question getQuestionByKey(Integer questionno) { 59 | return questionMapper.selectByPrimaryKey(questionno); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/RecordsService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.RecordsMapper; 9 | import cn.edu.lingnan.pojo.Records; 10 | import cn.edu.lingnan.pojo.RecordsExample; 11 | 12 | @Service 13 | public class RecordsService { 14 | 15 | @Autowired 16 | private RecordsMapper recordsMapper; 17 | 18 | public List selectRecordsByExample(RecordsExample recordsExample) { 19 | return recordsMapper.selectByExample(recordsExample); 20 | } 21 | 22 | public void updateRecords(Records records) { 23 | recordsMapper.updateByPrimaryKeySelective(records); 24 | } 25 | 26 | public void addRecords(Records records) { 27 | recordsMapper.insert(records); 28 | } 29 | 30 | public void deleteRecords(Integer userNo) { 31 | recordsMapper.deleteByPrimaryKey(userNo); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/TaskService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Date; 5 | import java.util.List; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.context.annotation.Lazy; 9 | import org.springframework.scheduling.annotation.Scheduled; 10 | import org.springframework.stereotype.Component; 11 | 12 | import cn.edu.lingnan.dao.TempUrlMapper; 13 | import cn.edu.lingnan.dao.UserMapper; 14 | import cn.edu.lingnan.pojo.TempUrl; 15 | import cn.edu.lingnan.pojo.TempUrlExample; 16 | import cn.edu.lingnan.pojo.TempUrlExample.Criteria; 17 | import cn.edu.lingnan.pojo.User; 18 | import cn.edu.lingnan.pojo.UserExample; 19 | import cn.edu.lingnan.utils.BOSUtil; 20 | 21 | /** 22 | * 23 | * @author huang 24 | * 定时任务 25 | */ 26 | @Component 27 | @Lazy(false) 28 | public class TaskService { 29 | 30 | @Autowired 31 | private TempUrlMapper tempUrlMapper; 32 | @Autowired 33 | private UserMapper userMapper; 34 | /** 35 | * @author huang 36 | * 定时清理BOS中当前时间5分钟前的文件 37 | */ 38 | @Scheduled(cron="0 0 0/1 * * ?") 39 | public void timerDeleteBosTemp() { 40 | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); 41 | Long nowdate = Long.parseLong(format.format(new Date())); 42 | String oldtime = new Long(nowdate-10000).toString(); 43 | TempUrlExample tempExample = new TempUrlExample(); 44 | Criteria criteria = tempExample.createCriteria(); 45 | criteria.andNewdateLessThan(oldtime); 46 | List tempList = tempUrlMapper.selectByExample(tempExample); 47 | for(TempUrl t : tempList) { 48 | tempUrlMapper.deleteByPrimaryKey(t.getTempurlid()); 49 | BOSUtil.deleteFile("temp/" + t.getFileurl()); 50 | } 51 | } 52 | 53 | /** 54 | * @author huang 55 | * 每天2:30清理一天前没有验证的用户 56 | */ 57 | @Scheduled(cron = "0 30 2 * * ?") 58 | public void timerDeleteNoValidatorUser(){ 59 | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); 60 | Long nowdate = Long.parseLong(format.format(new Date())); 61 | //找出数据库1天前的数据 62 | String oldtime = new Long(nowdate-1000000).toString(); 63 | UserExample userExample = new UserExample(); 64 | cn.edu.lingnan.pojo.UserExample.Criteria criteria = userExample.createCriteria(); 65 | criteria.andNewdateLessThan(oldtime).andStatusEqualTo(0); 66 | userMapper.deleteByExample(userExample); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/TempUrlService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import cn.edu.lingnan.dao.TempUrlMapper; 7 | import cn.edu.lingnan.pojo.TempUrl; 8 | 9 | @Service 10 | public class TempUrlService { 11 | 12 | @Autowired 13 | private TempUrlMapper tempUrlMapper; 14 | 15 | public void addTempUrl(TempUrl tempUrl){ 16 | tempUrlMapper.insertSelective(tempUrl); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/TestService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.TestMapper; 9 | 10 | @Service 11 | public class TestService { 12 | 13 | @Autowired 14 | private TestMapper testMapper; 15 | 16 | public List selectTest(){ 17 | return testMapper.selectTest(); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/UserService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import cn.edu.lingnan.dao.RecordsMapper; 9 | import cn.edu.lingnan.dao.UserMapper; 10 | import cn.edu.lingnan.pojo.Records; 11 | import cn.edu.lingnan.pojo.RecordsExample; 12 | import cn.edu.lingnan.pojo.User; 13 | import cn.edu.lingnan.pojo.UserExample; 14 | import cn.edu.lingnan.pojo.UserExample.Criteria; 15 | 16 | @Service 17 | public class UserService { 18 | 19 | @Autowired 20 | private UserMapper userMapper; 21 | @Autowired 22 | private RecordsMapper recordsMapper; 23 | 24 | /** 25 | * 多条件查询用户 26 | * @param user 27 | * @author lizhi 28 | */ 29 | public List selectUserByExample(User user){ 30 | UserExample example = new UserExample(); 31 | Criteria criteria = example.createCriteria(); 32 | if(user.getUserno()!=null){ 33 | criteria.andUsernoEqualTo(user.getUserno()); 34 | } 35 | if(user.getUsername()!=null&&!user.getUsername().equals("")){ 36 | criteria.andUsernameEqualTo(user.getUsername()); 37 | } 38 | if(user.getPassword()!=null&&!user.getPassword().equals("")){ 39 | criteria.andPasswordEqualTo(user.getPassword()); 40 | } 41 | if(user.getEmail()!=null&&!user.getEmail().equals("")){ 42 | criteria.andEmailEqualTo(user.getEmail()); 43 | } 44 | if(user.getSex()!=null&&!user.getSex().equals("")){ 45 | criteria.andSexEqualTo(user.getSex()); 46 | } 47 | if(user.getStatus()!=null){ 48 | criteria.andStatusEqualTo(user.getStatus()); 49 | } 50 | return userMapper.selectByExample(example); 51 | } 52 | 53 | public void deleteUser(Integer id) { 54 | //1:先删除用户答题记录 55 | recordsMapper.deleteByPrimaryKey(id); 56 | //2:删除用户 57 | userMapper.deleteByPrimaryKey(id); 58 | } 59 | 60 | public void addUser(User user) { 61 | userMapper.insertSelective(user); 62 | } 63 | 64 | public void updateUser(User user) { 65 | userMapper.updateByPrimaryKeySelective(user); 66 | } 67 | 68 | /* 69 | * 登录 70 | */ 71 | public List login(User user){ 72 | UserExample userExample = new UserExample(); 73 | Criteria criteria = userExample.createCriteria(); 74 | criteria.andEmailEqualTo(user.getEmail()).andPasswordEqualTo(user.getPassword()); 75 | return userMapper.selectByExample(userExample); 76 | } 77 | 78 | /* 79 | * 注册 80 | */ 81 | public int register(User user) { 82 | return userMapper.insertSelective(user); 83 | } 84 | 85 | /* 86 | * 根据用户id获取用户信息 87 | */ 88 | public User getUserByUserno(int userno) { 89 | return userMapper.selectByPrimaryKey(userno); 90 | } 91 | 92 | /* 93 | * 用户通过验证 94 | */ 95 | public int confirmValidator(int userno) { 96 | //根据id获取用户对象 97 | User user = getUserByUserno(userno); 98 | //修改验证码 99 | user.setStatus(1); 100 | return userMapper.updateByPrimaryKeySelective(user); 101 | } 102 | 103 | /* 104 | * 根据邮箱判断用户是否存在 105 | */ 106 | public User findUserByEmail(String email) { 107 | UserExample userExample = new UserExample(); 108 | Criteria cri = userExample.createCriteria(); 109 | cri.andEmailEqualTo(email); 110 | List list = userMapper.selectByExample(userExample); 111 | if (list.size() > 0) 112 | return list.get(0); 113 | return null; 114 | } 115 | 116 | /** 117 | * 批量根据用户id删除用户 118 | * @param str_ids 119 | */ 120 | public void deleteBatch(List ids) { 121 | //封装一个条件 122 | UserExample example = new UserExample(); 123 | //条件是什么 124 | Criteria criteria = example.createCriteria(); 125 | //delete from tbl_emp where emp_id in (1,2,3) 126 | criteria.andUsernoIn(ids); 127 | userMapper.deleteByExample(example); 128 | 129 | } 130 | 131 | /** 132 | * @author huang 133 | * @param userno 用户编号 134 | * @return 135 | * 根据用户编号获取用户答题记录 136 | */ 137 | public List getWebUserInfo(int userno){ 138 | RecordsExample recordsExample = new RecordsExample(); 139 | cn.edu.lingnan.pojo.RecordsExample.Criteria criteria = recordsExample.createCriteria(); 140 | criteria.andUsernoEqualTo(userno); 141 | return recordsMapper.selectByExample(recordsExample); 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/service/WeChatService.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.service; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Date; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import javax.servlet.http.HttpServletRequest; 9 | 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Service; 12 | 13 | import cn.edu.lingnan.controller.WeChatController; 14 | import cn.edu.lingnan.dao.RecordsMapper; 15 | import cn.edu.lingnan.dao.WeChatUserMapper; 16 | import cn.edu.lingnan.pojo.Records; 17 | import cn.edu.lingnan.pojo.RecordsExample; 18 | import cn.edu.lingnan.pojo.WeChatUser; 19 | import cn.edu.lingnan.pojo.WeChatUserExample; 20 | import cn.edu.lingnan.pojo.WeChatUserExample.Criteria; 21 | import cn.edu.lingnan.pojo.wechatpojo.Article; 22 | import cn.edu.lingnan.pojo.wechatpojo.NewsMessage; 23 | import cn.edu.lingnan.pojo.wechatpojo.TextMessage; 24 | import cn.edu.lingnan.utils.WeChatMessageUtil; 25 | 26 | @Service 27 | public class WeChatService { 28 | 29 | @Autowired 30 | private WeChatUserMapper weChatUserMapper; 31 | @Autowired 32 | private RecordsMapper recordsMapper; 33 | 34 | //解析用户发来的消息 35 | public String disposeMessage(HttpServletRequest req) { 36 | Map map = WeChatMessageUtil.parseXml(req); 37 | String fromUserName = map.get("FromUserName"); //从什么用户发来 38 | String toUserName = map.get("ToUserName"); //给谁发送 39 | String msgType = map.get("MsgType"); //消息类型 40 | 41 | if (msgType.equals(WeChatMessageUtil.TEXT_MESSAGE)) { 42 | //消息是文本消息 43 | String content = map.get("Content"); 44 | return parseText(content, fromUserName, toUserName); 45 | } else if(msgType.equals(WeChatMessageUtil.REQUEST_EVENT_MESSAGE)) { 46 | //消息是点击菜单事件 47 | String event = map.get("Event"); 48 | if (event.equals("CLICK")) { 49 | String eventKey = map.get("EventKey"); 50 | return clickEvent(eventKey, fromUserName, toUserName); 51 | } else { 52 | return ""; 53 | } 54 | } else { 55 | //其他消息不处理 56 | return ""; 57 | } 58 | } 59 | 60 | /** 61 | * 解析用户发来的消息 62 | * @param str 63 | * @param toUserName 64 | * @param fromUserName 65 | * @return 66 | */ 67 | public String parseText(String str,String toUserName, String fromUserName) { 68 | if (str.equals("帮助")) { 69 | StringBuffer content = new StringBuffer(); 70 | content.append("您好, 请回复下方文字选择功能: \n\n"); 71 | content.append("答题/:B-)\n"); 72 | content.append("回复帮助显示此菜单"); 73 | //封装消息 74 | TextMessage textMessage = new TextMessage(toUserName, fromUserName); 75 | textMessage.setCreateTime(new Date().getTime()); 76 | textMessage.setContent(content.toString()); 77 | return WeChatMessageUtil.textMessageToXml(textMessage); 78 | } else if (str.equals("答题")) { 79 | NewsMessage newsMessage = new NewsMessage(toUserName, fromUserName); 80 | newsMessage.setArticleCount(1); 81 | newsMessage.setCreateTime(new Date().getTime()); 82 | 83 | Article article = new Article(); 84 | article.setDescription("点击进入答题系统"); 85 | article.setPicUrl("http://mmbiz.qpic.cn/mmbiz_jpg/3kesMWorbs7ZpPVv2YjdpSFNe6Z70dSDicAtHJiayT3icTmT3RkAmllficaxYibqbNm08sGPGw5WbmUa2Cvs0fn0GKw/0"); 86 | article.setTitle("答题系统"); 87 | article.setUrl(WeChatController.SERVER + "/AnswerWeb/wechat/authorize"); 88 | 89 | List
list = new ArrayList
(); 90 | list.add(article); 91 | 92 | newsMessage.setArticles(list); 93 | return WeChatMessageUtil.NewsMessageToXml(newsMessage); 94 | } else { 95 | TextMessage textMessage = new TextMessage(toUserName, fromUserName); 96 | textMessage.setCreateTime(new Date().getTime()); 97 | textMessage.setContent(str + "(接收什么返回什么,用于测试)"); 98 | return WeChatMessageUtil.textMessageToXml(textMessage); 99 | } 100 | } 101 | 102 | /** 103 | * @author huang 104 | * @param eventKey 105 | * @param toUserName 106 | * @param fromUserName 107 | * @return 108 | * 公众号菜单的点击事件 109 | */ 110 | public String clickEvent(String eventKey, String toUserName, String fromUserName) { 111 | if (eventKey.equals("MyGame")) 112 | return parseText("答题", toUserName, fromUserName); 113 | else if (eventKey.equals("Menus")) 114 | return parseText("帮助", toUserName, fromUserName); 115 | else 116 | return ""; 117 | } 118 | 119 | /** 120 | * @author huang 121 | * 储存微信用户信息 122 | */ 123 | public void addWeChatUser(WeChatUser wechatuser) { 124 | if (wechatuser.getOpenid() != null) 125 | weChatUserMapper.insertSelective(wechatuser); 126 | } 127 | 128 | /** 129 | * @author huang 130 | * 判断有无微信用户存在 131 | */ 132 | public WeChatUser isExistsUser(WeChatUser wechatuser) { 133 | if(wechatuser.getOpenid() != null) { 134 | WeChatUserExample example = new WeChatUserExample(); 135 | Criteria criteria = example.createCriteria(); 136 | criteria.andOpenidEqualTo(wechatuser.getOpenid()); 137 | List list = weChatUserMapper.selectByExample(example); 138 | if (list.size() > 0) 139 | return list.get(0); 140 | else 141 | return null; 142 | } 143 | return null; 144 | } 145 | 146 | /** 147 | * @author huang 148 | * 获取微信用户答题记录 149 | */ 150 | public List getWeChatUserInfo(int wechatuserno) { 151 | RecordsExample recordsExample = new RecordsExample(); 152 | cn.edu.lingnan.pojo.RecordsExample.Criteria criteria = recordsExample.createCriteria(); 153 | criteria.andWechatusernoEqualTo(wechatuserno); 154 | return recordsMapper.selectByExample(recordsExample); 155 | } 156 | 157 | public void updateWeChatUser(WeChatUser weChatUser) { 158 | weChatUserMapper.updateByPrimaryKeySelective(weChatUser); 159 | } 160 | 161 | /** 162 | * 根据id获取微信用户 163 | * @param wechatuserno 164 | * @return 165 | */ 166 | public WeChatUser getWechatUser(Integer wechatuserno){ 167 | return weChatUserMapper.selectByPrimaryKey(wechatuserno); 168 | } 169 | 170 | 171 | } 172 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/BOSUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.springframework.web.multipart.MultipartFile; 7 | 8 | import com.baidubce.auth.DefaultBceCredentials; 9 | import com.baidubce.services.bos.BosClient; 10 | import com.baidubce.services.bos.BosClientConfiguration; 11 | 12 | /** 13 | * 14 | * @author huang 15 | * 上传数据到百度云BOS对象存储中 16 | */ 17 | public class BOSUtil { 18 | 19 | //private final static String ACCESS_KEY_ID = "xxx"; 20 | //private final static String SECRET_ACCESS_KEY = "xxx"; 21 | private final static String ACCESS_KEY_ID = "xxx"; 22 | private final static String SECRET_ACCESS_KEY = "xxx"; 23 | 24 | private final static String BUCKET_NAME = "cn-malizhi-answerweb"; //上传的文件夹名称 25 | //private final static String BUCKET_NAME = "cn-edu-lingnan"; 26 | 27 | 28 | /** 29 | * @author huang 30 | * @param file 文件对象 31 | * @param path 存储路径,例如/resource/images/type/test.txt 32 | * @return 成功失败 33 | * 将文件上传都BOS对象存储中 34 | */ 35 | public static boolean upload(MultipartFile file, String path) { 36 | //创建BOS client 37 | BosClientConfiguration config = new BosClientConfiguration(); 38 | config.setCredentials(new DefaultBceCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY)); 39 | config.setEndpoint("gz.bcebos.com"); 40 | BosClient client = new BosClient(config); 41 | 42 | try { 43 | InputStream inputStream = file.getInputStream(); 44 | client.putObject(BUCKET_NAME, path, inputStream); 45 | } catch (IOException e) { 46 | e.printStackTrace(); 47 | return false; 48 | } 49 | 50 | /* 测试用例*/ 51 | /*InputStream inputStream = new ByteArrayInputStream("hello java".getBytes()); 52 | client.putObject(BUCKET_NAME, path, inputStream);*/ 53 | return true; 54 | } 55 | 56 | /** 57 | * @author huange 58 | * @param filepath 原文件路径 59 | * @param newpath 移动的路径 60 | * @return 61 | * 移动BOS的文件 62 | */ 63 | public static boolean moveFile(String filepath, String newpath) { 64 | BosClientConfiguration config = new BosClientConfiguration(); 65 | config.setCredentials(new DefaultBceCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY)); 66 | config.setEndpoint("gz.bcebos.com"); 67 | BosClient client = new BosClient(config); 68 | client.copyObject(BUCKET_NAME, filepath, BUCKET_NAME, newpath); 69 | return true; 70 | } 71 | 72 | /** 73 | * @author huang 74 | * @param filepath 删除文件路径 75 | * @return 76 | * 删除BOS文件 77 | */ 78 | public static boolean deleteFile(String filepath) { 79 | BosClientConfiguration config = new BosClientConfiguration(); 80 | config.setCredentials(new DefaultBceCredentials(ACCESS_KEY_ID, SECRET_ACCESS_KEY)); 81 | config.setEndpoint("gz.bcebos.com"); 82 | BosClient client = new BosClient(config); 83 | try { 84 | client.getObjectMetadata(BUCKET_NAME, filepath); 85 | client.deleteObject(BUCKET_NAME, filepath); 86 | } catch (Exception e) { 87 | return false; 88 | } 89 | return true; 90 | } 91 | 92 | public static void main(String[] args) { 93 | for (int i=1; i<=10; i++) { 94 | upload(null, "/temp/text" + i + ".txt"); 95 | } 96 | // moveFile("/temp/text.txt", "/resource/images/ /test.txt"); 97 | // deleteFile("/temp/text.txt"); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/GeneratorSqlmap.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.io.File; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.mybatis.generator.api.MyBatisGenerator; 8 | import org.mybatis.generator.config.Configuration; 9 | import org.mybatis.generator.config.xml.ConfigurationParser; 10 | import org.mybatis.generator.internal.DefaultShellCallback; 11 | 12 | /** 13 | * @version 1.0 14 | * @author huang 15 | * 不知道为什么使用Maven generate-source 反向工程失败, 只能手动来了 16 | */ 17 | 18 | public class GeneratorSqlmap { 19 | 20 | public void generator() throws Exception { 21 | List warnings = new ArrayList(); 22 | boolean overwrite = true; 23 | 24 | File configFile = new File("mysqlGeneratorConfig.xml"); 25 | ConfigurationParser cp = new ConfigurationParser(warnings); 26 | Configuration config = cp.parseConfiguration(configFile); 27 | DefaultShellCallback callback = new DefaultShellCallback(overwrite); 28 | MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings); 29 | myBatisGenerator.generate(null); 30 | } 31 | 32 | public static void main(String[] args) { 33 | try{ 34 | new GeneratorSqlmap().generator(); 35 | } catch (Exception e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/HttpUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.io.InputStreamReader; 4 | import java.io.OutputStreamWriter; 5 | import java.net.MalformedURLException; 6 | import java.net.URL; 7 | 8 | import javax.net.ssl.HttpsURLConnection; 9 | 10 | /** 11 | * 12 | * @author huang 13 | * 根据链接获取微信的json返回值 14 | */ 15 | public class HttpUtil { 16 | 17 | public static String getReturnJson(String url, String osrJson) { 18 | String result = ""; 19 | try { 20 | URL reqURL = new URL(url); 21 | HttpsURLConnection httpsConn = (HttpsURLConnection) reqURL.openConnection(); 22 | if(osrJson != null) { 23 | httpsConn.setDoOutput(true); 24 | OutputStreamWriter osr = new OutputStreamWriter(httpsConn.getOutputStream()); 25 | osr.write(osrJson); 26 | osr.close(); 27 | } 28 | InputStreamReader isr = new InputStreamReader(httpsConn.getInputStream()); 29 | char[] chars = new char[1024]; 30 | int len; 31 | while((len = isr.read(chars)) != -1) { 32 | result += new String(chars, 0, len); 33 | } 34 | isr.close(); 35 | } catch (Exception e) { 36 | e.printStackTrace(); 37 | } 38 | return result; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/MailUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.util.Properties; 4 | 5 | import javax.mail.MessagingException; 6 | import javax.mail.internet.MimeMessage; 7 | 8 | import org.springframework.mail.MailException; 9 | import org.springframework.mail.SimpleMailMessage; 10 | import org.springframework.mail.javamail.JavaMailSenderImpl; 11 | import org.springframework.mail.javamail.MimeMessageHelper; 12 | 13 | public class MailUtil { 14 | 15 | private static String myEmailAccount = "xxxxx"; 16 | private static String myEmailPassword = "xxxxx"; 17 | 18 | private static String myEmailSMTPHost = "smtp.qq.com"; 19 | private static String SMTP = "smtp"; 20 | private static int port = 587; 21 | private static String defaultEncoding = "UTF-8"; 22 | 23 | private static JavaMailSenderImpl senderImpl = new JavaMailSenderImpl(); 24 | private static Properties prop = new Properties(); 25 | 26 | // 验证邮箱 27 | // String html = "" 28 | // + "点击验证邮箱" 29 | // + ""; 30 | 31 | // 修改验证邮箱 32 | 33 | static { 34 | senderImpl.setHost(myEmailSMTPHost); 35 | senderImpl.setProtocol(SMTP); 36 | senderImpl.setUsername(myEmailAccount); 37 | senderImpl.setPassword(myEmailPassword); 38 | senderImpl.setPort(port); 39 | senderImpl.setDefaultEncoding(defaultEncoding); 40 | 41 | prop.put("mail.smtp.auth", true); 42 | prop.put("mail.smtp.timeout", 25000); 43 | prop.put("mail.debug", true); 44 | 45 | senderImpl.setJavaMailProperties(prop); 46 | } 47 | 48 | public static boolean sendFindPasswordMail(String to,String content) { 49 | boolean flag = true; 50 | SimpleMailMessage mailMessage = new SimpleMailMessage(); 51 | mailMessage.setTo(to); 52 | mailMessage.setFrom(myEmailAccount); 53 | mailMessage.setSubject("找回密码"); 54 | mailMessage.setText("您的密码是:" + content); 55 | try { 56 | senderImpl.send(mailMessage); 57 | } catch(MailException e) { 58 | flag = false; 59 | } 60 | return flag; 61 | } 62 | 63 | public static boolean sendValidatorMail(String to,String html) { 64 | boolean flag = true; 65 | MimeMessage mailMessage = senderImpl.createMimeMessage(); 66 | MimeMessageHelper messageHelper = new MimeMessageHelper(mailMessage); 67 | try { 68 | messageHelper.setTo(to); 69 | messageHelper.setFrom(myEmailAccount); 70 | messageHelper.setSubject("邮箱验证"); 71 | messageHelper.setText(html, true); 72 | senderImpl.send(mailMessage); 73 | } catch(Exception e) { 74 | flag = false; 75 | } 76 | return flag; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/SignUtil.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.security.MessageDigest; 4 | import java.security.NoSuchAlgorithmException; 5 | import java.util.Arrays; 6 | 7 | /** 8 | * @author huang 9 | * 对微信发来的验证信息做验证 10 | */ 11 | 12 | public class SignUtil { 13 | 14 | private static String token = "yuanweixin"; 15 | 16 | public static boolean checkSignature(String signature, String timestamp, String nonce) { 17 | String[] arr = new String[] {token, timestamp, nonce}; 18 | Arrays.sort(arr); 19 | StringBuffer content = new StringBuffer(); 20 | for (String str : arr) 21 | content.append(str); 22 | MessageDigest md = null; 23 | String tmpStr = null; 24 | try { 25 | md = MessageDigest.getInstance("SHA-1"); 26 | byte[] digest = md.digest(content.toString().getBytes()); 27 | tmpStr = byteTostr(digest); 28 | } catch (NoSuchAlgorithmException e) { 29 | e.printStackTrace(); 30 | } 31 | content = null; 32 | return tmpStr != null ? tmpStr.equals(signature.toUpperCase()) : false; 33 | } 34 | 35 | public static String byteTostr(byte[] byteArray) { 36 | String strDigest = ""; 37 | for (int i=0; i>> 4) & 0x0F]; 47 | tempArr[1] = Digit[mByte & 0x0F]; 48 | String s = new String(tempArr); 49 | return s; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/cn/edu/lingnan/utils/TransmisstionProtected.java: -------------------------------------------------------------------------------- 1 | package cn.edu.lingnan.utils; 2 | 3 | import java.text.ParseException; 4 | import java.text.SimpleDateFormat; 5 | import java.util.Base64; 6 | import java.util.Date; 7 | import java.util.UUID; 8 | 9 | /** 10 | * 11 | * @author huang 12 | * 用于邮件信息加密 13 | */ 14 | public class TransmisstionProtected { 15 | 16 | /** 17 | * @author huang 18 | * @param uuid 操作唯一标识符 19 | * @return Base64编码的加密字符串 20 | * 对加密信息类进行加密 21 | */ 22 | public static String encodeToString(UUID uuid) { 23 | //拼接字符串 24 | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); 25 | String appid = uuid.toString().replace("-", "") + "-" + format.format(new Date()); 26 | //转化为Base64编码 27 | return Base64.getUrlEncoder().encodeToString(appid.getBytes()); 28 | } 29 | 30 | /** 31 | * @author huang 32 | * @param appid 加密字符串 33 | * @return 34 | * 解密加密信息 35 | */ 36 | public static String[] decodeToStringArray(String appid) { 37 | appid = new String(Base64.getUrlDecoder().decode(appid)); 38 | return appid.split("-"); 39 | } 40 | 41 | /** 42 | * @author huang 43 | * @param args 44 | * @throws InterruptedException 45 | * @throws ParseException 46 | * 用于测试 47 | */ 48 | public static void main(String[] args) throws InterruptedException, ParseException { 49 | System.out.println("----------------加密---------------"); 50 | UUID uuid = UUID.randomUUID(); 51 | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); 52 | String appid = uuid.toString().replace("-", "") + "-" + format.format(new Date()); 53 | System.out.println("appid=" + appid); 54 | byte[] by = appid.getBytes(); 55 | for(int i=0;i"); 59 | } else { 60 | writer.write(text); 61 | } 62 | } 63 | }; 64 | } 65 | }); 66 | 67 | /** 68 | * @author huang 69 | * @param req 70 | * 解析微信发送的xml信息 71 | */ 72 | public static Map parseXml(HttpServletRequest req) { 73 | Map map = new HashMap(); 74 | try { 75 | InputStream inputStream = req.getInputStream(); 76 | SAXReader reader = new SAXReader(); 77 | Document document = reader.read(inputStream); 78 | Element root = document.getRootElement(); 79 | List list = root.elements(); 80 | for(Element e : list) 81 | map.put(e.getName(), e.getText()); 82 | inputStream.close(); 83 | inputStream = null; 84 | } catch (IOException | DocumentException e) { 85 | e.printStackTrace(); 86 | } 87 | return map; 88 | } 89 | 90 | /** 91 | * @author huang 92 | * @param textMessage 93 | * 将文本消息封装为xml返回给微信 94 | */ 95 | public static String textMessageToXml(TextMessage textMessage) { 96 | xstream.alias("xml", textMessage.getClass()); 97 | return xstream.toXML(textMessage); 98 | } 99 | 100 | /** 101 | * @author huang 102 | * @param newsMessage 103 | * 将图文消息封装为xml返回给微信 104 | */ 105 | public static String NewsMessageToXml(NewsMessage newsMessage) { 106 | xstream.alias("xml", newsMessage.getClass()); 107 | xstream.alias("item", new Article().getClass()); 108 | return xstream.toXML(newsMessage); 109 | } 110 | } 111 | --------------------------------------------------------------------------------