From 5bb26ced3b8fd5c31fda888e38a65779b0b9bed6 Mon Sep 17 00:00:00 2001 From: mazi <1016942589@qq.com> Date: Sun, 12 Sep 2021 12:43:31 +0800 Subject: [PATCH 1/3] hello --- src/main/java/com/lx/service/LxAnyService.java | 3 +-- src/main/java/com/lx/service/LxEnvService.java | 2 +- src/main/java/com/lx/service/LxEquService.java | 2 +- src/main/java/com/lx/service/LxParService.java | 2 +- src/main/java/com/lx/service/LxUserService.java | 2 +- src/main/java/com/lx/service/impl/LxEquServiceImpl.java | 2 +- src/main/java/com/lx/service/impl/LxParServiceImpl.java | 2 +- src/main/java/com/lx/service/impl/LxUserServiceImpl.java | 2 +- src/main/resources/application.yml | 2 +- src/test/java/com/lx/LxApplicationTests.java | 8 ++++++-- 10 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/lx/service/LxAnyService.java b/src/main/java/com/lx/service/LxAnyService.java index ead68fe..e2f024f 100644 --- a/src/main/java/com/lx/service/LxAnyService.java +++ b/src/main/java/com/lx/service/LxAnyService.java @@ -11,6 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author 赵敬轩 * @since 2021-09-12 */ -public interface LxAnyService extends IService { - +public interface LxAnyService { } diff --git a/src/main/java/com/lx/service/LxEnvService.java b/src/main/java/com/lx/service/LxEnvService.java index cba92d8..8fa57c0 100644 --- a/src/main/java/com/lx/service/LxEnvService.java +++ b/src/main/java/com/lx/service/LxEnvService.java @@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author 赵敬轩 * @since 2021-09-12 */ -public interface LxEnvService extends IService { +public interface LxEnvService { } diff --git a/src/main/java/com/lx/service/LxEquService.java b/src/main/java/com/lx/service/LxEquService.java index cb98f95..bbb8ad4 100644 --- a/src/main/java/com/lx/service/LxEquService.java +++ b/src/main/java/com/lx/service/LxEquService.java @@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author 赵敬轩 * @since 2021-09-12 */ -public interface LxEquService extends IService { +public interface LxEquService { } diff --git a/src/main/java/com/lx/service/LxParService.java b/src/main/java/com/lx/service/LxParService.java index bddc0b3..1855e39 100644 --- a/src/main/java/com/lx/service/LxParService.java +++ b/src/main/java/com/lx/service/LxParService.java @@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author 赵敬轩 * @since 2021-09-12 */ -public interface LxParService extends IService { +public interface LxParService { } diff --git a/src/main/java/com/lx/service/LxUserService.java b/src/main/java/com/lx/service/LxUserService.java index baaa3bd..3604e9c 100644 --- a/src/main/java/com/lx/service/LxUserService.java +++ b/src/main/java/com/lx/service/LxUserService.java @@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; * @author 赵敬轩 * @since 2021-09-12 */ -public interface LxUserService extends IService { +public interface LxUserService { } diff --git a/src/main/java/com/lx/service/impl/LxEquServiceImpl.java b/src/main/java/com/lx/service/impl/LxEquServiceImpl.java index 9bb0f5d..5410b58 100644 --- a/src/main/java/com/lx/service/impl/LxEquServiceImpl.java +++ b/src/main/java/com/lx/service/impl/LxEquServiceImpl.java @@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; * @since 2021-09-12 */ @Service -public class LxEquServiceImpl extends ServiceImpl implements LxEquService { +public class LxEquServiceImpl implements LxEquService { } diff --git a/src/main/java/com/lx/service/impl/LxParServiceImpl.java b/src/main/java/com/lx/service/impl/LxParServiceImpl.java index 22d5f03..f93925a 100644 --- a/src/main/java/com/lx/service/impl/LxParServiceImpl.java +++ b/src/main/java/com/lx/service/impl/LxParServiceImpl.java @@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; * @since 2021-09-12 */ @Service -public class LxParServiceImpl extends ServiceImpl implements LxParService { +public class LxParServiceImpl implements LxParService { } diff --git a/src/main/java/com/lx/service/impl/LxUserServiceImpl.java b/src/main/java/com/lx/service/impl/LxUserServiceImpl.java index 8f36af8..f7eadd4 100644 --- a/src/main/java/com/lx/service/impl/LxUserServiceImpl.java +++ b/src/main/java/com/lx/service/impl/LxUserServiceImpl.java @@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; * @since 2021-09-12 */ @Service -public class LxUserServiceImpl extends ServiceImpl implements LxUserService { +public class LxUserServiceImpl implements LxUserService { } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ea04295..c874c9b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,7 +10,7 @@ spring: datasource: url: jdbc:mysql://localhost:3306/db_lx?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT username: root - password: root + password: 123456 driver-class-name: com.mysql.cj.jdbc.Driver #解析resources/静态资源 mvc: diff --git a/src/test/java/com/lx/LxApplicationTests.java b/src/test/java/com/lx/LxApplicationTests.java index 8e35d5c..47aab62 100644 --- a/src/test/java/com/lx/LxApplicationTests.java +++ b/src/test/java/com/lx/LxApplicationTests.java @@ -1,19 +1,23 @@ package com.lx; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.lx.mapper.LxUserMapper; import com.lx.service.LxUserService; import com.lx.service.impl.LxUserServiceImpl; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.sql.Wrapper; + @SpringBootTest class LxApplicationTests { @Autowired - private LxUserServiceImpl lxUserService; + private LxUserMapper lxUserMapper; @Test void contextLoads() { - System.out.println(lxUserService.getById(1)); + System.out.println(lxUserMapper.selectById(1)); } } -- Gitee From 1e3b134f682deefd29344eb3c5056883c89268b4 Mon Sep 17 00:00:00 2001 From: mazi <1016942589@qq.com> Date: Sun, 12 Sep 2021 17:26:16 +0800 Subject: [PATCH 2/3] first commit --- .../com/lx/controller/LxUserController.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/lx/controller/LxUserController.java b/src/main/java/com/lx/controller/LxUserController.java index a8c9980..f3e0fc1 100644 --- a/src/main/java/com/lx/controller/LxUserController.java +++ b/src/main/java/com/lx/controller/LxUserController.java @@ -9,6 +9,7 @@ import com.lx.mapper.LxUserMapper; import com.lx.service.impl.LxUserServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -26,22 +27,12 @@ import java.util.Map; * @since 2021-09-12 */ @RestController -@RequestMapping("/lxuser") +@RequestMapping("/lx-user") public class LxUserController { @Autowired private LxUserServiceImpl lxUserService; - @RequestMapping("/getAll") - public String getAllUser(){ - Map resultData=new HashMap(); - List users = lxUserService.list(); - resultData.put("ret","1"); - resultData.put("data",users); - resultData.put("msg","成功"); - return JSON.toJSONString(resultData); - } - @CrossOrigin - @RequestMapping("/getAllUser") + @RequestMapping("/getAll") public String getAllUser(Integer page, Integer limit){ IPage lxUserIPage = lxUserService.selectAllUser(page, limit); List list = lxUserService.list(); @@ -52,4 +43,18 @@ public class LxUserController { resultData.put("count",list.size()); return JSON.toJSONString(resultData); } + + @CrossOrigin + @GetMapping("/delete") + public String deleteProvider(String id){ + HashMap resultData = new HashMap<>(); + System.out.println(id); + + //boolean deleteUserId = lxUserService.removeById(5); +// if (deleteUserId) +// resultData.put("msg","删除成功"); +// else +// resultData.put("msg","删除失败"); + return JSON.toJSONString(resultData); + } } -- Gitee From 173308136ffd027cd5328c8e9222e7a2c2e8c3d6 Mon Sep 17 00:00:00 2001 From: mazi <1016942589@qq.com> Date: Sun, 12 Sep 2021 17:38:46 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lx/controller/LxUserController.java | 10 +++++----- src/main/resources/123.txt | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/123.txt diff --git a/src/main/java/com/lx/controller/LxUserController.java b/src/main/java/com/lx/controller/LxUserController.java index f3e0fc1..0efed56 100644 --- a/src/main/java/com/lx/controller/LxUserController.java +++ b/src/main/java/com/lx/controller/LxUserController.java @@ -50,11 +50,11 @@ public class LxUserController { HashMap resultData = new HashMap<>(); System.out.println(id); - //boolean deleteUserId = lxUserService.removeById(5); -// if (deleteUserId) -// resultData.put("msg","删除成功"); -// else -// resultData.put("msg","删除失败"); + boolean deleteUserId = lxUserService.removeById(5); + if (deleteUserId) + resultData.put("msg","删除成功"); + else + resultData.put("msg","删除失败"); return JSON.toJSONString(resultData); } } diff --git a/src/main/resources/123.txt b/src/main/resources/123.txt new file mode 100644 index 0000000..d800886 --- /dev/null +++ b/src/main/resources/123.txt @@ -0,0 +1 @@ +123 \ No newline at end of file -- Gitee