Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
SpringBoot-kwan
提交
00158d24
S
SpringBoot-kwan
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
SpringBoot-kwan
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SpringBoot-kwan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
00158d24
编写于
12月 09, 2022
作者:
Q
qinyingjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:添加定时任务
上级
8974d8f9
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
163 addition
and
39 deletion
+163
-39
pom.xml
pom.xml
+49
-23
src/main/java/com/kwan/springbootkwan/SpringBootKwanApplication.java
...va/com/kwan/springbootkwan/SpringBootKwanApplication.java
+0
-2
src/main/java/com/kwan/springbootkwan/entity/User.java
src/main/java/com/kwan/springbootkwan/entity/User.java
+22
-0
src/main/resources/application.yaml
src/main/resources/application.yaml
+14
-1
src/main/resources/mapper/UserMapper.xml
src/main/resources/mapper/UserMapper.xml
+4
-0
src/test/java/com/kwan/springbootkwan/SpringBootKwanApplicationTests.java
...m/kwan/springbootkwan/SpringBootKwanApplicationTests.java
+0
-13
src/test/java/com/kwan/springbootkwan/UserServiceImplTest.java
...est/java/com/kwan/springbootkwan/UserServiceImplTest.java
+74
-0
未找到文件。
pom.xml
浏览文件 @
00158d24
...
@@ -25,22 +25,9 @@
...
@@ -25,22 +25,9 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.21
</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
<dependency>
<dependency>
...
@@ -49,13 +36,7 @@
...
@@ -49,13 +36,7 @@
<version>
1.2.3
</version>
<version>
1.2.3
</version>
</dependency>
</dependency>
<!-- junit -->
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
<!-- 引入swagger2包 -->
<!-- 引入swagger2包 -->
...
@@ -71,6 +52,51 @@
...
@@ -71,6 +52,51 @@
<artifactId>
springfox-swagger-ui
</artifactId>
<artifactId>
springfox-swagger-ui
</artifactId>
<version>
2.9.2
</version>
<version>
2.9.2
</version>
</dependency>
</dependency>
<!-- 模板引擎 -->
<dependency>
<groupId>
org.apache.velocity
</groupId>
<artifactId>
velocity-engine-core
</artifactId>
<version>
2.0
</version>
</dependency>
<!-- lang3-->
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.9
</version>
</dependency>
<!--mybatis-plus的springboot支持-->
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-boot-starter
</artifactId>
<version>
3.4.3.1
</version>
</dependency>
<!--mysql驱动-->
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
<!--简化代码的工具包-->
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<optional>
true
</optional>
</dependency>
<!--测试-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.13.1
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
<plugins>
<plugins>
...
...
src/main/java/com/kwan/springbootkwan/SpringBootKwanApplication.java
浏览文件 @
00158d24
package
com.kwan.springbootkwan
;
package
com.kwan.springbootkwan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@EnableScheduling
@EnableScheduling
@SpringBootApplication
@SpringBootApplication
public
class
SpringBootKwanApplication
{
public
class
SpringBootKwanApplication
{
...
...
src/main/java/com/kwan/springbootkwan/entity/User.java
0 → 100644
浏览文件 @
00158d24
package
com.kwan.springbootkwan.entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Builder
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
@Builder
@TableName
(
value
=
"User"
)
//指定表名
public
class
User
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
5644799954031156649L
;
//value与数据库主键列名一致,若实体类属性名与表主键列名一致可省略value
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
//指定自增策略
private
Integer
id
;
private
String
name
;
private
String
sex
;
private
String
pwd
;
private
String
email
;
}
src/main/resources/application.yaml
浏览文件 @
00158d24
...
@@ -9,3 +9,16 @@ spring:
...
@@ -9,3 +9,16 @@ spring:
mvc
:
mvc
:
pathmatch
:
pathmatch
:
matching-strategy
:
ant_path_matcher
matching-strategy
:
ant_path_matcher
profiles
:
active
:
dev
# mysql
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://127.0.0.1:3306/kwan?useSSL=false&useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
username
:
root
password
:
716288qwe
mybatis-plus
:
mapper-locations
:
mapper/*.xml
configuration
:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
map-underscore-to-camel-case
:
true
\ No newline at end of file
src/main/resources/mapper/UserMapper.xml
0 → 100644
浏览文件 @
00158d24
<!--<?xml version="1.0" encoding="UTF-8"?>-->
<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">-->
<!--<mapper namespace="com.kwan.springbootkwan.mapper.UserMapper">-->
<!--</mapper>-->
src/test/java/com/kwan/springbootkwan/SpringBootKwanApplicationTests.java
已删除
100644 → 0
浏览文件 @
8974d8f9
package
com.kwan.springbootkwan
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
class
SpringBootKwanApplicationTests
{
@Test
void
contextLoads
()
{
}
}
src/test/java/com/kwan/springbootkwan/UserServiceImplTest.java
0 → 100644
浏览文件 @
00158d24
//package com.kwan.springbootkwan;
//
//
//import com.kwan.springbootkwan.entity.User;
//import com.kwan.springbootkwan.service.impl.UserServiceImpl;
//import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.context.SpringBootTest;
//
//import java.util.ArrayList;
//import java.util.List;
//
//
//@SpringBootTest
//public class UserServiceImplTest {
//
// @Autowired
// UserServiceImpl userService;
// @Test
// public void queryAll() {
// userService.queryAll().forEach(System.out::println);
// }
//
// @Test
// public void add() {
// List<User> users = new ArrayList<>();
// for (int i = 0; i < 15; ++i) {
// User user = User.builder().id(i + 1).name("test" + i).sex(i % 2 == 0 ? "男" : "女").pwd("aaaa").email("123" + i + "@qq.com").build();
//
// users.add(user);
// }
// users.forEach(System.out::println);
// userService.add(users);
//
//
// }
//
// @Test
// public void query() {
// userService.queryAll().forEach(System.out::println);
//
// userService.queryByName1("test1").forEach(System.out::println);
// userService.queryByName2("test1").forEach(System.out::println);
// User user = userService.queryById(User.builder().id(2).build());
// System.out.println(user);
// userService.queryByNameMap("test1").forEach(System.out::println);
// System.out.println(userService.count());
// }
//
// @Test
// public void delete() {
// User user = User.builder().id(2).build();
// userService.deleteById(user);
//
// userService.deleteBy("name", "test15");
//
// userService.deleteByIds();
//
// }
//
// @Test
// public void change() {
// User user1 = User.builder().name("蔡徐坤").build();
// userService.changeBy(user1, "sex", "男");
//
// user1.setName("蔡徐坤2");
// userService.changeUserById(user1);
// }
//
//// public void test1(){
//// userService.register()
//// }
//
//}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录