From e88ac74ab16debe3a91e55fc543ae243a663d8e3 Mon Sep 17 00:00:00 2001 From: SmileToCandy Date: Sat, 30 Mar 2019 18:53:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=AD=E4=BB=A3=E5=81=9A=E9=A2=98=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tamguo/config/dao/MybatisPlusConfig.java | 4 +- .../tamguo/dao/IQuestionOptionsMapper.java | 10 ++ .../java/com/tamguo/model/QuestionEntity.java | 2 +- .../tamguo/model/QuestionOptionsEntity.java | 55 ++++++ .../impl/QuestionOptionsServiceImpl.java | 16 ++ .../src/main/resources/application.properties | 5 +- tamguo-crawler/tamguo-crawler.iml | 116 +++++++++++++ .../src/main/java/com/tamguo/Application.java | 3 +- .../src/main/resources/application.properties | 14 +- tamguo-mms/tamguo-mms.iml | 157 ++++++++++++++++++ tamguo-modules-core/tamguo-modules-core.iml | 71 ++++++++ tamguo-oms/tamguo-oms.iml | 156 +++++++++++++++++ .../tamguo/web/tiku/QuestionContrller.java | 2 + .../src/main/resources/application.properties | 4 +- .../src/main/resources/templates/paper.html | 2 +- .../main/resources/templates/question.html | 2 +- .../resources/templates/questionList.html | 2 +- 17 files changed, 598 insertions(+), 23 deletions(-) create mode 100644 tamguo-crawler/src/main/java/com/tamguo/dao/IQuestionOptionsMapper.java create mode 100644 tamguo-crawler/src/main/java/com/tamguo/model/QuestionOptionsEntity.java create mode 100644 tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionOptionsServiceImpl.java create mode 100644 tamguo-crawler/tamguo-crawler.iml create mode 100644 tamguo-mms/tamguo-mms.iml create mode 100644 tamguo-modules-core/tamguo-modules-core.iml create mode 100644 tamguo-oms/tamguo-oms.iml diff --git a/tamguo-crawler/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java b/tamguo-crawler/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java index ce1a53c..9e18232 100644 --- a/tamguo-crawler/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java +++ b/tamguo-crawler/src/main/java/com/tamguo/config/dao/MybatisPlusConfig.java @@ -83,8 +83,8 @@ public class MybatisPlusConfig { /** * 注入sql注入器 */ - @Bean + /*@Bean public ISqlInjector sqlInjector(){ return new LogicSqlInjector(); - } + }*/ } diff --git a/tamguo-crawler/src/main/java/com/tamguo/dao/IQuestionOptionsMapper.java b/tamguo-crawler/src/main/java/com/tamguo/dao/IQuestionOptionsMapper.java new file mode 100644 index 0000000..05147ed --- /dev/null +++ b/tamguo-crawler/src/main/java/com/tamguo/dao/IQuestionOptionsMapper.java @@ -0,0 +1,10 @@ +package com.tamguo.dao; + +import com.baomidou.mybatisplus.mapper.BaseMapper; +import com.tamguo.model.QuestionOptionsEntity; + +/** + * Created by TanGuo on 2019/3/30. + */ +public interface IQuestionOptionsMapper extends BaseMapper { +} diff --git a/tamguo-crawler/src/main/java/com/tamguo/model/QuestionEntity.java b/tamguo-crawler/src/main/java/com/tamguo/model/QuestionEntity.java index 080560d..7a21eb4 100644 --- a/tamguo-crawler/src/main/java/com/tamguo/model/QuestionEntity.java +++ b/tamguo-crawler/src/main/java/com/tamguo/model/QuestionEntity.java @@ -9,7 +9,7 @@ import com.tamguo.config.dao.SuperEntity; * The persistent class for the tiku_question database table. * */ -@TableName(value="tiku_question") +@TableName(value="t_question") public class QuestionEntity extends SuperEntity implements Serializable { private static final long serialVersionUID = 1L; diff --git a/tamguo-crawler/src/main/java/com/tamguo/model/QuestionOptionsEntity.java b/tamguo-crawler/src/main/java/com/tamguo/model/QuestionOptionsEntity.java new file mode 100644 index 0000000..b9e26cd --- /dev/null +++ b/tamguo-crawler/src/main/java/com/tamguo/model/QuestionOptionsEntity.java @@ -0,0 +1,55 @@ +package com.tamguo.model; + +import com.baomidou.mybatisplus.annotations.TableId; +import com.baomidou.mybatisplus.annotations.TableName; + +@TableName(value="t_question_options") +public class QuestionOptionsEntity { + + @TableId + private Long id; + private String questionId; + private String option; + private String optionNo; + private int order; + + public String getQuestionId() { + return questionId; + } + + public void setQuestionId(String questionId) { + this.questionId = questionId; + } + + public String getOption() { + return option; + } + + public void setOption(String option) { + this.option = option; + } + + public String getOptionNo() { + return optionNo; + } + + public void setOptionNo(String optionNo) { + this.optionNo = optionNo; + } + + public int getOrder() { + return order; + } + + public void setOrder(int order) { + this.order = order; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionOptionsServiceImpl.java b/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionOptionsServiceImpl.java new file mode 100644 index 0000000..5effa68 --- /dev/null +++ b/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionOptionsServiceImpl.java @@ -0,0 +1,16 @@ +package com.tamguo.service.impl; + +import com.baomidou.mybatisplus.service.impl.ServiceImpl; +import com.tamguo.dao.IQuestionOptionsMapper; +import com.tamguo.model.QuestionOptionsEntity; +import com.tamguo.service.IQuestionOptionsService; +import com.tamguo.service.IQuestionService; +import org.springframework.stereotype.Service; + +/** + * Created by TanGuo on 2019/3/30. + */ +@Service +public class QuestionOptionsServiceImpl extends ServiceImpl implements IQuestionOptionsService { + +} diff --git a/tamguo-crawler/src/main/resources/application.properties b/tamguo-crawler/src/main/resources/application.properties index ac51a49..968ac00 100644 --- a/tamguo-crawler/src/main/resources/application.properties +++ b/tamguo-crawler/src/main/resources/application.properties @@ -22,15 +22,12 @@ spring.datasource.validationQuery=SELECT 1 FROM DUAL mybatis-plus.mapper-locations=classpath:/mappers/*Mapper.xml mybatis-plus.typeAliasesPackage=com.tamguo.model #mybatis-plus.typeEnumsPackage=com.tamguo.model.enums -mybatis-plus.global-config.id-type=5 +mybatis-plus.global-config.id-type=2 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 diff --git a/tamguo-crawler/tamguo-crawler.iml b/tamguo-crawler/tamguo-crawler.iml new file mode 100644 index 0000000..c010665 --- /dev/null +++ b/tamguo-crawler/tamguo-crawler.iml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 index d1d90b8..c6e47fd 100644 --- a/tamguo-mms/src/main/java/com/tamguo/Application.java +++ b/tamguo-mms/src/main/java/com/tamguo/Application.java @@ -11,7 +11,6 @@ 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) { @@ -32,5 +31,5 @@ public class Application { FastJsonHttpMessageConverter converter = fastConverter; return new HttpMessageConverters(converter); } - + } diff --git a/tamguo-mms/src/main/resources/application.properties b/tamguo-mms/src/main/resources/application.properties index 5565abc..f760f77 100644 --- a/tamguo-mms/src/main/resources/application.properties +++ b/tamguo-mms/src/main/resources/application.properties @@ -1,7 +1,7 @@ -domain.name=https://localhost:8084/ +domain.name=http://localhost:8084/ book.domain.name=https://book.tamguo.com/ tamguo.domain.name=https://www.tamguo.com/ -cookie.domian.name=tamguo.com +cookie.domian.name=localhost server.port=8084 jasypt.encryptor.password=tamguo @@ -14,29 +14,26 @@ spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 spring.datasource.maxWait=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.minIdle=5 -spring.datasource.password=123456 +spring.datasource.password=boomauto 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://127.0.0.1:3306/tamguo_20181110?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.url=jdbc:mysql://120.77.219.107: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.id-type=2 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 @@ -45,7 +42,6 @@ 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 diff --git a/tamguo-mms/tamguo-mms.iml b/tamguo-mms/tamguo-mms.iml new file mode 100644 index 0000000..9ef9b02 --- /dev/null +++ b/tamguo-mms/tamguo-mms.iml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamguo-modules-core/tamguo-modules-core.iml b/tamguo-modules-core/tamguo-modules-core.iml new file mode 100644 index 0000000..04056d5 --- /dev/null +++ b/tamguo-modules-core/tamguo-modules-core.iml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamguo-oms/tamguo-oms.iml b/tamguo-oms/tamguo-oms.iml new file mode 100644 index 0000000..1cc110a --- /dev/null +++ b/tamguo-oms/tamguo-oms.iml @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tamguo-tms/src/main/java/com/tamguo/web/tiku/QuestionContrller.java b/tamguo-tms/src/main/java/com/tamguo/web/tiku/QuestionContrller.java index c6786fe..cf8922d 100644 --- a/tamguo-tms/src/main/java/com/tamguo/web/tiku/QuestionContrller.java +++ b/tamguo-tms/src/main/java/com/tamguo/web/tiku/QuestionContrller.java @@ -66,6 +66,8 @@ public class QuestionContrller { Page questionList = iQuestionService.selectPage(page , Condition.create().eq("chapter_id", chapterId).orderDesc(Arrays.asList("id"))); for(int i=0 ;i questionOptions = iQuestionOptionsService.selectList(Condition.create().eq("question_id" , question.getId())); + question.setQuestionOptions(questionOptions); question.setQuestionType(QuestionTypeEnum.getQuestionType(question.getQuestionType()).getDesc()); } model.addObject("subject", subject); diff --git a/tamguo-tms/src/main/resources/application.properties b/tamguo-tms/src/main/resources/application.properties index 19d350f..a33daee 100644 --- a/tamguo-tms/src/main/resources/application.properties +++ b/tamguo-tms/src/main/resources/application.properties @@ -14,14 +14,14 @@ spring.datasource.maxPoolPreparedStatementPerConnectionSize=20 spring.datasource.maxWait=60000 spring.datasource.minEvictableIdleTimeMillis=300000 spring.datasource.minIdle=5 -spring.datasource.password=boomauto +spring.datasource.password=tamguo 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://120.77.219.107:3306/tamguo?useUnicode=true&characterEncoding=UTF-8&useSSL=false +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tamguo?useUnicode=true&characterEncoding=UTF-8&useSSL=false spring.datasource.username=root spring.datasource.validationQuery=SELECT 1 FROM DUAL diff --git a/tamguo-tms/src/main/resources/templates/paper.html b/tamguo-tms/src/main/resources/templates/paper.html index cabbf83..460bed0 100644 --- a/tamguo-tms/src/main/resources/templates/paper.html +++ b/tamguo-tms/src/main/resources/templates/paper.html @@ -107,7 +107,7 @@
-

AtRNA分子中含有一定数量的氢键

+

AtRNA分子中含有一定数量的氢键

diff --git a/tamguo-tms/src/main/resources/templates/question.html b/tamguo-tms/src/main/resources/templates/question.html index 17f2348..c20439a 100644 --- a/tamguo-tms/src/main/resources/templates/question.html +++ b/tamguo-tms/src/main/resources/templates/question.html @@ -41,7 +41,7 @@
-

AtRNA分子中含有一定数量的氢键

+

AtRNA分子中含有一定数量的氢键

diff --git a/tamguo-tms/src/main/resources/templates/questionList.html b/tamguo-tms/src/main/resources/templates/questionList.html index 948d2c1..aabba2d 100644 --- a/tamguo-tms/src/main/resources/templates/questionList.html +++ b/tamguo-tms/src/main/resources/templates/questionList.html @@ -54,7 +54,7 @@
-

AtRNA分子中含有一定数量的氢键

+

AtRNA分子中含有一定数量的氢键