From e2e5fafdf7935687147b80ed884d47298cb54482 Mon Sep 17 00:00:00 2001 From: SuiXxx <1752599835@qq.com> Date: Wed, 7 Aug 2024 19:09:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E8=80=8314?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 38 +++++++ .idea/.gitignore | 8 ++ .idea/encodings.xml | 8 ++ .idea/misc.xml | 14 +++ .idea/vcs.xml | 6 ++ pom.xml | 67 ++++++++++++ src/main/java/com/bwie/Main.java | 11 ++ .../com/bwie/controller/QuestController.java | 26 +++++ src/main/java/com/bwie/domain/Quest.java | 12 +++ .../java/com/bwie/mapper/QuestMapper.java | 12 +++ .../java/com/bwie/service/QuestService.java | 10 ++ .../bwie/service/impl/QuestServiceImpl.java | 24 +++++ src/main/resources/application.yml | 102 ++++++++++++++++++ src/main/resources/mapper/QuestMapper.xml | 11 ++ 14 files changed, 349 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/encodings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 pom.xml create mode 100644 src/main/java/com/bwie/Main.java create mode 100644 src/main/java/com/bwie/controller/QuestController.java create mode 100644 src/main/java/com/bwie/domain/Quest.java create mode 100644 src/main/java/com/bwie/mapper/QuestMapper.java create mode 100644 src/main/java/com/bwie/service/QuestService.java create mode 100644 src/main/java/com/bwie/service/impl/QuestServiceImpl.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/mapper/QuestMapper.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..63574ec --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..132404b --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..4d83158 --- /dev/null +++ b/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.bwie + day_exam_015 + 1.0-SNAPSHOT + + + 8 + 8 + UTF-8 + + + + spring-boot-starter-parent + org.springframework.boot + 2.6.2 + + + + + + commons-lang + commons-lang + 2.6 + + + + org.projectlombok + lombok + 1.18.32 + + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.4 + + + + mysql + mysql-connector-java + 5.1.32 + runtime + + + + javax.servlet + javax.servlet-api + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + diff --git a/src/main/java/com/bwie/Main.java b/src/main/java/com/bwie/Main.java new file mode 100644 index 0000000..53f896f --- /dev/null +++ b/src/main/java/com/bwie/Main.java @@ -0,0 +1,11 @@ +package com.bwie; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Main { + public static void main(String[] args) { + SpringApplication.run(Main.class, args); + } +} diff --git a/src/main/java/com/bwie/controller/QuestController.java b/src/main/java/com/bwie/controller/QuestController.java new file mode 100644 index 0000000..d13c966 --- /dev/null +++ b/src/main/java/com/bwie/controller/QuestController.java @@ -0,0 +1,26 @@ +package com.bwie.controller; + +import com.bwie.domain.Quest; +import com.bwie.service.QuestService; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +@RestController("/quest") +public class QuestController { + @Resource + private QuestService questService; + + + @RequestMapping("/selList") + public List selList() { + return questService.selList(); + } + + @RequestMapping("/Quest") + public Quest selNew() { + return questService.selNew(); + } +} diff --git a/src/main/java/com/bwie/domain/Quest.java b/src/main/java/com/bwie/domain/Quest.java new file mode 100644 index 0000000..119dd2b --- /dev/null +++ b/src/main/java/com/bwie/domain/Quest.java @@ -0,0 +1,12 @@ +package com.bwie.domain; + +import lombok.Data; + +@Data +public class Quest { +private Integer id; +private String title; +private String text; +private String time; + +} diff --git a/src/main/java/com/bwie/mapper/QuestMapper.java b/src/main/java/com/bwie/mapper/QuestMapper.java new file mode 100644 index 0000000..0cab227 --- /dev/null +++ b/src/main/java/com/bwie/mapper/QuestMapper.java @@ -0,0 +1,12 @@ +package com.bwie.mapper; + +import com.bwie.domain.Quest; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface QuestMapper { + List selList(); + Quest selNew(); +} diff --git a/src/main/java/com/bwie/service/QuestService.java b/src/main/java/com/bwie/service/QuestService.java new file mode 100644 index 0000000..4f71bb1 --- /dev/null +++ b/src/main/java/com/bwie/service/QuestService.java @@ -0,0 +1,10 @@ +package com.bwie.service; + +import com.bwie.domain.Quest; + +import java.util.List; + +public interface QuestService { + List selList(); + Quest selNew(); +} diff --git a/src/main/java/com/bwie/service/impl/QuestServiceImpl.java b/src/main/java/com/bwie/service/impl/QuestServiceImpl.java new file mode 100644 index 0000000..f5dbf39 --- /dev/null +++ b/src/main/java/com/bwie/service/impl/QuestServiceImpl.java @@ -0,0 +1,24 @@ +package com.bwie.service.impl; + +import com.bwie.domain.Quest; +import com.bwie.mapper.QuestMapper; +import com.bwie.service.QuestService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +@Service +public class QuestServiceImpl implements QuestService { + @Resource + private QuestMapper questMapper; + @Override + public List selList() { + return questMapper.selList(); + } + + @Override + public Quest selNew() { + return questMapper.selNew(); + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..d6b9d75 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,102 @@ +# 服务器相关 + +server: + port: 10001 + +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + datasource: + driver-class-name: com.mysql.jdbc.Driver + url: jdbc:mysql://60.204.243.96:3306/day_exam_15?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&useSSL=false&allowPublicKeyRetrieval=true + username: root + password: sx001231 + druid: + # 下面为连接池的补充设置,应用到上面所有数据源中 + # 初始化大小,最小,最大 + initial-size: 5 + min-idle: 5 + max-active: 20 + # 配置获取连接等待超时的时间 + max-wait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + time-between-eviction-runs-millis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + min-evictable-idle-time-millis: 300000 + validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 + max-pool-prepared-statement-per-connection-size: 20 + filters: stat,wall + use-global-data-source-stat: true + # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connect-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + application: + name: shop-server + redis: + host: 1.12.254.213 + port: 6381 + mail: + host: smtp.qq.com + username: 358795815@qq.com + password: uuyemjigqlhvbgcj + port: 587 # 这个端口根据实际情况配置,一般都是465 + protocol: smtp # 这里应该是不用改的,我没试过其他的配置 + test-connection: false + default-encoding: UTF-8 + properties: + mail: + debug: true + smtp: + auth: true + connectiontimeout: 10000 + timeout: 10000 + writetimeout: 10000 + socketFactory: + class: javax.net.ssl.SSLSocketFactory + port: 587 + starttls: + enable: true + required: true + select: + multipart: + max-file-size: 100MB # 最大支持文件大小 + max-request-size: 100MB # 最大请求大小 + enabled: true + + +# mybatis +mybatis: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath*:mapper/*Mapper.xml + global-config: + db-config: + id-type: auto + + +aliyun: + end-point: oss-cn-shanghai.aliyuncs.com + access-key-id: LTAI5tSFAGrms29r1xwEFtRM + access-key-secret: rztMfqxdYlsMUtIoy9bIOSGEKCWQT7 + access-pre: https://dongxiaojie.oss-cn-shanghai.aliyuncs.com + bucket-name: dongxiaojie + +fdfs: + so-timeout: 1500 # socket 连接时长 + connect-timeout: 600 # 连接 tracker 服务器超时时长 + # 这两个是你服务器的 IP 地址,注意 23000 端口也要打开,阿里云服务器记得配置安全组。tracker 要和 stroage 服务进行交流 + tracker-list: 1.12.254.213:22122 + web-server-url: 1.12.254.213:8888 + pool: + jmx-enabled: false + # 生成缩略图 + thumb-image: + height: 500 + width: 500 diff --git a/src/main/resources/mapper/QuestMapper.xml b/src/main/resources/mapper/QuestMapper.xml new file mode 100644 index 0000000..f73988a --- /dev/null +++ b/src/main/resources/mapper/QuestMapper.xml @@ -0,0 +1,11 @@ + + + + + + +