From c7d809b09d499d5d2387e5002aaf172aaca56cf3 Mon Sep 17 00:00:00 2001 From: tamguo Date: Fri, 10 Aug 2018 12:39:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E7=9A=84=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tamguo-mms/.classpath | 36 ---- tamguo-mms/.gitignore | 2 +- .../org.eclipse.core.resources.prefs | 4 - .../.settings/org.eclipse.jdt.core.prefs | 5 - .../.settings/org.eclipse.m2e.core.prefs | 4 - tamguo-mms/pom.xml | 165 ------------------ .../src/main/java/com/tamguo/Application.java | 36 ---- .../config/dao/MyMetaObjectHandler.java | 23 --- .../tamguo/config/dao/MybatisPlusConfig.java | 93 ---------- .../tamguo/config/web/ErrorConfigurar.java | 21 --- .../tamguo/config/web/ThymeleafConfig.java | 37 ---- .../java/com/tamguo/config/web/WebConfig.java | 18 -- .../main/java/com/tamguo/utils/PageUtils.java | 151 ---------------- .../java/com/tamguo/utils/ShiroUtils.java | 49 ------ .../com/tamguo/web/ChapterController.java | 37 ---- .../java/com/tamguo/web/CourseController.java | 53 ------ .../java/com/tamguo/web/IndexController.java | 25 --- .../com/tamguo/web/SubjectController.java | 32 ---- .../src/main/resources/application.properties | 61 ------- .../src/main/resources/ehcache-shiro.xml | 11 -- .../main/resources/mappers/CourseMapper.xml | 29 --- .../src/main/resources/mappers/MenuMapper.xml | 23 --- .../main/resources/mappers/QuestionMapper.xml | 25 --- tamguo-mms/src/main/resources/redis.xml | 9 - .../main/resources/static/js/chapter/main.js | 19 -- .../main/resources/static/js/index/main.js | 19 -- .../main/resources/static/js/question/main.js | 19 -- .../src/main/resources/templates/course.html | 73 -------- .../src/main/resources/templates/index.html | 60 ------- .../main/resources/templates/question.html | 93 ---------- .../src/main/resources/templates/subject.html | 60 ------- 31 files changed, 1 insertion(+), 1291 deletions(-) delete mode 100644 tamguo-mms/.classpath delete mode 100644 tamguo-mms/.settings/org.eclipse.jdt.core.prefs delete mode 100644 tamguo-mms/.settings/org.eclipse.m2e.core.prefs delete mode 100644 tamguo-mms/pom.xml delete mode 100644 tamguo-mms/src/main/java/com/tamguo/Application.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/config/dao/MyMetaObjectHandler.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/config/web/ErrorConfigurar.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/utils/PageUtils.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/utils/ShiroUtils.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/web/ChapterController.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/web/CourseController.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/web/IndexController.java delete mode 100644 tamguo-mms/src/main/java/com/tamguo/web/SubjectController.java delete mode 100644 tamguo-mms/src/main/resources/application.properties delete mode 100644 tamguo-mms/src/main/resources/ehcache-shiro.xml delete mode 100644 tamguo-mms/src/main/resources/mappers/CourseMapper.xml delete mode 100644 tamguo-mms/src/main/resources/mappers/MenuMapper.xml delete mode 100644 tamguo-mms/src/main/resources/mappers/QuestionMapper.xml delete mode 100644 tamguo-mms/src/main/resources/redis.xml delete mode 100644 tamguo-mms/src/main/resources/static/js/chapter/main.js delete mode 100644 tamguo-mms/src/main/resources/static/js/index/main.js delete mode 100644 tamguo-mms/src/main/resources/static/js/question/main.js delete mode 100644 tamguo-mms/src/main/resources/templates/course.html delete mode 100644 tamguo-mms/src/main/resources/templates/index.html delete mode 100644 tamguo-mms/src/main/resources/templates/question.html delete mode 100644 tamguo-mms/src/main/resources/templates/subject.html diff --git a/tamguo-mms/.classpath b/tamguo-mms/.classpath deleted file mode 100644 index 16c89cc..0000000 --- a/tamguo-mms/.classpath +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tamguo-mms/.gitignore b/tamguo-mms/.gitignore index b83d222..ae3c172 100644 --- a/tamguo-mms/.gitignore +++ b/tamguo-mms/.gitignore @@ -1 +1 @@ -/target/ +/bin/ diff --git a/tamguo-mms/.settings/org.eclipse.core.resources.prefs b/tamguo-mms/.settings/org.eclipse.core.resources.prefs index 04cfa2c..4824b80 100644 --- a/tamguo-mms/.settings/org.eclipse.core.resources.prefs +++ b/tamguo-mms/.settings/org.eclipse.core.resources.prefs @@ -1,6 +1,2 @@ eclipse.preferences.version=1 -encoding//src/main/java=UTF-8 -encoding//src/main/resources=UTF-8 -encoding//src/test/java=UTF-8 -encoding//src/test/resources=UTF-8 encoding/=UTF-8 diff --git a/tamguo-mms/.settings/org.eclipse.jdt.core.prefs b/tamguo-mms/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d59e09c..0000000 --- a/tamguo-mms/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,5 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tamguo-mms/.settings/org.eclipse.m2e.core.prefs b/tamguo-mms/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index 14b697b..0000000 --- a/tamguo-mms/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/tamguo-mms/pom.xml b/tamguo-mms/pom.xml deleted file mode 100644 index e3096be..0000000 --- a/tamguo-mms/pom.xml +++ /dev/null @@ -1,165 +0,0 @@ - - 4.0.0 - com.tamguo - tamguo-mms - 1.0.0 - - - org.springframework.boot - spring-boot-starter-parent - 2.0.3.RELEASE - - - - - UTF-8 - 1.8 - 2.1.9 - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - org.springframework.boot - spring-boot-starter-jdbc - - - - com.baomidou - mybatis-plus-boot-starter - ${mybatis-plus-boot-starter.version} - - - tomcat-jdbc - org.apache.tomcat - - - - - - net.sourceforge.nekohtml - nekohtml - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-redis - 1.3.8.RELEASE - - - org.springframework.session - spring-session-data-redis - - - com.github.theborakompanioni - thymeleaf-extras-shiro - 1.2.1 - - - com.alibaba - fastjson - 1.2.32 - - - org.apache.shiro - shiro-spring - 1.2.5 - - - org.apache.shiro - shiro-ehcache - 1.2.5 - - - cn.songxinqiang - com.baidu.ueditor - 1.1.2-edit-1.0 - - - commons-codec - commons-codec - - - commons-fileupload - commons-fileupload - 1.3.1 - - - commons-io - commons-io - - - com.alibaba - druid - 1.0.18 - - - mysql - mysql-connector-java - - - org.apache.commons - commons-lang3 - - - com.aliyun - aliyun-java-sdk-dysmsapi - 1.0.0 - - - com.aliyun - aliyun-java-sdk-core - 3.2.8 - - - org.apache.commons - commons-email - 1.5 - - - - com.bladejava - blade-patchca - 1.0.5 - - - - com.tamguo - tamguo-modules-core - 1.0.0 - - - - - - - org.springframework.cloud - spring-cloud-dependencies - Camden.SR6 - pom - import - - - - - - mms - - - org.springframework.boot - spring-boot-maven-plugin - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/java/com/tamguo/Application.java b/tamguo-mms/src/main/java/com/tamguo/Application.java deleted file mode 100644 index d1d90b8..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/Application.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.tamguo; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.http.HttpMessageConverters; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; - -import com.alibaba.fastjson.serializer.SerializerFeature; -import com.alibaba.fastjson.support.config.FastJsonConfig; -import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; - -@SpringBootApplication -@ComponentScan("com.tamguo") -public class Application { - - public static void main(String[] args) { - new SpringApplicationBuilder(Application.class).run(args); - } - - /** - * FastJson替代Jackson - * @return - */ - @Bean - public HttpMessageConverters fastJsonHttpMessageConverters() { - FastJsonHttpMessageConverter fastConverter = new FastJsonHttpMessageConverter(); - FastJsonConfig fastJsonConfig = new FastJsonConfig(); - fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss"); - fastJsonConfig.setSerializerFeatures(SerializerFeature.DisableCircularReferenceDetect); - fastConverter.setFastJsonConfig(fastJsonConfig); - FastJsonHttpMessageConverter converter = fastConverter; - return new HttpMessageConverters(converter); - } - -} diff --git a/tamguo-mms/src/main/java/com/tamguo/config/dao/MyMetaObjectHandler.java b/tamguo-mms/src/main/java/com/tamguo/config/dao/MyMetaObjectHandler.java deleted file mode 100644 index 9b0c21d..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/config/dao/MyMetaObjectHandler.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.tamguo.config.dao; - -import com.baomidou.mybatisplus.mapper.MetaObjectHandler; -import org.apache.ibatis.reflection.MetaObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * 注入公共字段自动填充,任选注入方式即可 - */ -//@Component -public class MyMetaObjectHandler extends MetaObjectHandler { - - protected final static Logger logger = LoggerFactory.getLogger(MyMetaObjectHandler.class); - - @Override - public void insertFill(MetaObject metaObject) { - } - - @Override - public void updateFill(MetaObject metaObject) { - } -} diff --git a/tamguo-mms/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java b/tamguo-mms/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java deleted file mode 100644 index 47d0386..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.tamguo.config.dao; - -import java.util.ArrayList; -import java.util.List; - -import org.mybatis.spring.annotation.MapperScan; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import com.baomidou.mybatisplus.mapper.ISqlInjector; -import com.baomidou.mybatisplus.mapper.LogicSqlInjector; -import com.baomidou.mybatisplus.mapper.MetaObjectHandler; -import com.baomidou.mybatisplus.plugins.PaginationInterceptor; -import com.baomidou.mybatisplus.plugins.PerformanceInterceptor; -import com.baomidou.mybatisplus.plugins.parser.ISqlParser; -import com.baomidou.mybatisplus.plugins.parser.tenant.TenantHandler; -import com.baomidou.mybatisplus.plugins.parser.tenant.TenantSqlParser; - -import net.sf.jsqlparser.expression.Expression; -import net.sf.jsqlparser.expression.LongValue; - -@Configuration -@MapperScan("com.tamguo.modules.*.dao*") -public class MybatisPlusConfig { - - @Bean - public PerformanceInterceptor performanceInterceptor() { - return new PerformanceInterceptor(); - } - - /** - * mybatis-plus分页插件
- * 文档:http://mp.baomidou.com
- */ - @Bean - public PaginationInterceptor paginationInterceptor() { - PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); - paginationInterceptor.setLocalPage(true);// 开启 PageHelper 的支持 - /* - * 【测试多租户】 SQL 解析处理拦截器
- * 这里固定写成住户 1 实际情况你可以从cookie读取,因此数据看不到 【 麻花藤 】 这条记录( 注意观察 SQL )
- */ - List sqlParserList = new ArrayList<>(); - TenantSqlParser tenantSqlParser = new TenantSqlParser(); - tenantSqlParser.setTenantHandler(new TenantHandler() { - @Override - public Expression getTenantId() { - return new LongValue(1L); - } - - @Override - public String getTenantIdColumn() { - return "course_id"; - } - - @Override - public boolean doTableFilter(String tableName) { - // 这里可以判断是否过滤表 - return true; - } - }); - - - sqlParserList.add(tenantSqlParser); - paginationInterceptor.setSqlParserList(sqlParserList); - // 以下过滤方式与 @SqlParser(filter = true) 注解等效 -// paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() { -// @Override -// public boolean doFilter(MetaObject metaObject) { -// MappedStatement ms = PluginUtils.getMappedStatement(metaObject); -// // 过滤自定义查询此时无租户信息约束【 麻花藤 】出现 -// if ("com.baomidou.springboot.mapper.UserMapper.selectListBySQL".equals(ms.getId())) { -// return true; -// } -// return false; -// } -// }); - return paginationInterceptor; - } - - @Bean - public MetaObjectHandler metaObjectHandler(){ - return new MyMetaObjectHandler(); - } - - /** - * 注入sql注入器 - */ - @Bean - public ISqlInjector sqlInjector(){ - return new LogicSqlInjector(); - } -} diff --git a/tamguo-mms/src/main/java/com/tamguo/config/web/ErrorConfigurar.java b/tamguo-mms/src/main/java/com/tamguo/config/web/ErrorConfigurar.java deleted file mode 100644 index 9267271..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/config/web/ErrorConfigurar.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.tamguo.config.web; - -import org.springframework.boot.web.server.ErrorPage; -import org.springframework.boot.web.server.ErrorPageRegistrar; -import org.springframework.boot.web.server.ErrorPageRegistry; -import org.springframework.http.HttpStatus; -import org.springframework.stereotype.Component; - -@Component -public class ErrorConfigurar implements ErrorPageRegistrar { - - @Override - public void registerErrorPages(ErrorPageRegistry registry) { - ErrorPage[] errorPages=new ErrorPage[2]; - errorPages[0]=new ErrorPage(HttpStatus.NOT_FOUND,"/error404"); - errorPages[1]=new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR,"/error500"); - - registry.addErrorPages(errorPages); - } - -} diff --git a/tamguo-mms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java b/tamguo-mms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java deleted file mode 100644 index 65fd509..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/config/web/ThymeleafConfig.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.tamguo.config.web; - -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Resource; - -import org.springframework.context.EnvironmentAware; -import org.springframework.core.env.Environment; -import org.springframework.stereotype.Component; -import org.thymeleaf.spring5.view.ThymeleafViewResolver; - -@Component -public class ThymeleafConfig implements EnvironmentAware{ - - @Resource - private Environment env; - - @Resource - private void configureThymeleafStaticVars(ThymeleafViewResolver viewResolver) { - if(viewResolver != null) { - Map vars = new HashMap<>(); - vars.put("domainName", env.getProperty("domain.name")); - vars.put("adminDomain", env.getProperty("admin.domain.name")); - vars.put("PAPER_TYPE_ZHENTI", "1"); - vars.put("PAPER_TYPE_MONI", "2"); - vars.put("PAPER_TYPE_YATI", "3"); - vars.put("PAPER_TYPE_MINGXIAO", "4"); - viewResolver.setStaticVariables(vars); - } - } - - @Override - public void setEnvironment(Environment environment) { - env = environment; - } - -} diff --git a/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java b/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java deleted file mode 100644 index 9c46b03..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/config/web/WebConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.tamguo.config.web; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; - -@Configuration -public class WebConfig implements WebMvcConfigurer { - - @Value("${file.storage.path}") - private String fileStoragePath; - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - registry.addResourceHandler("/files/**").addResourceLocations("file:"+fileStoragePath); - } -} diff --git a/tamguo-mms/src/main/java/com/tamguo/utils/PageUtils.java b/tamguo-mms/src/main/java/com/tamguo/utils/PageUtils.java deleted file mode 100644 index 9b4bbf0..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/utils/PageUtils.java +++ /dev/null @@ -1,151 +0,0 @@ -package com.tamguo.utils; - -import java.util.ArrayList; -import java.util.List; - -import com.baomidou.mybatisplus.plugins.Page; - -public class PageUtils { - - // 是否下一页按钮 - private Boolean isShowNextBtn = false; - - // 是否上一页按钮 - private Boolean isShowPreBtn = false; - - // 当前页 - private String currPageNum; - - // 页码列表 - private List pageNums; - - // 总页数 - private String totalPage; - - // 总数量 - private String total; - - // 数据 - private List list; - - public static PageUtils getPage(Page page){ - PageUtils pg = new PageUtils(); - if(page.getCurrent() > 1){ - pg.setIsShowPreBtn(true); - } - if(page.getCurrent() < page.getPages()){ - pg.setIsShowNextBtn(true); - } - List pgNums = new ArrayList<>(); - if(page.getPages() > 1){ - if(page.getPages() > 10){ - pgNums.add("1"); - pgNums.add("2"); - pgNums.add("3"); - pgNums.add("..."); - if(page.getCurrent() == page.getPages()){ - pgNums.add(((Integer)(page.getCurrent() - 2)).toString()); - pgNums.add(((Integer)(page.getCurrent() - 1)).toString()); - pgNums.add(((Integer)page.getCurrent()).toString()); - }else{ - pgNums.add(((Integer)(page.getCurrent() - 1)).toString()); - pgNums.add(((Integer)page.getCurrent()).toString()); - pgNums.add(((Integer)(page.getCurrent() + 1)).toString()); - } - }else{ - Integer n = 1; - if(page.getTotal() > 0){ - while(true){ - pgNums.add(n.toString()); - if(n >= page.getPages()){ - break; - } - n ++; - } - } - } - } else { - Integer n = 1; - if(page.getTotal() > 0){ - while(true){ - pgNums.add(n.toString()); - if(n >= page.getPages()){ - break; - } - n ++; - } - } - } - pg.setPageNums(pgNums); - pg.setList(page.getRecords()); - pg.setCurrPageNum(((Integer)page.getCurrent()).toString()); - pg.setTotal(((Integer)page.getTotal()).toString()); - pg.setTotalPage(((Integer)page.getPages()).toString()); - return pg; - } - - - public Boolean getIsShowNextBtn() { - return isShowNextBtn; - } - - public void setIsShowNextBtn(Boolean isShowNextBtn) { - this.isShowNextBtn = isShowNextBtn; - } - - public List getPageNums() { - return pageNums; - } - - public void setPageNums(List pageNums) { - this.pageNums = pageNums; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - - public Boolean getIsShowPreBtn() { - return isShowPreBtn; - } - - - public void setIsShowPreBtn(Boolean isShowPreBtn) { - this.isShowPreBtn = isShowPreBtn; - } - - - public String getCurrPageNum() { - return currPageNum; - } - - - public void setCurrPageNum(String currPageNum) { - this.currPageNum = currPageNum; - } - - - public String getTotalPage() { - return totalPage; - } - - - public void setTotalPage(String totalPage) { - this.totalPage = totalPage; - } - - - public String getTotal() { - return total; - } - - - public void setTotal(String total) { - this.total = total; - } -} \ No newline at end of file diff --git a/tamguo-mms/src/main/java/com/tamguo/utils/ShiroUtils.java b/tamguo-mms/src/main/java/com/tamguo/utils/ShiroUtils.java deleted file mode 100644 index e450f99..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/utils/ShiroUtils.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.tamguo.utils; - -import org.apache.shiro.SecurityUtils; -import org.apache.shiro.session.Session; -import org.apache.shiro.subject.Subject; - -import com.tamguo.modules.member.model.MemberEntity; - -public class ShiroUtils { - - public static Session getSession() { - return SecurityUtils.getSubject().getSession(); - } - - public static Subject getSubject() { - return SecurityUtils.getSubject(); - } - - public static MemberEntity getMember() { - return (MemberEntity)SecurityUtils.getSubject().getPrincipal(); - } - - public static String getMemberId() { - return getMember().getId(); - } - - public static void setSessionAttribute(Object key, Object value) { - getSession().setAttribute(key, value); - } - - public static Object getSessionAttribute(Object key) { - return getSession().getAttribute(key); - } - - public static boolean isLogin() { - return SecurityUtils.getSubject().getPrincipal() != null; - } - - public static void logout() { - SecurityUtils.getSubject().logout(); - } - - public static String getKaptcha(String key) { - String kaptcha = getSessionAttribute(key).toString(); -// getSession().removeAttribute(key); - return kaptcha; - } - -} diff --git a/tamguo-mms/src/main/java/com/tamguo/web/ChapterController.java b/tamguo-mms/src/main/java/com/tamguo/web/ChapterController.java deleted file mode 100644 index 99b9d89..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/web/ChapterController.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.tamguo.web; - -import java.util.Arrays; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView;import com.baomidou.mybatisplus.mapper.Condition; -import com.baomidou.mybatisplus.plugins.Page; -import com.tamguo.modules.tiku.model.ChapterEntity; -import com.tamguo.modules.tiku.model.QuestionEntity; -import com.tamguo.modules.tiku.service.IChapterService; -import com.tamguo.modules.tiku.service.IQuestionService; - -@Controller -public class ChapterController { - - @Autowired - private IChapterService iChapterService; - @Autowired - private IQuestionService iQuestionService; - - @SuppressWarnings("unchecked") - @RequestMapping(path="chapter/{chapterId}-{current}-{size}.html") - public ModelAndView list(@PathVariable String chapterId , @PathVariable Integer current - , @PathVariable Integer size, ModelAndView model) { - ChapterEntity chapter = iChapterService.selectById(chapterId); - Page page = iQuestionService.selectPage(new Page<>(current, size) , Condition.create().eq("chapter_id", chapterId).orderDesc(Arrays.asList("id"))); - model.addObject("chapter", chapter); - model.addObject("page", page); - model.addObject("nextPage", current == page.getPages() ? page.getPages() : current+1); - model.addObject("prePage", current == 1 ? 1 : current - 1); - model.setViewName("question"); - return model; - } -} diff --git a/tamguo-mms/src/main/java/com/tamguo/web/CourseController.java b/tamguo-mms/src/main/java/com/tamguo/web/CourseController.java deleted file mode 100644 index 34e93a7..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/web/CourseController.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.tamguo.web; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.baomidou.mybatisplus.mapper.Condition; -import com.tamguo.modules.tiku.model.BookEntity; -import com.tamguo.modules.tiku.model.ChapterEntity; -import com.tamguo.modules.tiku.model.CourseEntity; -import com.tamguo.modules.tiku.service.IBookService; -import com.tamguo.modules.tiku.service.IChapterService; -import com.tamguo.modules.tiku.service.ICourseService; - -@Controller -public class CourseController { - - @Autowired - private ICourseService iCourseService; - @Autowired - private IBookService iBookService; - @Autowired - private IChapterService iChapterService; - - @SuppressWarnings("unchecked") - @RequestMapping(path= {"course/{courseId}.html"}) - public ModelAndView list(@PathVariable String courseId , ModelAndView model) { - CourseEntity course = iCourseService.selectById(courseId); - List bookList = iBookService.selectList(Condition.create().eq("course_id", courseId)); - List chapterList = null; - if(bookList.size() > 0) { - chapterList = iChapterService.selectList(Condition.create().eq("book_id", bookList.get(0).getId())); - } - model.addObject("course", course); - model.addObject("chapterList", chapterList); - model.addObject("subjectId", course.getSubjectId()); - model.addObject("courseId", course.getId()); - model.setViewName("course"); - return model; - } - - public ICourseService getiCourseService() { - return iCourseService; - } - - public void setiCourseService(ICourseService iCourseService) { - this.iCourseService = iCourseService; - } -} diff --git a/tamguo-mms/src/main/java/com/tamguo/web/IndexController.java b/tamguo-mms/src/main/java/com/tamguo/web/IndexController.java deleted file mode 100644 index 937b255..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/web/IndexController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.tamguo.web; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.baomidou.mybatisplus.mapper.Condition; -import com.tamguo.modules.tiku.service.ISubjectService; - -@Controller -public class IndexController { - - @Autowired - private ISubjectService iSubjectService; - - @SuppressWarnings("unchecked") - @RequestMapping(path= {"index","/"}) - public ModelAndView index(ModelAndView model) { - model.setViewName("index"); - model.addObject("subjectList", iSubjectService.selectList(Condition.EMPTY)); - return model; - } - -} diff --git a/tamguo-mms/src/main/java/com/tamguo/web/SubjectController.java b/tamguo-mms/src/main/java/com/tamguo/web/SubjectController.java deleted file mode 100644 index 4299cf1..0000000 --- a/tamguo-mms/src/main/java/com/tamguo/web/SubjectController.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.tamguo.web; - -import java.util.Arrays; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import com.baomidou.mybatisplus.mapper.Condition; -import com.tamguo.modules.tiku.service.ICourseService; -import com.tamguo.modules.tiku.service.ISubjectService; - -@Controller -public class SubjectController { - - @Autowired - private ICourseService iCourseService; - @Autowired - private ISubjectService iSubjectService; - - @SuppressWarnings("unchecked") - @RequestMapping(path= {"subject/{subjectId}.html"}) - public ModelAndView list(@PathVariable String subjectId , ModelAndView model) { - model.setViewName("subject"); - model.addObject("subject", iSubjectService.selectById(subjectId)); - model.addObject("courseList", iCourseService.selectList(Condition.create().eq("subject_id", subjectId).orderAsc(Arrays.asList("sort")))); - return model; - } - -} diff --git a/tamguo-mms/src/main/resources/application.properties b/tamguo-mms/src/main/resources/application.properties deleted file mode 100644 index bf41d2f..0000000 --- a/tamguo-mms/src/main/resources/application.properties +++ /dev/null @@ -1,61 +0,0 @@ -domain.name=http://localhost:8084/ -server.port=8084 -jasypt.encryptor.password=tamguo - -spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 -spring.datasource.driver-class-name=com.mysql.jdbc.Driver -spring.datasource.filters=stat,wall,log4j -spring.datasource.initialSize=5 -spring.datasource.maxActive=20 -spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 -spring.datasource.maxWait=60000 -spring.datasource.minEvictableIdleTimeMillis=300000 -spring.datasource.minIdle=5 -spring.datasource.password=Tanguo -spring.datasource.poolPreparedStatements=true -spring.datasource.testOnBorrow=false -spring.datasource.testOnReturn=false -spring.datasource.testWhileIdle=true -spring.datasource.timeBetweenEvictionRunsMillis=60000 -spring.datasource.type=com.alibaba.druid.pool.DruidDataSource -spring.datasource.url=jdbc:mysql://47.100.175.14:3306/tamguo?useUnicode=true&characterEncoding=UTF-8&useSSL=false -spring.datasource.username=root -spring.datasource.validationQuery=SELECT 1 FROM DUAL - -mybatis-plus.mapper-locations=classpath:/mappers/*Mapper.xml -mybatis-plus.typeAliasesPackage=com.tamguo.modules.*.model -mybatis-plus.typeEnumsPackage=com.tamguo.modules.*.model.enums -mybatis-plus.global-config.id-type=5 -mybatis-plus.global-config.field-strategy=2 -mybatis-plus.global-config.db-column-underline=true -mybatis-plus.global-config.refresh-mapper=true -mybatis-plus.global-config.key-generator=com.baomidou.mybatisplus.incrementer.H2KeyGenerator -mybatis-plus.global-config.logic-delete-value=0 -mybatis-plus.global-config.logic-not-delete-value=1 -mybatis-plus.global-config.sql-injector=com.baomidou.mybatisplus.mapper.LogicSqlInjector -mybatis-plus.global-config.meta-object-handler=com.tamguo.config.dao.MyMetaObjectHandler -mybatis-plus.global-config.sql-parser-cache=true -mybatis-plus.configuration.map-underscore-to-camel-case=true -mybatis-plus.configuration.cache-enabled=false - -spring.thymeleaf.prefix=classpath:/templates/ -spring.thymeleaf.suffix=.html -spring.thymeleaf.mode=LEGACYHTML5 -spring.thymeleaf.encoding=UTF-8 -spring.thymeleaf.content-type=text/html -spring.thymeleaf.cache=false - -redis.hostname=127.0.0.1 -redis.port=6379 -redis.password= - -logging.level.root=INFO -logging.level.org.springframework.web=INFO -logging.file=/home/webdata/log/tamguo.log -logging.pattern.console=%d{yyyy/MM/dd-HH:mm:ss} [%thread] %-5level %logger- %msg%n -logging.pattern.file=%d{yyyy/MM/dd-HH:mm} [%thread] %-5level %logger- %msg%n - -server.compression.enabled=true -server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain - -file.storage.path=/home/webdata/files/ \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/ehcache-shiro.xml b/tamguo-mms/src/main/resources/ehcache-shiro.xml deleted file mode 100644 index 03ae4ff..0000000 --- a/tamguo-mms/src/main/resources/ehcache-shiro.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/mappers/CourseMapper.xml b/tamguo-mms/src/main/resources/mappers/CourseMapper.xml deleted file mode 100644 index 451d633..0000000 --- a/tamguo-mms/src/main/resources/mappers/CourseMapper.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/mappers/MenuMapper.xml b/tamguo-mms/src/main/resources/mappers/MenuMapper.xml deleted file mode 100644 index f71e955..0000000 --- a/tamguo-mms/src/main/resources/mappers/MenuMapper.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/mappers/QuestionMapper.xml b/tamguo-mms/src/main/resources/mappers/QuestionMapper.xml deleted file mode 100644 index c6c7211..0000000 --- a/tamguo-mms/src/main/resources/mappers/QuestionMapper.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/redis.xml b/tamguo-mms/src/main/resources/redis.xml deleted file mode 100644 index ed04f74..0000000 --- a/tamguo-mms/src/main/resources/redis.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/static/js/chapter/main.js b/tamguo-mms/src/main/resources/static/js/chapter/main.js deleted file mode 100644 index 3013f96..0000000 --- a/tamguo-mms/src/main/resources/static/js/chapter/main.js +++ /dev/null @@ -1,19 +0,0 @@ -var vm = new Vue({ - el:'#app', - data : { - docked: false, - open: false, - position: 'left', - panel: '', - total:0, - question:{}, - topUrl:"", - nextUrl:null, - warnOpen:false, - warnMessage:'', - courseList:[] - }, - methods:{ - - } -}); \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/static/js/index/main.js b/tamguo-mms/src/main/resources/static/js/index/main.js deleted file mode 100644 index 3013f96..0000000 --- a/tamguo-mms/src/main/resources/static/js/index/main.js +++ /dev/null @@ -1,19 +0,0 @@ -var vm = new Vue({ - el:'#app', - data : { - docked: false, - open: false, - position: 'left', - panel: '', - total:0, - question:{}, - topUrl:"", - nextUrl:null, - warnOpen:false, - warnMessage:'', - courseList:[] - }, - methods:{ - - } -}); \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/static/js/question/main.js b/tamguo-mms/src/main/resources/static/js/question/main.js deleted file mode 100644 index 3013f96..0000000 --- a/tamguo-mms/src/main/resources/static/js/question/main.js +++ /dev/null @@ -1,19 +0,0 @@ -var vm = new Vue({ - el:'#app', - data : { - docked: false, - open: false, - position: 'left', - panel: '', - total:0, - question:{}, - topUrl:"", - nextUrl:null, - warnOpen:false, - warnMessage:'', - courseList:[] - }, - methods:{ - - } -}); \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/templates/course.html b/tamguo-mms/src/main/resources/templates/course.html deleted file mode 100644 index 4c90d1a..0000000 --- a/tamguo-mms/src/main/resources/templates/course.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - 探果题库_聪明的学生都在这里 - - - - - - - - - - - -
- - - - - 探果题库 - - 登录 - 注册 - - - - - - - - Sent mail - - - - - List Item 1 - - - - - List Item 2.1 - - - - - - -
- - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/templates/index.html b/tamguo-mms/src/main/resources/templates/index.html deleted file mode 100644 index 3136a0d..0000000 --- a/tamguo-mms/src/main/resources/templates/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - 探果题库_聪明的学生都在这里 - - - - - - - - - - - -
- - - - - 探果题库 - 登录 - 注册 - - - - - - {{it.name}} - - - - - - - - -
- - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/templates/question.html b/tamguo-mms/src/main/resources/templates/question.html deleted file mode 100644 index 563984b..0000000 --- a/tamguo-mms/src/main/resources/templates/question.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - 探果题库为老师创造价值-探果题库 - - - - - - - -
- - - - - 探果题库 - - 登录 - 注册 - - - - - - - 无 - - - - B - - - -

苯巴比妥属于巴比妥类镇静催眠药;佐匹克隆属于环吡咯酮类镇静催眠药;阿普唑仑属于苯二氮䓬类镇静催眠药,同类药物还有地西泮等,苯妥英钠属于乙内酰脲类抗癫痫药。

-
-
- - - - - - - 首页 - - - - {{course.name}} - - - - 关闭 - - - - - - - - - - -
- - - - - - - - \ No newline at end of file diff --git a/tamguo-mms/src/main/resources/templates/subject.html b/tamguo-mms/src/main/resources/templates/subject.html deleted file mode 100644 index ef8cf4f..0000000 --- a/tamguo-mms/src/main/resources/templates/subject.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - -
- - - - - 探果题库 - 登录 - 注册 - - - - 高考 - - {{it.name}} - - - - - - - - -
- - - - - - - - \ No newline at end of file