From 83fadb6b1b473058e9d60280f080e88f33a69ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=A1=B7?= <9428260+Sirius2021@user.noreply.gitee.com> Date: Thu, 15 Jul 2021 16:33:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?from=E5=BC=A0=E9=9D=96=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/swpu/zjytest/Mytest.java | 25 ++++++++++++++++++++++ src/main/resources/application.yml | 10 ++++----- 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/swpu/zjytest/Mytest.java diff --git a/src/main/java/com/swpu/zjytest/Mytest.java b/src/main/java/com/swpu/zjytest/Mytest.java new file mode 100644 index 0000000..e61e2eb --- /dev/null +++ b/src/main/java/com/swpu/zjytest/Mytest.java @@ -0,0 +1,25 @@ +package com.swpu.zjytest; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.text.SimpleDateFormat; +import java.util.Date; + +@RestController +@RequestMapping(value = "/zjy") +public class Mytest { + @GetMapping(value = "/time") + public String getTime() { + Date date=new Date(); + SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd: HH:mm:ss"); + return "当前时间是:"+dateFormat.format(date); + } + @GetMapping(value = "/muti") + public String muti(@RequestParam(value = "x") int x, @RequestParam(value = "y") int y) { + var sum = x*y; + return "计算结果为: " + sum; + } +} diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8594e42..7b84c10 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ -spring: - application: - name: swpu-spring-projects -server: - port: 20000 +#spring: +# application: +# name: swpu-spring-projects +#server: +# port: 20000 -- Gitee From 48106f3bd076b6c3a5b5a2bd939f57d36adb260a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=A1=B7?= <9428260+Sirius2021@user.noreply.gitee.com> Date: Sun, 18 Jul 2021 23:16:22 +0800 Subject: [PATCH 2/6] =?UTF-8?q?from=E5=BC=A0=E9=9D=96=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 8 ++++---- .../src/main/resources/mapper/SwpuUserMapper.xml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/swpu-spring-projects-boot/src/main/resources/application.yml b/swpu-spring-projects-boot/src/main/resources/application.yml index aa844e5..bf40248 100644 --- a/swpu-spring-projects-boot/src/main/resources/application.yml +++ b/swpu-spring-projects-boot/src/main/resources/application.yml @@ -3,15 +3,15 @@ spring: name: swpu-spring-projects datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/swpu_db + url: jdbc:mysql://172.17.3.207:3306/swpu_db username: swpu_user - password: '123456789' + password: '123456' type: com.zaxxer.hikari.HikariDataSource hikari: - maximum-pool-size: 10000 + maximum-pool-size: 1000 server: - port: 20000 + port: 8080 mybatis: mapper-locations: diff --git a/swpu-spring-projects-boot/src/main/resources/mapper/SwpuUserMapper.xml b/swpu-spring-projects-boot/src/main/resources/mapper/SwpuUserMapper.xml index b2c568b..73f7488 100644 --- a/swpu-spring-projects-boot/src/main/resources/mapper/SwpuUserMapper.xml +++ b/swpu-spring-projects-boot/src/main/resources/mapper/SwpuUserMapper.xml @@ -26,7 +26,7 @@ - insert into swpu_user (id, department_id, job_level_id, pos_id, engage_form, specialty, school) + insert into swpu_user (id, department_id, job_level_id, posId, engage_form, specialty, school) values (#{id, javaType = String}, #{departmentId, javaType = Integer}, #{jobLevelId, javaType = Integer}, #{posId, javaType = Integer}, #{engageForm, javaType = String}, #{specialty, javaType = String}, #{school, javaType = String}) @@ -36,7 +36,7 @@ insert into swpu_user ( id, - department_id, job_level_id, pos_id, engage_form, specialty, school) + department_id, job_level_id, posId, engage_form, specialty, school) values ( #{id, javaType = String}, -- Gitee From 888e3145c8b848f7f4d54884d12b9fe742c6a90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=A1=B7?= <9428260+Sirius2021@user.noreply.gitee.com> Date: Mon, 19 Jul 2021 17:58:17 +0800 Subject: [PATCH 3/6] =?UTF-8?q?from=E5=BC=A0=E9=9D=96=E5=AE=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/swpu/controller/SwpuUserController.java | 4 +++- swpu-spring-projects-boot/src/main/resources/application.yml | 4 ++-- .../src/main/resources/mapper/SwpuUserMapper.xml | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/swpu-spring-projects-boot/src/main/java/com/swpu/controller/SwpuUserController.java b/swpu-spring-projects-boot/src/main/java/com/swpu/controller/SwpuUserController.java index 8a516fe..3d327a4 100644 --- a/swpu-spring-projects-boot/src/main/java/com/swpu/controller/SwpuUserController.java +++ b/swpu-spring-projects-boot/src/main/java/com/swpu/controller/SwpuUserController.java @@ -33,7 +33,7 @@ public class SwpuUserController { return list; } - /** + /**k *