Browse Source

first commit

master
unknown 2 years ago
commit
da40c4c756
433 changed files with 25500 additions and 0 deletions
  1. +31
    -0
      .gitignore
  2. +117
    -0
      .mvn/wrapper/MavenWrapperDownloader.java
  3. BIN
      .mvn/wrapper/maven-wrapper.jar
  4. +2
    -0
      .mvn/wrapper/maven-wrapper.properties
  5. +1
    -0
      .svn/entries
  6. +1
    -0
      .svn/format
  7. +13
    -0
      .svn/pristine/00/00be8534da98cb0b8a15cc1f023e4ac642d820f5.svn-base
  8. +10090
    -0
      .svn/pristine/01/0174de9aab1bcbb281ad54e9b674b608f3407443.svn-base
  9. +4
    -0
      .svn/pristine/01/01b587281fc151d1a8abd1a12c5c50dedf188d89.svn-base
  10. +13
    -0
      .svn/pristine/03/032d94b74e0e0895feb3a456f47da7cba78f5a1c.svn-base
  11. +13
    -0
      .svn/pristine/04/04643cfcccedb7e4b662a212a8e001f2b3cb0c5e.svn-base
  12. +13
    -0
      .svn/pristine/04/0484694e6583588cb04ba46653434ee6597159ef.svn-base
  13. +33
    -0
      .svn/pristine/04/04c0ac5eba708ae2d9fee4b68c759de10f7020ef.svn-base
  14. +321
    -0
      .svn/pristine/05/05b07990ae40d1eb60fe36f6fccf7d997224d50e.svn-base
  15. +13
    -0
      .svn/pristine/06/069ddb1869aa316e5bc23d2a622104fa9e84ce06.svn-base
  16. +184
    -0
      .svn/pristine/07/07479e94be8d8c6f6e319a97593a7c35aed4a349.svn-base
  17. +40
    -0
      .svn/pristine/07/0762f66b458368685b34cdd262d34ed8bfe1c638.svn-base
  18. BIN
      .svn/pristine/07/077e4819b41a6c6e8b06abb76a4ef05771b117b7.svn-base
  19. +13
    -0
      .svn/pristine/07/07b86f7fc734f231fbe4cf9aad17801585134db3.svn-base
  20. +13
    -0
      .svn/pristine/07/07ecf191ca0bf7009340bbbc2c11f2505730d691.svn-base
  21. +13
    -0
      .svn/pristine/07/07fe4f4b8d3df2bd4d3c2e5ac6678a1ada265f16.svn-base
  22. +13
    -0
      .svn/pristine/08/080327ce0501128e3a29f9bc7555ae70f12d48d1.svn-base
  23. +13
    -0
      .svn/pristine/0a/0ad8b4bc3da5165373e51cfa5976085c98141bf2.svn-base
  24. +21
    -0
      .svn/pristine/0c/0c1207d8a9714ac1dcafedd2d8938bc70e706708.svn-base
  25. +31
    -0
      .svn/pristine/0c/0c6fdfa0c37ff9e9c5221d35f612d6dacdc174fa.svn-base
  26. +13
    -0
      .svn/pristine/0c/0c9e941fd1647fa8e7ee33ca8b2daf19999101fe.svn-base
  27. +13
    -0
      .svn/pristine/0f/0fb3ea704a14bcb5127eaf2e6a1be1b0f2c5c2ac.svn-base
  28. +93
    -0
      .svn/pristine/0f/0fb4d4bbeb9c1b78ca99455591a372ae6cd0157e.svn-base
  29. +163
    -0
      .svn/pristine/10/10e71e50b174c042f945640bc28c044b2cc75613.svn-base
  30. +13
    -0
      .svn/pristine/11/11290865af3d9fe926447a6c5ac52ab95d3caef1.svn-base
  31. +9
    -0
      .svn/pristine/11/115ad9b16e9721b6926a9187836b6b9beae61f0b.svn-base
  32. BIN
      .svn/pristine/12/1254d0d73600a2264d2a7b37470fa4f64fffb943.svn-base
  33. +13
    -0
      .svn/pristine/13/131de89417a4bcc468e00dc0c157ef8ad39cf0ad.svn-base
  34. BIN
      .svn/pristine/14/141dd2fbd281333c77cbc3876b194547d9544242.svn-base
  35. BIN
      .svn/pristine/14/14930c8bbef6aa3b25f4273c67c55fa9856d75c9.svn-base
  36. +13
    -0
      .svn/pristine/14/14dea6efde64b88dbb24334feddf87afe0d06856.svn-base
  37. BIN
      .svn/pristine/16/16abb5feffe61b3047775457318431af4f65ae2c.svn-base
  38. +99
    -0
      .svn/pristine/17/1700c57145772c7524b14bdd9ab9bd774cf3c816.svn-base
  39. +127
    -0
      .svn/pristine/17/1799b592fc115afc954688c732a64effc1735857.svn-base
  40. +44
    -0
      .svn/pristine/17/179ea773d295a142fc41ff8d24054e38267b2d5d.svn-base
  41. +117
    -0
      .svn/pristine/17/17e1f68916a81e646d27007ed8367d1b45959181.svn-base
  42. +13
    -0
      .svn/pristine/19/19a00fa39b5245d2c52e8fae7ede6aee8777ed4e.svn-base
  43. BIN
      .svn/pristine/1a/1a13c5b0b92bf7167b6f58b8fadac5974c1b0773.svn-base
  44. +6
    -0
      .svn/pristine/1a/1a7d7e887a8523ffaee3acf0b6487f53a9d71829.svn-base
  45. +29
    -0
      .svn/pristine/1b/1b010649734e39e19c8fa36099b5b64f2906c3c4.svn-base
  46. BIN
      .svn/pristine/1c/1c044ef1b217644caf028f51831970a7fe327960.svn-base
  47. +13
    -0
      .svn/pristine/1c/1c152abc4319844d98ffd26108bba301f49a5d9e.svn-base
  48. +13
    -0
      .svn/pristine/1d/1d478a06f000c0f778975bb8c1fab9fcdb72236f.svn-base
  49. BIN
      .svn/pristine/1d/1d9e5d744fbdf1f86713062818399a41cc8d3889.svn-base
  50. +13
    -0
      .svn/pristine/1d/1dd6a7c1eadf5c36909ab51985401df0564a72b0.svn-base
  51. +13
    -0
      .svn/pristine/1e/1e8c4dccc85ca478ade0fde833a940e98d59b9de.svn-base
  52. +26
    -0
      .svn/pristine/1e/1e957dce13b7b90086cd0a322c7e465072163ff3.svn-base
  53. +13
    -0
      .svn/pristine/1e/1ec931d986a7ef62fa250c619d70d826dce5f847.svn-base
  54. BIN
      .svn/pristine/1f/1f631df89819a7858c95964e9846871436b140ac.svn-base
  55. +13
    -0
      .svn/pristine/1f/1f96fc4053e6b8cf0910ecef24a7fc443e1e4182.svn-base
  56. BIN
      .svn/pristine/20/20cd34abf877312ebee72089b109e863f72c7f7d.svn-base
  57. +13
    -0
      .svn/pristine/22/226fdb35ac8e1ccbf1987e25733187c753232ede.svn-base
  58. BIN
      .svn/pristine/23/2362abd74ed14476f0e7a16ff85e7e7077f7c47a.svn-base
  59. +14
    -0
      .svn/pristine/25/25d2511d8a1959170499a5e6a509486247d10e77.svn-base
  60. +13
    -0
      .svn/pristine/26/2645b3140f1f885b156ed1f4fab3d38ef2a197b0.svn-base
  61. +32
    -0
      .svn/pristine/26/267784d9adc981b27e5816c0fe1003024e1f81a6.svn-base
  62. +13
    -0
      .svn/pristine/27/279fa8c23aef7c590e6811b63402e2e3fade4253.svn-base
  63. +13
    -0
      .svn/pristine/27/27fbfbd621d27ac9e0c1f8dc3b1fcef179e690fb.svn-base
  64. +5
    -0
      .svn/pristine/29/2957b98613d23c920eac75bbbb51d013c03c3df5.svn-base
  65. +44
    -0
      .svn/pristine/29/29a963c396179ce287062d6522dc60b3caeb8af6.svn-base
  66. +13
    -0
      .svn/pristine/2a/2a31b27ceb07b3f41738f4c4b737da227228359f.svn-base
  67. +506
    -0
      .svn/pristine/2a/2aacd66820b5ee6e4047702d457a2378d2d2e9bb.svn-base
  68. +35
    -0
      .svn/pristine/2a/2accb2eded24fed86de0b215562bc225c7509588.svn-base
  69. +13
    -0
      .svn/pristine/2d/2d2f1a5302a4f4a0625e8cfec2e594db605d83d9.svn-base
  70. +13
    -0
      .svn/pristine/2e/2e2e49e712d82ff249bc475450ee4e5eab5bdbf3.svn-base
  71. +13
    -0
      .svn/pristine/31/31735d2b419016ad0ba2c28d145a46e05e41d5d8.svn-base
  72. BIN
      .svn/pristine/31/31e08ef5e7bc50ce55844bca6e45341bd3524a09.svn-base
  73. +13
    -0
      .svn/pristine/32/32835787ced5df1f3bcd4e5ed94d8b15a037c66b.svn-base
  74. BIN
      .svn/pristine/32/32d75d23d991cb4e53e2ba53fcd46d0fe21d3287.svn-base
  75. +13
    -0
      .svn/pristine/33/33b9de911d8128c27e10e29b1bab999f6dd7ce1e.svn-base
  76. BIN
      .svn/pristine/35/35fd10fc8efce0c835cdb51f8ec5e98ab4d1f183.svn-base
  77. BIN
      .svn/pristine/36/36c0a706af7b4564a257a1bad77dbba1a2234af0.svn-base
  78. +13
    -0
      .svn/pristine/37/378ee51ad2ce5bccd9037a1efc55298113af722b.svn-base
  79. +2
    -0
      .svn/pristine/38/38f74b4eeb1e98358ea02312874efa835fcc6065.svn-base
  80. BIN
      .svn/pristine/39/390bf6c50b181128ad4e3a8aa0d41d0235a86e7a.svn-base
  81. +118
    -0
      .svn/pristine/39/39c81ee632732ced5b74d6ead71fe92fbf94fda1.svn-base
  82. +297
    -0
      .svn/pristine/3a/3afd456aa877390299aa93b7fd9f25c6cfb9a052.svn-base
  83. BIN
      .svn/pristine/3b/3b3455b0b60f855f8fcbf39026f6bf2bb56a55c6.svn-base
  84. +31
    -0
      .svn/pristine/3b/3bece19b1c5c92166b5495e8320d15883a5bbff6.svn-base
  85. +65
    -0
      .svn/pristine/3e/3e004b850c7529ca2a1a6b4cf72b59a13942a0c4.svn-base
  86. +37
    -0
      .svn/pristine/3e/3e18cfeeeffc5088d46f8139256da554e9eed180.svn-base
  87. +13
    -0
      .svn/pristine/3e/3e66de3585a713b1d7d3fc4358c71577d01c5783.svn-base
  88. +13
    -0
      .svn/pristine/3f/3f7dbeb62c2502380284667af71483c4753dbd6d.svn-base
  89. +8
    -0
      .svn/pristine/40/402d09404c5b98265de6fc421cd2785c82874bd8.svn-base
  90. +25
    -0
      .svn/pristine/45/45f1df717863b24ef1c7c1167e1198cca0a62389.svn-base
  91. +25
    -0
      .svn/pristine/46/46201449ff1746d044ceeb9fd020c424c1527cd4.svn-base
  92. +21
    -0
      .svn/pristine/47/475b214f6d88a1cea8d9d1caceb61d0b223788ba.svn-base
  93. +13
    -0
      .svn/pristine/47/47fd73a951a6ac0f8a803aeb245e0b400a8ec422.svn-base
  94. +66
    -0
      .svn/pristine/48/48d3926a720e5f501f2ff68c6aa7327477590429.svn-base
  95. +13
    -0
      .svn/pristine/48/48d4fc7858a222b2e8cc8fd92ea2ecaff4cae53a.svn-base
  96. +65
    -0
      .svn/pristine/4a/4a455449f840bf80b243f127ea75b636846982d6.svn-base
  97. +6
    -0
      .svn/pristine/4a/4a56db8dc2a50f3af94d9026eb97b6afbc771085.svn-base
  98. +21
    -0
      .svn/pristine/4a/4a87e5d4869f2abf97f0da0c75510aa4ec89f01e.svn-base
  99. +13
    -0
      .svn/pristine/4a/4ac91e87ea9a7ef464719e5be9dadae180d755a4.svn-base
  100. +13
    -0
      .svn/pristine/4a/4ac9f64a4122b4ecf311a05d3be7ac2b966c4e74.svn-base

+ 31
- 0
.gitignore View File

@ -0,0 +1,31 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
### VS Code ###
.vscode/

+ 117
- 0
.mvn/wrapper/MavenWrapperDownloader.java View File

@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
.mvn/wrapper/maven-wrapper.jar View File


+ 2
- 0
.mvn/wrapper/maven-wrapper.properties View File

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

+ 1
- 0
.svn/entries View File

@ -0,0 +1 @@
12

+ 1
- 0
.svn/format View File

@ -0,0 +1 @@
12

+ 13
- 0
.svn/pristine/00/00be8534da98cb0b8a15cc1f023e4ac642d820f5.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-aop:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.7.RELEASE/spring-aop-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.7.RELEASE/spring-aop-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aop/5.2.7.RELEASE/spring-aop-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 10090
- 0
.svn/pristine/01/0174de9aab1bcbb281ad54e9b674b608f3407443.svn-base
File diff suppressed because it is too large
View File


+ 4
- 0
.svn/pristine/01/01b587281fc151d1a8abd1a12c5c50dedf188d89.svn-base View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: com.whn.hellospring.OrderTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.082 s - in com.whn.hellospring.OrderTest

+ 13
- 0
.svn/pristine/03/032d94b74e0e0895feb3a456f47da7cba78f5a1c.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter/2.3.1.RELEASE/spring-boot-starter-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter/2.3.1.RELEASE/spring-boot-starter-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter/2.3.1.RELEASE/spring-boot-starter-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/04/04643cfcccedb7e4b662a212a8e001f2b3cb0c5e.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: jakarta.persistence:jakarta.persistence-api:2.2.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/04/0484694e6583588cb04ba46653434ee6597159ef.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: net.bytebuddy:byte-buddy-agent:1.10.11">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.10.11/byte-buddy-agent-1.10.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.10.11/byte-buddy-agent-1.10.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/bytebuddy/byte-buddy-agent/1.10.11/byte-buddy-agent-1.10.11-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 33
- 0
.svn/pristine/04/04c0ac5eba708ae2d9fee4b68c759de10f7020ef.svn-base View File

@ -0,0 +1,33 @@
package com.whn.hellospring.repository;
import com.whn.hellospring.model.CoffeeDO;
import org.apache.ibatis.annotations.Delete;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 咖啡
*/
public interface CoffeeRepository extends JpaRepository<CoffeeDO, Long> {
/**
* 获取一个订单下的所有咖啡
*/
@Query(value = "SELECT * FROM t_coffee where order_id_fk=?1", nativeQuery = true)
List<CoffeeDO> selectCoffeeListWithOrder(Long order_id_fk);
/**
* 删除一个订单下的咖啡
*/
@Transactional //事务
@Modifying //更新
@Query(value = "delete FROM T_COFFEE where order_id_fk=?1", nativeQuery = true)
int deleteCoffeeByOrderId(Long order_id_fk);
}

+ 321
- 0
.svn/pristine/05/05b07990ae40d1eb60fe36f6fccf7d997224d50e.svn-base View File

@ -0,0 +1,321 @@
package com.whn.hellospring.utils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 功能描述:
*
* @author Administrator
* @date 2021/7/23
*/
public class HttpUtils {
/**
* get
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doGet(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpGet request = new HttpGet(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
/**
* post form
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param bodys
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
Map<String, String> bodys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (bodys != null) {
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
for (String key : bodys.keySet()) {
nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key)));
}
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8");
formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8");
request.setEntity(formEntity);
}
return httpClient.execute(request);
}
/**
* Post String
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Post stream
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPost(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPost request = new HttpPost(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Put String
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
String body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (StringUtils.isNotBlank(body)) {
request.setEntity(new StringEntity(body, "utf-8"));
}
return httpClient.execute(request);
}
/**
* Put stream
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @param body
* @return
* @throws Exception
*/
public static HttpResponse doPut(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys,
byte[] body)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpPut request = new HttpPut(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
if (body != null) {
request.setEntity(new ByteArrayEntity(body));
}
return httpClient.execute(request);
}
/**
* Delete
*
* @param host
* @param path
* @param method
* @param headers
* @param querys
* @return
* @throws Exception
*/
public static HttpResponse doDelete(String host, String path, String method,
Map<String, String> headers,
Map<String, String> querys)
throws Exception {
HttpClient httpClient = wrapClient(host);
HttpDelete request = new HttpDelete(buildUrl(host, path, querys));
for (Map.Entry<String, String> e : headers.entrySet()) {
request.addHeader(e.getKey(), e.getValue());
}
return httpClient.execute(request);
}
private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException {
StringBuilder sbUrl = new StringBuilder();
sbUrl.append(host);
if (!StringUtils.isBlank(path)) {
sbUrl.append(path);
}
if (null != querys) {
StringBuilder sbQuery = new StringBuilder();
for (Map.Entry<String, String> query : querys.entrySet()) {
if (0 < sbQuery.length()) {
sbQuery.append("&");
}
if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) {
sbQuery.append(query.getValue());
}
if (!StringUtils.isBlank(query.getKey())) {
sbQuery.append(query.getKey());
if (!StringUtils.isBlank(query.getValue())) {
sbQuery.append("=");
sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8"));
}
}
}
if (0 < sbQuery.length()) {
sbUrl.append("?").append(sbQuery);
}
}
return sbUrl.toString();
}
private static HttpClient wrapClient(String host) {
HttpClient httpClient = new DefaultHttpClient();
if (host.startsWith("https://")) {
sslClient(httpClient);
}
return httpClient;
}
private static void sslClient(HttpClient httpClient) {
try {
SSLContext ctx = SSLContext.getInstance("TLS");
X509TrustManager tm = new X509TrustManager() {
@Override
public X509Certificate[] getAcceptedIssuers() {
return null;
}
@Override
public void checkClientTrusted(X509Certificate[] xcs, String str) {
}
@Override
public void checkServerTrusted(X509Certificate[] xcs, String str) {
}
};
ctx.init(null, new TrustManager[] { tm }, null);
SSLSocketFactory ssf = new SSLSocketFactory(ctx);
ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
ClientConnectionManager ccm = httpClient.getConnectionManager();
SchemeRegistry registry = ccm.getSchemeRegistry();
registry.register(new Scheme("https", 443, ssf));
} catch (KeyManagementException ex) {
throw new RuntimeException(ex);
} catch (NoSuchAlgorithmException ex) {
throw new RuntimeException(ex);
}
}
}

+ 13
- 0
.svn/pristine/06/069ddb1869aa316e5bc23d2a622104fa9e84ce06.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hibernate:hibernate-core:5.4.17.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/5.4.17.Final/hibernate-core-5.4.17.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/5.4.17.Final/hibernate-core-5.4.17.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/hibernate-core/5.4.17.Final/hibernate-core-5.4.17.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 184
- 0
.svn/pristine/07/07479e94be8d8c6f6e319a97593a7c35aed4a349.svn-base View File

@ -0,0 +1,184 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots>
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
<facet type="kotlin-language" name="Kotlin">
<configuration version="3" platform="JVM 1.8" useProjectSettings="false">
<compilerSettings>
<option name="additionalArguments" value="-java-parameters" />
</compilerSettings>
<compilerArguments>
<option name="jvmTarget" value="1.8" />
<option name="languageVersion" value="1.3" />
<option name="apiVersion" value="1.3" />
<option name="pluginOptions">
<array />
</option>
<option name="pluginClasspaths">
<array />
</option>
<option name="errors">
<ArgumentParseErrors />
</option>
</compilerArguments>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: redis.clients:jedis:2.9.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-pool2:2.8.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.36" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.36" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.1.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.1.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.1.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.10.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.7.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.h2database:h2:1.4.200" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.5" level="project" />
<orderEntry type="library" name="Maven: jakarta.transaction:jakarta.transaction-api:1.3.3" level="project" />
<orderEntry type="library" name="Maven: jakarta.persistence:jakarta.persistence-api:2.2.3" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.4.17.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.24.0-GA" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.jboss:jandex:2.1.3.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" />
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.3" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.1.0.Final" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.3" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.3" level="project" />
<orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.11" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.2.7.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.joda:joda-money:1.0.1" level="project" />
<orderEntry type="library" name="Maven: org.jadira.usertype:usertype.core:6.0.1.GA" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-entitymanager:5.4.17.Final" level="project" />
<orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
<orderEntry type="library" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: org.jadira.usertype:usertype.spi:6.0.1.GA" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.12" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.4.6" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:1.3.2" level="project" />
<orderEntry type="library" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.7" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" level="project" />
<orderEntry type="library" name="Maven: com.github.pagehelper:pagehelper:5.1.11" level="project" />
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:2.0" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.20" level="project" />
<orderEntry type="library" name="Maven: com.googlecode.log4jdbc:log4jdbc:1.2" level="project" />
<orderEntry type="library" name="Maven: com.spring4all:swagger-spring-boot-starter:1.9.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-ui:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spring-web:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger2:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-annotations:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.swagger:swagger-models:1.5.20" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-spi:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-core:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-schema:2.9.2" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-swagger-common:2.9.2" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" level="project" />
<orderEntry type="library" name="Maven: io.springfox:springfox-bean-validators:2.9.2" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Draft-16" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.3.1.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.1.5.Final" level="project" />
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.50" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.3.50" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test:1.3.50" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.jetbrains.kotlin:kotlin-test-common:1.3.50" level="project" />
</component>
</module>

+ 40
- 0
.svn/pristine/07/0762f66b458368685b34cdd262d34ed8bfe1c638.svn-base View File

@ -0,0 +1,40 @@
package com.whn.hellospring.repository;
import com.whn.hellospring.model.OilDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface OilRepository extends JpaRepository<OilDO,Long> {
/**
* 分页查询所有
*
* @param spec
* @param pageable
* @return
*/
Page<OilDO> findAll(Specification spec, Pageable pageable);
@Query(value = "select * from t_oil where customer_id = ?1 ORDER BY time Desc ",nativeQuery = true)
List<OilDO> finAllSortByTime(Long customer_id);
@Query(value = "select sum(num) from t_oil where status=1 && customer_id = ?1",nativeQuery = true)
double countNum(Long customer_id);
@Query(value = "select sum(interval_mileage) from t_oil where status=1 && customer_id = ?1",nativeQuery = true)
double countIntervalMileage(Long customer_id);
@Query(value = "select interval_oil_wear from t_oil where status=1 && customer_id=?1 ORDER BY time ASC",nativeQuery = true)
List<Double> findWearList(Long customer_id);
}

BIN
.svn/pristine/07/077e4819b41a6c6e8b06abb76a4ef05771b117b7.svn-base View File


+ 13
- 0
.svn/pristine/07/07b86f7fc734f231fbe4cf9aad17801585134db3.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-aop/2.3.1.RELEASE/spring-boot-starter-aop-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-aop/2.3.1.RELEASE/spring-boot-starter-aop-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-aop/2.3.1.RELEASE/spring-boot-starter-aop-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/07/07ecf191ca0bf7009340bbbc2c11f2505730d691.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apiguardian:apiguardian-api:1.1.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/07/07fe4f4b8d3df2bd4d3c2e5ac6678a1ada265f16.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.36">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/tomcat/embed/tomcat-embed-core/9.0.36/tomcat-embed-core-9.0.36.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/tomcat/embed/tomcat-embed-core/9.0.36/tomcat-embed-core-9.0.36-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/apache/tomcat/embed/tomcat-embed-core/9.0.36/tomcat-embed-core-9.0.36-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/08/080327ce0501128e3a29f9bc7555ae70f12d48d1.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-webmvc:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.7.RELEASE/spring-webmvc-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.7.RELEASE/spring-webmvc-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-webmvc/5.2.7.RELEASE/spring-webmvc-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/0a/0ad8b4bc3da5165373e51cfa5976085c98141bf2.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.sun.istack:istack-commons-runtime:3.0.11">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/sun/istack/istack-commons-runtime/3.0.11/istack-commons-runtime-3.0.11-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 21
- 0
.svn/pristine/0c/0c1207d8a9714ac1dcafedd2d8938bc70e706708.svn-base View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="hellospring" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="hellospring" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="hellospring" options="-parameters" />
</option>
</component>
</project>

+ 31
- 0
.svn/pristine/0c/0c6fdfa0c37ff9e9c5221d35f612d6dacdc174fa.svn-base View File

@ -0,0 +1,31 @@
package com.whn.hellospring.model;
import lombok.*;
import org.hibernate.annotations.Type;
import org.joda.money.Money;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Table(name = "T_MENU_COFFEE")
@Builder
@Data
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class MenuCoffeeDO extends BaseEntity implements Serializable {
private Long menu_id_fk;
private String name;
@Column
@Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmount",
parameters = {@org.hibernate.annotations.Parameter(name = "currencyCode", value = "CNY")})
private Money price;
}

+ 13
- 0
.svn/pristine/0c/0c9e941fd1647fa8e7ee33ca8b2daf19999101fe.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-data-jpa/2.3.1.RELEASE/spring-boot-starter-data-jpa-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-data-jpa/2.3.1.RELEASE/spring-boot-starter-data-jpa-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-data-jpa/2.3.1.RELEASE/spring-boot-starter-data-jpa-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/0f/0fb3ea704a14bcb5127eaf2e6a1be1b0f2c5c2ac.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hibernate.common:hibernate-commons-annotations:5.1.0.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/5.1.0.Final/hibernate-commons-annotations-5.1.0.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/5.1.0.Final/hibernate-commons-annotations-5.1.0.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/common/hibernate-commons-annotations/5.1.0.Final/hibernate-commons-annotations-5.1.0.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 93
- 0
.svn/pristine/0f/0fb4d4bbeb9c1b78ca99455591a372ae6cd0157e.svn-base View File

@ -0,0 +1,93 @@
package com.whn.hellospring.common;
import java.util.HashMap;
import java.util.Map;
public class Status {
private boolean state;
private String errorCode;
private String message;
private Map<String, Object> data;
public Status(StateMessage stateMessage) {
this.state = stateMessage.getState();
this.errorCode = stateMessage.getErrorCode();
this.message = stateMessage.getMessage();
data = new HashMap<>();
}
public static Status result(StateMessage stateMessage,Map<String, Object> dataMap){
Status status = new Status(stateMessage);
status.setData(dataMap);
return status;
}
/**
* 返回客户端数据类型
*
* @param stateMessage 返回客户端消息
* @param value 返回客户端值
*/
public Status(StateMessage stateMessage, Object value) {
this.state = stateMessage.getState();
this.errorCode = stateMessage.getErrorCode();
this.message = stateMessage.getMessage();
data = new HashMap<>();
data.put("result", value);
}
/**
* 返回客户端数据类型
*
* @param stateMessage 返回客户端消息
* @param map 返回客户端数据集合
*/
public Status(StateMessage stateMessage, Map<String, Object> map) {
this.state = stateMessage.getState();
this.errorCode = stateMessage.getErrorCode();
this.message = stateMessage.getMessage();
data = new HashMap<>();
data.putAll(map);
}
public boolean getState() {
return state;
}
public void setState(boolean state) {
this.state = state;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Object getData() {
return data;
}
public void setData(Map<String, Object> dataMap) {
this.data = dataMap;
}
public void setData(String key, Object value) {
this.data.put(key, value);
}
@Override
public String toString() {
return "Status [state=" + state + ", message=" + message + ", data=" + data + "]";
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
}

+ 163
- 0
.svn/pristine/10/10e71e50b174c042f945640bc28c044b2cc75613.svn-base View File

@ -0,0 +1,163 @@
package com.whn.hellospring;
import com.whn.hellospring.model.*;
import com.whn.hellospring.repository.CoffeeOrderRepository;
import com.whn.hellospring.repository.CoffeeRepository;
import com.whn.hellospring.utils.DO2DTOUtil;
import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
import org.junit.jupiter.api.Test;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@SpringBootTest
class HellospringApplicationTests {
// @Autowired
// private CoffeeRepository coffeeRepository;
//
// @Autowired
// private CoffeeOrderRepository orderRepository;
//
//
// /**
// * 查询一个订单信息,包含咖啡
// */
// @Test
// void queryOrder() {
// Long id = 8L;
// CoffeeOrderDO orderDO = orderRepository.queryOrderWithId(id);
// CoffeeOrderDTO orderDTO = (CoffeeOrderDTO) doToDto(orderDO, CoffeeOrderDTO.class);
// List<CoffeeDO> coffeeDOList = coffeeRepository.selectCoffeeListWithOrder(id);
// List<CoffeeDTO> coffeeDTOList = (List<CoffeeDTO>) DO2DTOUtil.getInstance().doListToDtoList(coffeeDOList, CoffeeDTO.class);
//
// orderDTO.setItems(coffeeDTOList);
// System.out.println("顾客:" + orderDTO.getCustomer());
// for (CoffeeDTO coffee :
// orderDTO.getItems()) {
// System.out.println("咖啡:" + coffee.getName());
// }
// }
//
//
// /**
// * 创建一个订单,包含咖啡
// */
// @Test
// void createOrderWithCoffee() {
// //创建一个订单,包含一杯咖啡
// CoffeeDO espresso = CoffeeDO.builder().name("订单下的咖啡3")
// .price(Money.of(CurrencyUnit.of("CNY"), 10.0))
// .build();
// coffeeRepository.save(espresso);
// CoffeeOrderDTO orderDTO = CoffeeOrderDTO.builder()
// .customer("me3")
// .state(OrderState.INIT)
// .build();
//
//
// //保存订单,拆解DTO为DO
// CoffeeOrderDO order = (CoffeeOrderDO) dtoToDo(orderDTO, CoffeeOrderDO.class);
// orderRepository.save(order);
//
// //保存咖啡
// List<CoffeeDTO> list = orderDTO.getItems();
// for (CoffeeDTO coffee : list) {
// coffee.setOrder_id_fk(order.getId());
//// coffeeRepository.save(coffee);
// }
// }
//
// /**
// * 创建一杯咖啡
// */
// @Test
// void createCoffee() {
// CoffeeDO espresso = CoffeeDO.builder().name("espresso")
// .price(Money.of(CurrencyUnit.of("CNY"), 20.0))
// .build();
// coffeeRepository.save(espresso);
// }
//
// /**
// * 获取一个订单下的咖啡列表
// */
// @Test
// void getCoffeeListWithOrder() {
// List<CoffeeDO> list = coffeeRepository.selectCoffeeListWithOrder(1L);
// System.out.println("列表长度:" + list.size());
// for (CoffeeDO item : list) {
// System.out.println("列表:" + item.getName());
// }
// }
//
//
// /**
// * DTO模型转换成DO
// *
// * @param objectDto DTO 对象
// * @param doClass DO 类型
// * @return doClass类型的对象
// */
// public Object dtoToDo(Object objectDto, Class doClass) {
// if (objectDto == null) {
// return null;
// }
// Object objectDo = null;
// try {
// objectDo = doClass.newInstance();
// BeanUtils.copyProperties(objectDto, objectDo);
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// return objectDo;
// }
//
//
// /**
// * DO集合转换成DTO集合
// *
// * @param doList DO 对象集合
// * @param dtoClass DTO 类型
// * @return dtoClass类型的集合
// */
// public Object doListToDtoList(Object doList, Class dtoClass) {
// if (doList == null) {
// return null;
// }
// List<Object> dtoList = new ArrayList<>();
// for (Object i : (List) doList) {
// Object dto = doToDto(i, dtoClass);
// if (dto != null) {
// dtoList.add(dto);
// }
// }
// return dtoList;
// }
//
// /**
// * DO转换成DTO
// *
// * @param objectDo DO 对象
// * @param dtoClass DTO 类型
// * @return dtoClass类型的对象
// */
// public Object doToDto(Object objectDo, Class dtoClass) {
// if (objectDo == null) {
// return null;
// }
// Object objectDto = null;
// try {
// objectDto = dtoClass.newInstance();
// BeanUtils.copyProperties(objectDo, objectDto);
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// return objectDto;
// }
}

+ 13
- 0
.svn/pristine/11/11290865af3d9fe926447a6c5ac52ab95d3caef1.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-core:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-core/5.2.7.RELEASE/spring-core-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 9
- 0
.svn/pristine/11/115ad9b16e9721b6926a9187836b6b9beae61f0b.svn-base View File

@ -0,0 +1,9 @@
# Getting Started
### Reference Documentation
For further reference, please consider the following sections:
* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)
* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/)
* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.3.1.RELEASE/maven-plugin/reference/html/#build-image)

BIN
.svn/pristine/12/1254d0d73600a2264d2a7b37470fa4f64fffb943.svn-base View File


+ 13
- 0
.svn/pristine/13/131de89417a4bcc468e00dc0c157ef8ad39cf0ad.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/14/141dd2fbd281333c77cbc3876b194547d9544242.svn-base View File


BIN
.svn/pristine/14/14930c8bbef6aa3b25f4273c67c55fa9856d75c9.svn-base View File


+ 13
- 0
.svn/pristine/14/14dea6efde64b88dbb24334feddf87afe0d06856.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: ch.qos.logback:logback-core:1.2.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/16/16abb5feffe61b3047775457318431af4f65ae2c.svn-base View File


+ 99
- 0
.svn/pristine/17/1700c57145772c7524b14bdd9ab9bd774cf3c816.svn-base View File

@ -0,0 +1,99 @@
package com.whn.hellospring.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class JuheService {
public String getOilPrice() {
String url = "http://apis.juhe.cn/gnyj/query?key=212b6526c4f8a3899ca406a1173bafa8";
String result = "";
BufferedReader in = null;
try {
String urlNameString = url;
URL realUrl = new URL(urlNameString);
URLConnection connection = realUrl.openConnection();
connection.setRequestProperty("accept", "*/*");
connection.setRequestProperty("connection", "Keep-Alive");
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
connection.connect();
Map<String, List<String>> map = connection.getHeaderFields();
for (String key : map.keySet()) {
System.out.println(key + "--->" + map.get(key));
}
in = new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
} catch (Exception e) {
System.out.println("异常" + e);
e.printStackTrace();
} finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
return result;
}
public static String sendPost(String url, String param) {
PrintWriter out = null;
BufferedReader in = null;
String result = "";
try {
URL realUrl = new URL(url);
URLConnection conn = realUrl.openConnection();
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("charset", "utf-8");
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
conn.setDoOutput(true);
conn.setDoInput(true);
out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(), "utf-8"));
out.print(param);
out.flush();
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8"));
String line;
while ((line = in.readLine()) != null) {
result += line;
}
System.out.println("sendPost" + result);
} catch (Exception e) {
System.out.println("异常" + e);
e.printStackTrace();
} finally {
try {
if (out != null) {
out.close();
}
if (in != null) {
in.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
return result;
}
}

+ 127
- 0
.svn/pristine/17/1799b592fc115afc954688c732a64effc1735857.svn-base View File

@ -0,0 +1,127 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="hellospring:war exploded">
<output-path>$PROJECT_DIR$/target/test</output-path>
<properties id="maven-jee-properties">
<options>
<exploded>true</exploded>
<module>hellospring</module>
<packaging>war</packaging>
</options>
</properties>
<root id="root">
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="hellospring" />
</element>
<element id="directory" name="lib">
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: ch.qos.logback:logback-classic:1.2.3" />
<element id="library" level="project" name="Maven: ch.qos.logback:logback-core:1.2.3" />
<element id="library" level="project" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" />
<element id="library" level="project" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" />
<element id="library" level="project" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" />
<element id="library" level="project" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" />
<element id="library" level="project" name="Maven: org.yaml:snakeyaml:1.26" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.0" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.0" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.0" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0" />
<element id="library" level="project" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.36" />
<element id="library" level="project" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.36" />
<element id="library" level="project" name="Maven: org.springframework:spring-web:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-beans:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-webmvc:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-aop:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-context:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-expression:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" />
<element id="library" level="project" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" />
<element id="library" level="project" name="Maven: net.bytebuddy:byte-buddy:1.10.11" />
<element id="library" level="project" name="Maven: org.springframework:spring-core:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-jcl:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: com.zaxxer:HikariCP:3.4.5" />
<element id="library" level="project" name="Maven: org.springframework:spring-jdbc:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-tx:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: com.h2database:h2:1.4.200" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.aspectj:aspectjweaver:1.9.5" />
<element id="library" level="project" name="Maven: jakarta.transaction:jakarta.transaction-api:1.3.3" />
<element id="library" level="project" name="Maven: jakarta.persistence:jakarta.persistence-api:2.2.3" />
<element id="library" level="project" name="Maven: org.hibernate:hibernate-core:5.4.17.Final" />
<element id="library" level="project" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" />
<element id="library" level="project" name="Maven: org.javassist:javassist:3.24.0-GA" />
<element id="library" level="project" name="Maven: antlr:antlr:2.7.7" />
<element id="library" level="project" name="Maven: org.jboss:jandex:2.1.3.Final" />
<element id="library" level="project" name="Maven: com.fasterxml:classmate:1.5.1" />
<element id="library" level="project" name="Maven: org.dom4j:dom4j:2.1.3" />
<element id="library" level="project" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.1.0.Final" />
<element id="library" level="project" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.3" />
<element id="library" level="project" name="Maven: org.glassfish.jaxb:txw2:2.3.3" />
<element id="library" level="project" name="Maven: com.sun.istack:istack-commons-runtime:3.0.11" />
<element id="library" level="project" name="Maven: com.sun.activation:jakarta.activation:1.2.2" />
<element id="library" level="project" name="Maven: org.springframework.data:spring-data-jpa:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.data:spring-data-commons:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-orm:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework:spring-aspects:5.2.7.RELEASE" />
<element id="library" level="project" name="Maven: org.joda:joda-money:1.0.1" />
<element id="library" level="project" name="Maven: org.jadira.usertype:usertype.core:6.0.1.GA" />
<element id="library" level="project" name="Maven: org.hibernate:hibernate-entitymanager:5.4.17.Final" />
<element id="library" level="project" name="Maven: javax.persistence:javax.persistence-api:2.2" />
<element id="library" level="project" name="Maven: org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final" />
<element id="library" level="project" name="Maven: org.slf4j:slf4j-api:1.7.30" />
<element id="library" level="project" name="Maven: org.jadira.usertype:usertype.spi:6.0.1.GA" />
<element id="library" level="project" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2" />
<element id="library" level="project" name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2" />
<element id="library" level="project" name="Maven: org.mybatis:mybatis:3.4.6" />
<element id="library" level="project" name="Maven: org.mybatis:mybatis-spring:1.3.2" />
<element id="library" level="project" name="Maven: org.mybatis.generator:mybatis-generator-core:1.3.7" />
<element id="library" level="project" name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13" />
<element id="library" level="project" name="Maven: com.github.pagehelper:pagehelper-spring-boot-autoconfigure:1.2.13" />
<element id="library" level="project" name="Maven: com.github.pagehelper:pagehelper:5.1.11" />
<element id="library" level="project" name="Maven: com.github.jsqlparser:jsqlparser:2.0" />
<element id="library" level="project" name="Maven: mysql:mysql-connector-java:8.0.20" />
<element id="library" level="project" name="Maven: com.googlecode.log4jdbc:log4jdbc:1.2" />
<element id="library" level="project" name="Maven: com.spring4all:swagger-spring-boot-starter:1.9.0.RELEASE" />
<element id="library" level="project" name="Maven: io.springfox:springfox-swagger-ui:2.9.2" />
<element id="library" level="project" name="Maven: io.springfox:springfox-spring-web:2.9.2" />
<element id="library" level="project" name="Maven: io.springfox:springfox-swagger2:2.9.2" />
<element id="library" level="project" name="Maven: io.swagger:swagger-annotations:1.5.20" />
<element id="library" level="project" name="Maven: io.swagger:swagger-models:1.5.20" />
<element id="library" level="project" name="Maven: io.springfox:springfox-spi:2.9.2" />
<element id="library" level="project" name="Maven: io.springfox:springfox-core:2.9.2" />
<element id="library" level="project" name="Maven: io.springfox:springfox-schema:2.9.2" />
<element id="library" level="project" name="Maven: io.springfox:springfox-swagger-common:2.9.2" />
<element id="library" level="project" name="Maven: com.google.guava:guava:20.0" />
<element id="library" level="project" name="Maven: org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE" />
<element id="library" level="project" name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE" />
<element id="library" level="project" name="Maven: org.mapstruct:mapstruct:1.2.0.Final" />
<element id="library" level="project" name="Maven: io.springfox:springfox-bean-validators:2.9.2" />
<element id="library" level="project" name="Maven: org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Draft-16" />
<element id="library" level="project" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.3.1.RELEASE" />
<element id="library" level="project" name="Maven: org.glassfish:jakarta.el:3.0.3" />
<element id="library" level="project" name="Maven: org.hibernate.validator:hibernate-validator:6.1.5.Final" />
<element id="library" level="project" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" />
<element id="library" level="project" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.10" />
<element id="library" level="project" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.4.10" />
<element id="library" level="project" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.10" />
<element id="library" level="project" name="Maven: org.jetbrains:annotations:13.0" />
<element id="library" level="project" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10" />
</element>
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/target/test/META-INF/MANIFEST.MF" />
</element>
<element id="javaee-facet-resources" facet="hellospring/web/Web" />
</root>
</artifact>
</component>

+ 44
- 0
.svn/pristine/17/179ea773d295a142fc41ff8d24054e38267b2d5d.svn-base View File

@ -0,0 +1,44 @@
package com.whn.hellospring.handler;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
/**
* 在Money与Long之间转换的TypeHandler,处理CNY和人民币
*/
public class MoneyTypeHandler extends BaseTypeHandler<Money> {
@Override
public void setNonNullParameter(PreparedStatement preparedStatement, int i, Money money, JdbcType jdbcType) throws SQLException {
preparedStatement.setLong(i,money.getAmountMinorLong()); //存储为Long类型,精确到分
}
@Override
public Money getNullableResult(ResultSet resultSet, String s) throws SQLException {
return parseMoney(resultSet.getLong(s));
}
@Override
public Money getNullableResult(ResultSet resultSet, int i) throws SQLException {
return parseMoney(resultSet.getLong(i));
}
@Override
public Money getNullableResult(CallableStatement callableStatement, int i) throws SQLException {
return parseMoney(callableStatement.getLong(i));
}
/**
* 将Long值转换为Money
*/
private Money parseMoney(Long value){
return Money.ofMinor(CurrencyUnit.of("CNY"),value);
}
}

+ 117
- 0
.svn/pristine/17/17e1f68916a81e646d27007ed8367d1b45959181.svn-base View File

@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

+ 13
- 0
.svn/pristine/19/19a00fa39b5245d2c52e8fae7ede6aee8777ed4e.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: jakarta.transaction:jakarta.transaction-api:1.3.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/1a/1a13c5b0b92bf7167b6f58b8fadac5974c1b0773.svn-base View File


+ 6
- 0
.svn/pristine/1a/1a7d7e887a8523ffaee3acf0b6487f53a9d71829.svn-base View File

@ -0,0 +1,6 @@
<component name="ArtifactManager">
<artifact type="war" name="test">
<output-path>F:/</output-path>
<root id="archive" name="test.war" />
</artifact>
</component>

+ 29
- 0
.svn/pristine/1b/1b010649734e39e19c8fa36099b5b64f2906c3c4.svn-base View File

@ -0,0 +1,29 @@
package com.whn.hellospring.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Table(name = "T_CUSTOMER")
@Builder
@Data
@ToString(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(value = {"hibernateLazyInitializer","handler"})
public class CustomerDO extends BaseEntity implements Serializable {
private String name;
private int age;
private String phone;
private String pass_word;
}

BIN
.svn/pristine/1c/1c044ef1b217644caf028f51831970a7fe327960.svn-base View File


+ 13
- 0
.svn/pristine/1c/1c152abc4319844d98ffd26108bba301f49a5d9e.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.projectlombok:lombok:1.18.12">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.12/lombok-1.18.12-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/projectlombok/lombok/1.18.12/lombok-1.18.12-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/1d/1d478a06f000c0f778975bb8c1fab9fcdb72236f.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.hibernate.validator:hibernate-validator:6.1.5.Final">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/validator/hibernate-validator/6.1.5.Final/hibernate-validator-6.1.5.Final.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/validator/hibernate-validator/6.1.5.Final/hibernate-validator-6.1.5.Final-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/hibernate/validator/hibernate-validator/6.1.5.Final/hibernate-validator-6.1.5.Final-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/1d/1d9e5d744fbdf1f86713062818399a41cc8d3889.svn-base View File


+ 13
- 0
.svn/pristine/1d/1dd6a7c1eadf5c36909ab51985401df0564a72b0.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/1e/1e8c4dccc85ca478ade0fde833a940e98d59b9de.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.pagehelper:pagehelper-spring-boot-starter:1.2.13">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper-spring-boot-starter/1.2.13/pagehelper-spring-boot-starter-1.2.13-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 26
- 0
.svn/pristine/1e/1e957dce13b7b90086cd0a322c7e465072163ff3.svn-base View File

@ -0,0 +1,26 @@
package com.whn.hellospring.model;
import lombok.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CoffeeOrderDTO implements Serializable {
private String customer;
private String customer_id;
private Long id;
private Date createTime;
private Date updateTime;
private OrderState state;
private List<CoffeeDTO> items;
}

+ 13
- 0
.svn/pristine/1e/1ec931d986a7ef62fa250c619d70d826dce5f847.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.objenesis:objenesis:2.6">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/objenesis/objenesis/2.6/objenesis-2.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/objenesis/objenesis/2.6/objenesis-2.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/objenesis/objenesis/2.6/objenesis-2.6-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/1f/1f631df89819a7858c95964e9846871436b140ac.svn-base View File


+ 13
- 0
.svn/pristine/1f/1f96fc4053e6b8cf0910ecef24a7fc443e1e4182.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.google.guava:guava:20.0">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/20.0/guava-20.0.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/20.0/guava-20.0-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/google/guava/guava/20.0/guava-20.0-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/20/20cd34abf877312ebee72089b109e863f72c7f7d.svn-base View File


+ 13
- 0
.svn/pristine/22/226fdb35ac8e1ccbf1987e25733187c753232ede.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-expression:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.7.RELEASE/spring-expression-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.7.RELEASE/spring-expression-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-expression/5.2.7.RELEASE/spring-expression-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/23/2362abd74ed14476f0e7a16ff85e7e7077f7c47a.svn-base View File


+ 14
- 0
.svn/pristine/25/25d2511d8a1959170499a5e6a509486247d10e77.svn-base View File

@ -0,0 +1,14 @@
<component name="ArtifactManager">
<artifact type="war" name="hellospring:war">
<output-path>$PROJECT_DIR$/target</output-path>
<properties id="maven-jee-properties">
<options>
<module>hellospring</module>
<packaging>war</packaging>
</options>
</properties>
<root id="archive" name="test.war">
<element id="artifact" artifact-name="hellospring:war exploded" />
</root>
</artifact>
</component>

+ 13
- 0
.svn/pristine/26/2645b3140f1f885b156ed1f4fab3d38ef2a197b0.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-jdbc:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.7.RELEASE/spring-jdbc-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.7.RELEASE/spring-jdbc-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-jdbc/5.2.7.RELEASE/spring-jdbc-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 32
- 0
.svn/pristine/26/267784d9adc981b27e5816c0fe1003024e1f81a6.svn-base View File

@ -0,0 +1,32 @@
package com.whn.hellospring.utils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class DateUtils {
/**
* 计算两个日期之间相差的天数
*
* @param smdate 较小的时间
* @param bdate 较大的时间
* @return 相差天数
*/
public static int daysBetween(Date smdate, Date bdate) {
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
smdate = sdf.parse(sdf.format(smdate));
bdate = sdf.parse(sdf.format(bdate));
Calendar cal = Calendar.getInstance();
cal.setTime(smdate);
long time1 = cal.getTimeInMillis();
cal.setTime(bdate);
long time2 = cal.getTimeInMillis();
long between_days = (time2 - time1) / (1000 * 3600 * 24);
return Integer.parseInt(String.valueOf(between_days));
} catch (Exception e) {
return -1;
}
}
}

+ 13
- 0
.svn/pristine/27/279fa8c23aef7c590e6811b63402e2e3fade4253.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework:spring-aspects:5.2.7.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/5.2.7.RELEASE/spring-aspects-5.2.7.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/5.2.7.RELEASE/spring-aspects-5.2.7.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/spring-aspects/5.2.7.RELEASE/spring-aspects-5.2.7.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/27/27fbfbd621d27ac9e0c1f8dc3b1fcef179e690fb.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-web/2.3.1.RELEASE/spring-boot-starter-web-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-web/2.3.1.RELEASE/spring-boot-starter-web-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-web/2.3.1.RELEASE/spring-boot-starter-web-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 5
- 0
.svn/pristine/29/2957b98613d23c920eac75bbbb51d013c03c3df5.svn-base View File

@ -0,0 +1,5 @@
F:\java\workspace\hellospring\src\test\java\com\whn\hellospring\CustomerTest.java
F:\java\workspace\hellospring\src\test\java\com\whn\hellospring\HellospringApplicationTests.java
F:\java\workspace\hellospring\src\test\java\com\whn\hellospring\OrderTest.java
F:\java\workspace\hellospring\src\test\java\com\whn\hellospring\MenuTest.java
F:\java\workspace\hellospring\src\test\java\com\whn\hellospring\AppTest.java

+ 44
- 0
.svn/pristine/29/29a963c396179ce287062d6522dc60b3caeb8af6.svn-base View File

@ -0,0 +1,44 @@
package com.whn.hellospring.service;
import com.whn.hellospring.model.MenuDO;
import com.whn.hellospring.repository.MenuCoffeeRepository;
import com.whn.hellospring.repository.MenuRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class MenuService {
@Autowired
private MenuRepository menuRepository;
@Autowired
private MenuCoffeeRepository menuCoffeeRepository;
/**
* 获取菜单类型列表
*/
public List<MenuDO> getMenuTypeList() {
return menuRepository.getMenuList();
// List<MenuDTO> returnList = new ArrayList<>();
// for (MenuDO menudo : menuRepository.getMenuList()) {
// Optional<MenuCoffeeDO> coffeeList = menuCoffeeRepository.findById(menudo.getId());
//
// MenuDTO menuDTO = new MenuDTO();
// if (coffeeList.isPresent()) menuDTO.setCoffee_list(MyOptional.toList(coffeeList));
// menuDTO.setId(menudo.getId());
// menuDTO.setCreateTime(menudo.getCreateTime());
// menuDTO.setUpdateTime(menudo.getUpdateTime());
// menuDTO.setType(menudo.getType());
//
// returnList.add(menuDTO);
// }
// return returnList;
}
}

+ 13
- 0
.svn/pristine/2a/2a31b27ceb07b3f41738f4c4b737da227228359f.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.github.pagehelper:pagehelper:5.1.11">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/github/pagehelper/pagehelper/5.1.11/pagehelper-5.1.11-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 506
- 0
.svn/pristine/2a/2aacd66820b5ee6e4047702d457a2378d2d2e9bb.svn-base View File

@ -0,0 +1,506 @@
package com.whn.hellospring.utils
import java.io.UnsupportedEncodingException
import java.text.DecimalFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.Date
import java.util.regex.Pattern
import java.util.regex.PatternSyntaxException
/**
* 字符串操作类
*/
object StringUtil {
/**
* 处理重叠字符
* ABCCCD -> AB3CD
*/
fun overlapCharacter(list: List<String>): String {
//排序
// java.util.Collections.sort(list)
var j = 0
var finalStr = ""
while (j < list.size) {
val str = list[j] //C
//如果已经存在当前要添加的字符 ABC + C AB2C +C
if (finalStr.contains(str)) {
if (j - 1 < 0) { //第一位 C+C
finalStr = "2" + finalStr
} else {
val index = finalStr.indexOf(str)
if (index > 0) {
val timesStr = finalStr.substring(index - 1, index) //倍数2
if (isInteger(timesStr)) {// AB2C +C
val timesInt = timesStr.toInt() + 1
finalStr = finalStr.substring(0, finalStr.length - 2)
finalStr += timesInt.toString()
finalStr += str
} else {// ABC + C
finalStr = finalStr.substring(0, finalStr.length - 1)
finalStr += "2"
finalStr += str
}
} else { //B2C4D + B
finalStr = "2" + finalStr
}
}
} else {
finalStr += str
}
j++
}
return finalStr
}
/*方法二:推荐,速度最快
* 判断是否为整数
* @param str 传入的字符串
* @return 是整数返回true,否则返回false
*/
fun isInteger(str: String): Boolean {
val pattern = Pattern.compile("^[-\\+]?[\\d]*$")
return pattern.matcher(str).matches()
}
/**
* 保留一位小数,四舍五入
* 使用0.00不足位补0,#.##仅保留有效位
*/
fun doubleToString1(num: Double?): String {
// if(!isNumber(num.toString()))return "0.0"
// return DecimalFormat("0.0").format(num)
if(!isNumber(num.toString()))return "0.0"
return String.format("%.1f", num!!.toDouble())
}
/**
* 保留两位小数,四舍五入
* 使用0.00不足位补0,#.##仅保留有效位
*/
fun doubleToString2(num: Double?): String {
// if(!isNumber(num.toString()))return "0.00"
// return DecimalFormat("0.00").format(num)
if(!isNumber(num.toString()))return "0.00"
return String.format("%.2f", num!!.toDouble())
}
/**
* 四舍五入
* 1位小数
*/
fun rounding1(num: String?): String {
if(!isNumber(num))return "0.0"
return String.format("%.1f", num!!.toDouble())
}
/**
* 四舍五入
* 2位小数
*/
fun rounding2(num: String?): String {
if(!isNumber(num))return "0.00"
return String.format("%.2f", num!!.toDouble())
}
/**
* 按长度截取中英文混合string
*
* @param text 字符串
* @param length 长度
* @param endWith 末尾追加
* @return
*/
fun subStringIncludeChinese(text: String, length: Int,
endWith: String): String {
var text = text
text = text.trim { it <= ' ' }
val textLength = text.length
var byteLength = 0
val returnStr = StringBuffer()
var i = 0
while (i < textLength && byteLength < length * 2) {
val str_i = text.substring(i, i + 1)
if (str_i.toByteArray().size == 1) {// 英文
byteLength++
} else {// 中文
byteLength += 2
}
returnStr.append(str_i)
i++
}
try {
if (byteLength < text.toByteArray(charset("GBK")).size) {// getBytes("GBK")每个汉字长2,getBytes("UTF-8")每个汉字长度为3
returnStr.append(endWith)
}
} catch (e: UnsupportedEncodingException) {
e.printStackTrace()
}
return returnStr.toString()
}
/**
* 获取字符串的长度,如果有中文,则每个中文字符计为2位
*
* @param text 指定的字符串
* @return 字符串的长度
*/
fun getStringLengthIncludeChinese(text: String): Int {
var text = text
text = text.trim { it <= ' ' }
var valueLength = 0
val chinese = "[\u0391-\uFFE5]"
/* 获取字段值的长度,如果含中文字符,则每个中文字符长度为2,否则为1 */
for (i in 0..text.length - 1) {
/* 获取一个字符 */
val temp = text.substring(i, i + 1)
/* 判断是否为中文字符 */
if (temp.matches(chinese.toRegex())) {
/* 中文字符长度为2 */
valueLength += 2
} else {
/* 其他字符长度为1 */
valueLength += 1
}
}
return valueLength
}
/**
* 验证邮箱地址是否正确
*
* @param email
* @return
*/
fun checkEmail(email: String): Boolean {
var flag = false
try {
val check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"
val regex = Pattern.compile(check)
val matcher = regex.matcher(email)
flag = matcher.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 判断字符串是否是数字
*
* @param number
* @return
*/
fun isNumber(number: String?): Boolean {
//如果为空,false
if (!isNotNull(number)) {
return false
}
//只有.
if (number == ".") {
return false
}
//如果有多个点,false
val list = number!!.split(".")
if (list.size > 2) {
return false
}
//如果有其他字符 false
var flag = false
try {
val p = Pattern.compile("[0-9.-]+")
val m = p.matcher(number)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 判断是否全是英文字母组成(不区分大小写)
*
* @param letters
* @return
*/
fun isLetters(letters: String): Boolean {
var flag = false
try {
val p = Pattern.compile("^[A-Za-z]+$")
val m = p.matcher(letters)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 判断是否全是大写字母
*
* @param letters
* @return
*/
fun isUppercaseLetters(letters: String): Boolean {
var flag = false
try {
val p = Pattern.compile("^[A-Z]+$")
val m = p.matcher(letters)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 判断是否全是小写字母
*
* @param letters
* @return
*/
fun isLowercaseLetters(letters: String): Boolean {
var flag = false
try {
val p = Pattern.compile("^[a-z]+$")
val m = p.matcher(letters)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 是否数字和字母组成
*
* @param text
* @return
*/
fun isNumbersAndLetters(text: String): Boolean {
var flag = false
try {
val p = Pattern.compile("^[A-Za-z0-9]+$")
val m = p.matcher(text)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 包含数字,字母,下划线,不可以下划线开头
*
* @param text
* @return
*/
fun isNumbersUnderlineLetters(text: String): Boolean {
var flag = false
try {
val p = Pattern.compile("^(?!_)(?!.*?_$)[a-zA-Z0-9_]+$")
val m = p.matcher(text)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
/**
* 是否是密码,(字母或数字开头,包含下划线)
*
* @param text
* @param lowest_median 最低位数
* @param highest_median 最高位数
* @return
*/
fun isPassword(text: String, lowest_median: Int,
highest_median: Int): Boolean {
var flag = false
try {
val p = Pattern
.compile("^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{"
+ lowest_median.toString() + ","
+ highest_median.toString() + "}$")
val m = p.matcher(text)
flag = m.matches()
} catch (e: Exception) {
e.printStackTrace()
flag = false
}
return flag
}
// 过滤特殊字符
@Throws(PatternSyntaxException::class)
fun StringFilter(str: String): String {
// 只允许字母和数字
// String regEx = "[^a-zA-Z0-9]";
// 清除掉所有特殊字符
val regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]"
val p = Pattern.compile(regEx)
val m = p.matcher(str)
return m.replaceAll("").trim { it <= ' ' }
}
// 中文识别
fun hasChinese(source: String): Boolean {
val reg_charset = "([\\u4E00-\\u9FA5]*+)"
val p = Pattern.compile(reg_charset)
val m = p.matcher(source)
var hasChinese = false
while (m.find()) {
if ("" != m.group(1)) {
hasChinese = true
}
}
return hasChinese
}
/**
* 判断是否有特殊字符
*/
fun hasString(str: String): Boolean {
val regEx = "[`~!@#$%^&*()+=|{}':;',//[//].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]"// 特殊字符
val p = Pattern.compile(regEx)
val m = p.matcher(str)
return m.find()
}
//获取当前时间
fun refFormatNowDate(): String {
val nowTime = Date(System.currentTimeMillis())
val sdFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
return sdFormatter.format(nowTime)
}
//时间格式
fun Realtime(time: String): String {
val formatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
var str = ""
try {
val curDate = formatter.parse(time)
str = formatter.format(curDate)
} catch (e: ParseException) {
e.printStackTrace()
}
//获取当前时间
return str
}
/**
* 转换文件大小
*
* @param fileS
* @return
*/
fun FormetFileSize(fileS: Long): String {
val df = DecimalFormat("#.00")
var fileSizeString = ""
val wrongSize = "0B"
if (fileS == 0L) {
return wrongSize
}
if (fileS < 1024) {
fileSizeString = df.format(fileS.toDouble()) + "B"
} else if (fileS < 1048576) {
fileSizeString = df.format(fileS.toDouble() / 1024) + "KB"
} else if (fileS < 1073741824) {
fileSizeString = df.format(fileS.toDouble() / 1048576) + "MB"
} else {
fileSizeString = df.format(fileS.toDouble() / 1073741824) + "GB"
}
return fileSizeString
}
/**
* 检验数字的有效性
*
* @param str
* @return
*/
fun isNumberTrue(str: String): Boolean {
val c = str.substring(str.length - 1, str.length)
if (c == ".") {
return false
}
val pattern = Pattern.compile("^[0-9]+(.[0-9]*)?$")
val match = pattern.matcher(str)
return match.matches()
}
/**
* 大陆号码或香港号码均可
*/
@Throws(PatternSyntaxException::class)
fun isPhoneLegal(str: String): Boolean {
return isChinaPhoneLegal(str) || isHKPhoneLegal(str)
}
/**
* 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
* 此方法中前三位格式有:
* 13+任意数
* 15+除4的任意数
* 18+除1和4的任意数
* 17+除9的任意数
* 147
*/
@Throws(PatternSyntaxException::class)
fun isChinaPhoneLegal(str: String): Boolean {
// String regExp = "^((13[0-9])|(15[^4])|(18[0-9])|(17[0-9])|(16[0-9])|(147))\\d{8}$";
val regExp = "^\\d{11}$"
val p = Pattern.compile(regExp)
val m = p.matcher(str)
return m.matches()
}
/**
* 香港手机号码8位数,5|6|8|9开头+7位任意数
*/
@Throws(PatternSyntaxException::class)
fun isHKPhoneLegal(str: String): Boolean {
val regExp = "^(5|6|8|9)\\d{7}$"
val p = Pattern.compile(regExp)
val m = p.matcher(str)
return m.matches()
}
}

+ 35
- 0
.svn/pristine/2a/2accb2eded24fed86de0b215562bc225c7509588.svn-base View File

@ -0,0 +1,35 @@
package com.whn.hellospring.repository;
import com.whn.hellospring.model.CoffeeOrderDO;
import org.apache.ibatis.annotations.Delete;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import javax.xml.ws.soap.MTOM;
import java.util.List;
/**
* 订单数据操作
*/
public interface CoffeeOrderRepository extends JpaRepository<CoffeeOrderDO, Long> {
// //根据咖啡名,获取订单
// List<CoffeeOrderDO> findByItems_Name(String name);
//根据订单id获取订单
@Query(value = "select * from T_ORDER where id=?1",nativeQuery = true)
CoffeeOrderDO queryOrderWithId(Long id);
//根据订单id删除订单
@Transactional //事务
@Modifying //更新
@Query(value = "DELETE from T_ORDER where id=?1",nativeQuery = true)
int deleteOrderWithId(Long id);
//根据客户,获取订单
@Query(value = "select * from t_order where customer_id = ?1", nativeQuery = true)
List<CoffeeOrderDO> queryOrderListWithCustomerId(String customerId);
}

+ 13
- 0
.svn/pristine/2d/2d2f1a5302a4f4a0625e8cfec2e594db605d83d9.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: net.minidev:json-smart:2.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/net/minidev/json-smart/2.3/json-smart-2.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/net/minidev/json-smart/2.3/json-smart-2.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/net/minidev/json-smart/2.3/json-smart-2.3-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/2e/2e2e49e712d82ff249bc475450ee4e5eab5bdbf3.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/1.3.2/mybatis-spring-boot-autoconfigure-1.3.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/1.3.2/mybatis-spring-boot-autoconfigure-1.3.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/1.3.2/mybatis-spring-boot-autoconfigure-1.3.2-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/31/31735d2b419016ad0ba2c28d145a46e05e41d5d8.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.glassfish.jaxb:txw2:2.3.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jaxb/txw2/2.3.3/txw2-2.3.3-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/31/31e08ef5e7bc50ce55844bca6e45341bd3524a09.svn-base View File


+ 13
- 0
.svn/pristine/32/32835787ced5df1f3bcd4e5ed94d8b15a037c66b.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.mybatis:mybatis:3.4.6">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.4.6/mybatis-3.4.6.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.4.6/mybatis-3.4.6-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/mybatis/mybatis/3.4.6/mybatis-3.4.6-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/32/32d75d23d991cb4e53e2ba53fcd46d0fe21d3287.svn-base View File


+ 13
- 0
.svn/pristine/33/33b9de911d8128c27e10e29b1bab999f6dd7ce1e.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.3.1.RELEASE/spring-boot-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.3.1.RELEASE/spring-boot-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot/2.3.1.RELEASE/spring-boot-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

BIN
.svn/pristine/35/35fd10fc8efce0c835cdb51f8ec5e98ab4d1f183.svn-base View File


BIN
.svn/pristine/36/36c0a706af7b4564a257a1bad77dbba1a2234af0.svn-base View File


+ 13
- 0
.svn/pristine/37/378ee51ad2ce5bccd9037a1efc55298113af722b.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 2
- 0
.svn/pristine/38/38f74b4eeb1e98358ea02312874efa835fcc6065.svn-base View File

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

BIN
.svn/pristine/39/390bf6c50b181128ad4e3a8aa0d41d0235a86e7a.svn-base View File


+ 118
- 0
.svn/pristine/39/39c81ee632732ced5b74d6ead71fe92fbf94fda1.svn-base View File

@ -0,0 +1,118 @@
package com.whn.hellospring.service;
import com.whn.hellospring.model.OilDO;
import com.whn.hellospring.repository.OilRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Service
public class OilService {
@Autowired
private OilRepository oilRepository;
/**
* 油耗列表
*/
public List<Double> getWearList(Long customer_id){
return oilRepository.findWearList(customer_id);
}
/**
* 获取有效数量num之和
* @return
*/
public double getNumTotal(Long customer_id){
return oilRepository.countNum(customer_id);
}
/**
* 获取有效区间里程和
* @return
*/
public double getIntervalMileageTotal(Long customer_id){
return oilRepository.countIntervalMileage(customer_id);
}
/**
* 获取最新的一条有效记录
*/
public OilDO getRecentlyRecord(Long customer_id) {
List<OilDO> recordList = oilRepository.finAllSortByTime(customer_id);
if (recordList == null || recordList.size() == 0) return null;
int index = -1;
for (int i = 0; i < recordList.size(); i++) {
OilDO oilDO = recordList.get(i);
if (oilDO.getStatus() == 1) {
index = i;
break;
}
}
if(index==-1){
return null;
}else{
return recordList.get(index);
}
}
/**
* 获取有效记录列表
*/
public List<OilDO> getRecordList(Long customer_id) {
List<OilDO> recordList = oilRepository.finAllSortByTime(customer_id);
// Collections.reverse(recordList);
List<OilDO> list = new ArrayList<>();
for (int i = 0; i < recordList.size(); i++) {
if (recordList.get(i).getStatus() == 1) {
list.add(recordList.get(i));
}
}
log.info("list:{}", list);
return list;
}
/**
* 获取全部记录列表
* 包括被删除的status = 0
*/
public List<OilDO> getRecordAllList(Long customer_id) {
List<OilDO> recordList = oilRepository.finAllSortByTime(customer_id);
// Collections.reverse(recordList);
log.info("recordList:{}", recordList);
return recordList;
}
/**
* 新增更新
*/
public OilDO addUpdateRecord(OilDO oilDO) {
OilDO save = oilRepository.save(oilDO);
return save;
}
/**
* 删除
*
* @return
*/
public OilDO deleteRecord(Long id) {
OilDO oilDO = oilRepository.getOne(id);
oilDO.setStatus(0);
return oilRepository.save(oilDO);
}
}

+ 297
- 0
.svn/pristine/3a/3afd456aa877390299aa93b7fd9f25c6cfb9a052.svn-base View File

@ -0,0 +1,297 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="web" />
</artifacts-to-build>
</component>
<component name="ChangeListManager">
<list default="true" id="4ac83321-addc-493f-bf36-c1df665b9161" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_DATA_SOURCES" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<option name="HIDDEN_KINDS">
<set />
</option>
<expand>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="MySQL for 5.1 - @localhost" type="feb32156:DbDataSourceImpl" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="MySQL for 5.1 - @localhost" type="feb32156:DbDataSourceImpl" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="MySQL for 5.1 - @localhost" type="feb32156:DbDataSourceImpl" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="test: schema" type="76f4a085:MysqlImplModel$Schema" />
</path>
</expand>
<select />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
<component name="MavenImportPreferences">
<option name="importingSettings">
<MavenImportingSettings>
<option name="importAutomatically" value="true" />
<option name="vmOptionsForImporter" value="-Xmx768m" />
</MavenImportingSettings>
</option>
</component>
<component name="ProjectId" id="1e7TyAErjqLx4yHALZIOB4CjAFV" />
<component name="PropertiesComponent">
<property name="DatabaseDriversLRU" value="mysql" />
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/src/main/java/com/whn/hellospring/top" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_package_manager_path" value="npm" />
<property name="project.structure.last.edited" value="Artifacts" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.lookFeel" />
</component>
<component name="RecentsManager">
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.whn.hellospring.request" />
<recent name="com.whn.hellospring.model" />
<recent name="com.whn.hellospring.common" />
</key>
<key name="CopyFile.RECENT_KEYS">
<recent name="F:\java\workspace\hellospring\src\main\java\com\whn\hellospring\top" />
<recent name="F:\java\workspace\hellospring\src\main\java\com\whn\hellospring\utils" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Spring Boot.HellospringApplication">
<configuration name="AppTest.getVersion" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hellospring" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.whn.hellospring.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.whn.hellospring" />
<option name="MAIN_CLASS_NAME" value="com.whn.hellospring.AppTest" />
<option name="METHOD_NAME" value="getVersion" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="CustomerTest.createCustomer" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hellospring" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.whn.hellospring.controller.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.whn.hellospring" />
<option name="MAIN_CLASS_NAME" value="com.whn.hellospring.CustomerTest" />
<option name="METHOD_NAME" value="createCustomer" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="CustomerTest.queryCustomerList" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hellospring" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.whn.hellospring.controller.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.whn.hellospring" />
<option name="MAIN_CLASS_NAME" value="com.whn.hellospring.CustomerTest" />
<option name="METHOD_NAME" value="queryCustomerList" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="MenuTest.getTypeList" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hellospring" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.whn.hellospring.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.whn.hellospring" />
<option name="MAIN_CLASS_NAME" value="com.whn.hellospring.MenuTest" />
<option name="METHOD_NAME" value="getTypeList" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="OrderTest.getOrderListByCustomer" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="hellospring" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.whn.hellospring.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.whn.hellospring" />
<option name="MAIN_CLASS_NAME" value="com.whn.hellospring.OrderTest" />
<option name="METHOD_NAME" value="getOrderListByCustomer" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="hellospring [package]" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="clean" />
<option value="package" />
</list>
</option>
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
<configuration name="HellospringApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="hellospring" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.whn.hellospring.HelloSpringApplication" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="JUnit.OrderTest.getOrderListByCustomer" />
<item itemvalue="JUnit.AppTest.getVersion" />
<item itemvalue="JUnit.MenuTest.getTypeList" />
<item itemvalue="JUnit.CustomerTest.queryCustomerList" />
<item itemvalue="JUnit.CustomerTest.createCustomer" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4ac83321-addc-493f-bf36-c1df665b9161" name="Default Changelist" comment="" />
<created>1593671883249</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1593671883249</updated>
<workItem from="1593671885863" duration="4524000" />
<workItem from="1593677673425" duration="762000" />
<workItem from="1593737836147" duration="2536000" />
<workItem from="1593742607955" duration="1162000" />
<workItem from="1594001384549" duration="16359000" />
<workItem from="1594279295601" duration="1656000" />
<workItem from="1594693203284" duration="9083000" />
<workItem from="1594708755510" duration="2513000" />
<workItem from="1594773582682" duration="901000" />
<workItem from="1599617545853" duration="458000" />
<workItem from="1599618332390" duration="12929000" />
<workItem from="1599638229466" duration="174000" />
<workItem from="1599638410014" duration="5016000" />
<workItem from="1599698444454" duration="9196000" />
<workItem from="1599720039599" duration="5498000" />
<workItem from="1599791771693" duration="11410000" />
<workItem from="1600155844117" duration="1979000" />
<workItem from="1600217250398" duration="28949000" />
<workItem from="1600414011667" duration="2000" />
<workItem from="1600744532530" duration="3567000" />
<workItem from="1600842523881" duration="1797000" />
<workItem from="1601357689886" duration="11000" />
<workItem from="1603156074398" duration="7159000" />
<workItem from="1603171512363" duration="12000" />
<workItem from="1603172575824" duration="15293000" />
<workItem from="1603335556027" duration="692000" />
<workItem from="1603349250851" duration="813000" />
<workItem from="1604392664473" duration="2251000" />
<workItem from="1604713941462" duration="3308000" />
<workItem from="1605072510241" duration="6567000" />
<workItem from="1605144104971" duration="10091000" />
<workItem from="1605660438369" duration="109000" />
<workItem from="1606701499160" duration="1453000" />
<workItem from="1606972912770" duration="114000" />
<workItem from="1608258652910" duration="5617000" />
<workItem from="1608275126842" duration="1984000" />
<workItem from="1612425322917" duration="34000" />
<workItem from="1615790331897" duration="16791000" />
<workItem from="1617152159077" duration="51000" />
<workItem from="1618464676907" duration="178000" />
<workItem from="1619165257485" duration="626000" />
<workItem from="1623980339280" duration="352000" />
<workItem from="1624582330528" duration="216000" />
<workItem from="1625014165167" duration="5675000" />
<workItem from="1626139111485" duration="17000" />
<workItem from="1626140437987" duration="7597000" />
<workItem from="1626239169575" duration="1987000" />
<workItem from="1626402750510" duration="1660000" />
<workItem from="1626421794576" duration="4398000" />
<workItem from="1626499162143" duration="939000" />
<workItem from="1626676705230" duration="6228000" />
<workItem from="1627270316455" duration="358000" />
<workItem from="1629184261905" duration="2621000" />
<workItem from="1629699187872" duration="2729000" />
<workItem from="1629771259639" duration="14607000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
</project>

BIN
.svn/pristine/3b/3b3455b0b60f855f8fcbf39026f6bf2bb56a55c6.svn-base View File


+ 31
- 0
.svn/pristine/3b/3bece19b1c5c92166b5495e8320d15883a5bbff6.svn-base View File

@ -0,0 +1,31 @@
package com.whn.hellospring.model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Sort;
import org.hibernate.annotations.UpdateTimestamp;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
@MappedSuperclass
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(updatable = false)
@CreationTimestamp
private Date createTime;
@UpdateTimestamp
private Date updateTime;
}

+ 65
- 0
.svn/pristine/3e/3e004b850c7529ca2a1a6b4cf72b59a13942a0c4.svn-base
File diff suppressed because it is too large
View File


+ 37
- 0
.svn/pristine/3e/3e18cfeeeffc5088d46f8139256da554e9eed180.svn-base View File

@ -0,0 +1,37 @@
package com.whn.hellospring;
import com.whn.hellospring.model.CustomerDO;
import com.whn.hellospring.repository.CustomerRepository;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
@Slf4j
public class CustomerTest {
@Autowired
CustomerRepository customerRepository;
/**
* 新增一个顾客
*/
@Test
void createCustomer(){
CustomerDO customerDO = CustomerDO.builder().age(18).name("李四").phone("18657545213").pass_word("123456").build();
customerRepository.save(customerDO);
}
/**
* 获取顾客列表
*/
@Test
void queryCustomerList(){
log.info("CustomerList{}",customerRepository.findAll());
}
}

+ 13
- 0
.svn/pristine/3e/3e66de3585a713b1d7d3fc4358c71577d01c5783.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.junit.platform:junit-platform-commons:1.6.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/junit/platform/junit-platform-commons/1.6.2/junit-platform-commons-1.6.2-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/3f/3f7dbeb62c2502380284667af71483c4753dbd6d.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.3.50">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 8
- 0
.svn/pristine/40/402d09404c5b98265de6fc421cd2785c82874bd8.svn-base View File

@ -0,0 +1,8 @@
package com.whn.hellospring.request;
import lombok.Data;
@Data
public class DeleteOrderRequest extends BaseRequest {
private Long id;
}

+ 25
- 0
.svn/pristine/45/45f1df717863b24ef1c7c1167e1198cca0a62389.svn-base View File

@ -0,0 +1,25 @@
package com.whn.hellospring;
import com.whn.hellospring.model.VersionDO;
import com.whn.hellospring.service.AppService;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.List;
@SpringBootTest
@Slf4j
public class AppTest {
@Autowired
AppService service;
@Test
public void getVersion(){
List<VersionDO> version = service.getVersion(1);
log.info("version{}:"+version);
}
}

+ 25
- 0
.svn/pristine/46/46201449ff1746d044ceeb9fd020c424c1527cd4.svn-base View File

@ -0,0 +1,25 @@
package com.whn.hellospring.service;
import com.whn.hellospring.model.VersionDO;
import com.whn.hellospring.repository.AppRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class AppService {
@Autowired
AppRepository repository;
/**
* 获取版本列表
*/
public List<VersionDO> getVersion(int equipment) {
List<VersionDO> versionDOList = repository.findByEquipment(equipment);
return versionDOList;
}
}

+ 21
- 0
.svn/pristine/47/475b214f6d88a1cea8d9d1caceb61d0b223788ba.svn-base View File

@ -0,0 +1,21 @@
package com.whn.hellospring.utils;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collector;
public class MyOptional {
public static <T> List<T> toList(Optional<T> option) {
return option.
map(Collections::singletonList).
orElse(Collections.emptyList());
}
public static <R, A, T> R collect(Optional<T> option, Collector<? super T, A, R> collector) {
final A container = collector.supplier().get();
option.ifPresent(v -> collector.accumulator().accept(container, v));
return collector.finisher().apply(container);
}
}

+ 13
- 0
.svn/pristine/47/47fd73a951a6ac0f8a803aeb245e0b400a8ec422.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.1.RELEASE">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-logging/2.3.1.RELEASE/spring-boot-starter-logging-2.3.1.RELEASE.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-logging/2.3.1.RELEASE/spring-boot-starter-logging-2.3.1.RELEASE-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/org/springframework/boot/spring-boot-starter-logging/2.3.1.RELEASE/spring-boot-starter-logging-2.3.1.RELEASE-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 66
- 0
.svn/pristine/48/48d3926a720e5f501f2ff68c6aa7327477590429.svn-base
File diff suppressed because it is too large
View File


+ 13
- 0
.svn/pristine/48/48d4fc7858a222b2e8cc8fd92ea2ecaff4cae53a.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: commons-codec:commons-codec:1.14">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.14/commons-codec-1.14.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.14/commons-codec-1.14-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-codec/commons-codec/1.14/commons-codec-1.14-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 65
- 0
.svn/pristine/4a/4a455449f840bf80b243f127ea75b636846982d6.svn-base View File

@ -0,0 +1,65 @@
package com.whn.hellospring.controller;
import com.whn.hellospring.model.CoffeeDO;
import com.whn.hellospring.model.CoffeeDTO;
import com.whn.hellospring.request.DeleteCoffeeRequest;
import com.whn.hellospring.request.GetCoffeeListByOrderIdRequest;
import com.whn.hellospring.service.CoffeeService;
import com.whn.hellospring.utils.DO2DTOUtil;
import org.joda.money.CurrencyUnit;
import org.joda.money.Money;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
@RestController
@RequestMapping(value = "/coffee")
public class CoffeeController {
@Autowired
CoffeeService service;
/**
* 创建编辑咖啡
*/
@PostMapping(value = "/update")
public String createCoffee(@Valid @RequestBody CoffeeDTO coffeeDTO){
CoffeeDO coffeeDO = (CoffeeDO) DO2DTOUtil.getInstance().dtoToDo(coffeeDTO, CoffeeDO.class);
coffeeDO.setPrice(Money.of(CurrencyUnit.of("CNY"),coffeeDTO.getPrice()));
service.updateCoffee(coffeeDO);
return "success";
}
/**
* 删除咖啡
*/
@PostMapping(value = "/delete")
public String deleteCoffeeById(@RequestBody DeleteCoffeeRequest request){
service.deleteCoffee(request.getId());
return "success";
}
/**
* 获取一个订单下的咖啡列表
* @return
*/
@PostMapping(value = "/coffeeListByOrderId")
public List<CoffeeDTO> getCoffeeListByOrderId(@RequestBody GetCoffeeListByOrderIdRequest request){
List<CoffeeDO> coffeeList = service.getCoffeeListWithOrderId(request.getOrderId());
List<CoffeeDTO> coffeeDTOList = new ArrayList<>();
for (CoffeeDO coffeeDo :coffeeList) {
CoffeeDTO dto = new CoffeeDTO(coffeeDo);
coffeeDTOList.add(dto);
}
return coffeeDTOList;
}
}

+ 6
- 0
.svn/pristine/4a/4a56db8dc2a50f3af94d9026eb97b6afbc771085.svn-base View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
</component>
</project>

+ 21
- 0
.svn/pristine/4a/4a87e5d4869f2abf97f0da0c75510aa4ec89f01e.svn-base View File

@ -0,0 +1,21 @@
package com.whn.hellospring.repository;
import com.whn.hellospring.model.CustomerDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface CustomerRepository extends JpaRepository<CustomerDO,Long> {
/**
* 是否存在该手机号
*/
@Query(value = "select * from t_customer where phone=?1", nativeQuery = true)
List<CustomerDO> isHaveThisPhone(String phone);
}

+ 13
- 0
.svn/pristine/4a/4ac91e87ea9a7ef464719e5be9dadae180d755a4.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: com.fasterxml:classmate:1.5.1">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/classmate/1.5.1/classmate-1.5.1-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/classmate/1.5.1/classmate-1.5.1-sources.jar!/" />
</SOURCES>
</library>
</component>

+ 13
- 0
.svn/pristine/4a/4ac9f64a4122b4ecf311a05d3be7ac2b966c4e74.svn-base View File

@ -0,0 +1,13 @@
<component name="libraryTable">
<library name="Maven: io.springfox:springfox-bean-validators:2.9.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/springfox/springfox-bean-validators/2.9.2/springfox-bean-validators-2.9.2-sources.jar!/" />
</SOURCES>
</library>
</component>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save