提交项目

master
周相喜 2 years ago
parent 795cc8ce51
commit 117dd1e580

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<excludeFromCompile>
<directory url="file://$PROJECT_DIR$/internal-common/src/main/resources/archetype-resources" includeSubdirectories="true" />
<directory url="file://$PROJECT_DIR$/untitled4/src/main/resources/archetype-resources" includeSubdirectories="true" />
</excludeFromCompile>
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<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="apipassinger" />
<module name="api-passinger" />
<module name="mystry" />
<module name="untitled4" />
<module name="send-server" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="demo4" target="1.8" />
<module name="internal-common" target="1.8" />
<module name="internel-common" target="1.8" />
<module name="server-send" target="1.8" />
<module name="untitled" target="1.8" />
<module name="untitled2" target="1.8" />
<module name="untitleggg" target="1.8" />
</bytecodeTargetLevel>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="api-passinger" options="-parameters" />
<module name="apipassinger" options="-parameters" />
<module name="demo4" options="-parameters" />
<module name="internal-common" options="" />
<module name="internel-common" options="" />
<module name="mystry" options="-parameters" />
<module name="send-server" options="-parameters" />
<module name="server-send" options="" />
<module name="untitled" options="-parameters" />
<module name="untitled2" options="" />
<module name="untitled4" options="-parameters" />
<module name="untitleggg" options="-parameters" />
</option>
</component>
</project>

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/api-passinger" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/api-passinger/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/send-server" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/send-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/untitled4/src/main/java" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,36 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="TOP_LEVEL_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="INNER_CLASS_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="METHOD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
</value>
</option>
<option name="FIELD_OPTIONS">
<value>
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
<option name="REQUIRED_TAGS" value="" />
</value>
</option>
<option name="IGNORE_DEPRECATED" value="false" />
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
<option name="myAdditionalJavadocTags" value="date" />
</inspection_tool>
</profile>
</component>

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="uddun-nexus" />
<option name="name" value="uddun-nexus" />
<option name="url" value="https://nexus.uddun.com/repository/group-maven/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven-snapshots" />
<option name="name" value="maven-snapshots" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="aliyun" />
<option name="name" value="aliyun Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="sonatype-nexus-staging" />
<option name="name" value="Sonatype Nexus Staging" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven-releases" />
<option name="name" value="maven-releases" />
<option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$/internel-common" />
</component>
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="MavenBuildProjectComponent">
<option name="mavenExecutable" value="" />
<option name="Settings File" value="" />
<option name="mavenCommandLineParams" value="" />
<option name="vmOptions" value="" />
<option name="useMavenEmbedder" value="false" />
<option name="useFilter" value="false" />
<option name="Batch Mode" value="false" />
<option name="Check Plugin Updates" value="false" />
<option name="Debug" value="false" />
<option name="Errors" value="false" />
<option name="Fail At End" value="false" />
<option name="Fail Fast" value="false" />
<option name="Fail Never" value="false" />
<option name="Lax Checksums" value="false" />
<option name="No Plugin Registry" value="false" />
<option name="No Plugin Updates" value="false" />
<option name="Non Recursive" value="false" />
<option name="Offline" value="false" />
<option name="Reactor" value="false" />
<option name="Strict Checksums" value="false" />
<option name="Update Plugins" value="false" />
<option name="Update Snapshots" value="false" />
<option name="Skip Tests" value="false" />
<pom-list />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
<option value="$PROJECT_DIR$/send-server/pom.xml" />
<option value="$PROJECT_DIR$/mystry/pom.xml" />
<option value="$PROJECT_DIR$/internel-common/pom.xml" />
<option value="$PROJECT_DIR$/internal-common/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

@ -0,0 +1,3 @@
J
java:S3740"/Provide the parametrized type for this generic.(…ϸÕùÿÿÿÿ

@ -0,0 +1,7 @@
P
java:S1118":Add a private constructor to hide the implicit public one.(§¬”Ì
Q
java:S1068"6Remove this unused "PASSENGER_IDENDITY" private field.(ÕÜΘþÿÿÿÿ
I
java:S1068"3Remove this unused "DRIVER_IDENDITY" private field.(ÆïçÅ

@ -0,0 +1,7 @@
l
java:S1128"ORemove this unused import 'org.springframework.web.bind.annotation.GetMapping'.(‡¡‰Ø8¾ù©°½0
Q
java:S3740!"/Provide the parametrized type for this generic.(áϪìýÿÿÿÿ8ðÛÞ˽0
L
java:S3740"/Provide the parametrized type for this generic.(“Íó„8µð´°½0

@ -0,0 +1,7 @@
I
java:S16120",Replace this lambda with a method reference.(¥îÁ£8Á¶± ½0
I
java:S16020",Remove useless curly braces around statement(¥îÁ£8ÿ‰± ½0
W
java:S1118":Add a private constructor to hide the implicit public one.(Š¦ûÂ8ÿ‰± ½0

@ -0,0 +1,27 @@
V java:S125?"<This block of commented-out lines of code should be removed.(à›¿ùÿÿÿÿÿ
P
java:S1191"5Use classes from the Java API instead of Sun classes.(Íõ÷Ôûÿÿÿÿ
V java:S125B"<This block of commented-out lines of code should be removed.(”¼öøÿÿÿÿÿ
?
java:S2140P")Use "java.util.Random.nextInt()" instead.(Ç·–à
J
java:S2864w"4Iterate over the "entrySet" instead of the "keySet".(«ñá¬
_
java:S1128 "IRemove this unused import 'org.apache.commons.lang.time.DateFormatUtils'.(ÀÐå“
Q java:S125`"<This block of commented-out lines of code should be removed.(šâŸÁ
s
java:S3008="XRename this field "PATH_SEND_SMS" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Á¼ÿöÿÿÿÿÿ
Q
java:S1128"6Remove this unused import 'sun.security.provider.MD5'.(Íõ÷Ôûÿÿÿÿ
Y
java:S1128"CRemove this unused import 'org.apache.http.entity.ByteArrayEntity'.(ÜÊ«<C38A>
S java:S106e"9Replace this use of System.out or System.err by a logger.(âËœºûÿÿÿÿ
t
java:S2293v"YReplace the type specification in this constructor call with the diamond operator ("<>").(Ÿ“æÿùÿÿÿÿ
`
java:S1128"ERemove this unused import 'org.springframework.stereotype.Component'.(Þ÷Ѹÿÿÿÿÿ
k
java:S1128"PRemove this unused import 'org.springframework.web.bind.annotation.PostMapping'.(äƒà°ùÿÿÿÿ
b
java:S1128"GRemove this unused import 'org.apache.tomcat.util.security.MD5Encoder'.(<28>­ÿ»ýÿÿÿÿ

@ -0,0 +1,12 @@

java:S1186"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(Ò<>Õ¹
z
java:S1149("_Replace the synchronized class "StringBuffer" by an unsynchronized one such as "StringBuilder".(¨âà<C3A2>øÿÿÿÿ
3
java:S1118"Hide this public constructor.(Ò<>Õ¹
h java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Öįöúÿÿÿÿ
T
java:S4719$"9Replace charset name argument with StandardCharsets.UTF_8(³²¼™þÿÿÿÿ
O
java:S4719@"9Replace charset name argument with StandardCharsets.UTF_8(ɗ͈

@ -0,0 +1,33 @@
h
8untitled4/src/main/java/com/mashibing/util/JwtUtils.java,8\a\8ab7c26d11e8ad161c2563c07a55568b3ecb9f65
j
:untitled4/src/main/java/com/mashibing/dto/TokenResult.java,8\0\80c80f39494e1e55766484cea0a28764fa4f31ec
t
Duntitled4/src/main/java/com/mashibing/constant/IdendityConstant.java,8\0\804887beed9c82d895b0c21ca7c6f0b55dc11b4b
v
Funtitled4/src/main/java/com/mashibing/response/NumberCodeResponse.java,3\7\370666152778028850fcb9bc1fc796bc65f13e37
}
Msend-server/src/main/java/com/mashibing/sendserver/SendServerApplication.java,d\4\d4c2d21265b56c5bb7eb8ff8a00e2db7ad414c9c
z
Jsend-server/src/main/java/com/mashibing/sendserver/pojo/vo/SmsAccount.java,0\d\0d61df201aa4614e7076ad69e563a4f872fbdf55
v
Fsend-server/src/main/java/com/mashibing/sendserver/utils/MD5Utils.java,f\b\fbd7aa76caa16cb6c7b39065ef285afe9903c9a5
t
Duntitled4/src/main/java/com/mashibing/constant/CommonStatusEnum.java,1\6\1693e46b5ce9b6be5ce66416230380e302fb4112
r
Buntitled4/src/main/java/com/mashibing/dto/PassengerRequestDto.java,d\c\dcfd8ad08c9fccb3927196e53cef817c7b76f366
ˆ
Xsend-server/src/main/java/com/mashibing/sendserver/controller/SendSmsCodeController.java,f\a\fa131e89c1d00de6df89a12f7d0a01d3860ec6ad

Uapi-passinger/src/main/java/mashibing/online/text/controller/PassengerController.java,8\4\841a9a89c31fe92ca2095a073ae09e9d783e89f8
Œ
\api-passinger/src/main/java/mashibing/online/text/feign/fallback/SendSMSCodeServiceImpl.java,4\a\4ace260bb3128f87bb23a9bced0e20a3976cf34c
7
pom.xml,4\4\442292b8a7efeabbe4cc176709b833b1792140ec
E
api-passinger/pom.xml,b\4\b4fc2f8bedd871388fbd3a7ebcec5bd3369406b6
~
Napi-passinger/src/main/java/mashibing/online/text/ApiPassingerApplication.java,f\8\f8c03951fe2486c7989b1ebeb3e654171e897fb5

Oapi-passinger/src/main/java/mashibing/online/text/feign/SendSMSCodeService.java,6\0\602aa535b9f3987c17c0a3c6a0a72a3dc0827fe0

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>oneline-text-plublic</artifactId>
<groupId>com.mashibing</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>api-passinger</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>com.mashibing</groupId>
<artifactId>untitled4</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,22 @@
package mashibing.online.text;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* @author zxx
* @Description
* @date 2022/10/5
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
public class ApiPassingerApplication {
public static void main(String[] args) {
SpringApplication.run(ApiPassingerApplication.class);
}
}

@ -0,0 +1,46 @@
package mashibing.online.text.controller;
import com.mashibing.dto.PassengerRequestDto;
import com.mashibing.dto.ResponseResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
* @author zxx
* @Description
* @date 2022/10/5
*/
@RestController
public class PassengerController {
@PostMapping("/getPhoneNumberCode")
public ResponseResult getPhoneNumberCode(@RequestBody PassengerRequestDto passengerRequestDto){
// 校验参数
// 调服务获取验证码
// 存入redis 有限时间
return ResponseResult.success("成功!");
}
@PostMapping("/checkPhoneNumberCode")
public ResponseResult checkPhoneNumberCode(@RequestBody PassengerRequestDto passengerRequestDto){
// 校验参数
// 校验验证码
// 用户注册
// 返回token
return ResponseResult.success("成功!");
}
}

@ -0,0 +1,26 @@
package mashibing.online.text.feign;
import com.mashibing.dto.ResponseResult;
import mashibing.online.text.feign.fallback.SendSMSCodeServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
*
* @packageName: mashibing.online.text.feign.fallback
* @description:
* @author: nod
* @create: 2022-10-09
*/
@FeignClient(name = "send-server",fallback= SendSMSCodeServiceImpl.class)
public interface SendSMSCodeService {
@GetMapping("/send/acquireSMSCode")
public ResponseResult getSmsCode(@RequestParam("size") int size);
}

@ -0,0 +1,33 @@
package mashibing.online.text.feign.fallback;
import com.mashibing.constant.CommonStatusEnum;
import com.mashibing.dto.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import mashibing.online.text.feign.SendSMSCodeService;
import org.springframework.stereotype.Service;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
* <b>Description:</b><br>
*
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> mashibing.online.text.feign.fallback
* <br><b>ClassName:</b>
* <br><b>Date:</b> 2022/10/9 18:32
*/
@Service
@Slf4j
public class SendSMSCodeServiceImpl implements SendSMSCodeService {
@Override
public ResponseResult getSmsCode(int size) {
log.info("获取短信验证码失败");
return ResponseResult.fail(CommonStatusEnum.FAIL.getCode(), "获取短信验证码失败");
}
}

@ -0,0 +1,11 @@
server:
port: 8082
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: api-passinger

@ -0,0 +1,11 @@
server:
port: 8082
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: api-passinger

@ -0,0 +1,3 @@
artifactId=api-passinger
groupId=com.mashibing
version=1.0-SNAPSHOT

@ -0,0 +1,4 @@
mashibing\online\text\ApiPassingerApplication.class
mashibing\online\text\controller\TestController.class
mashibing\online\text\feign\SendSMSCodeService.class
mashibing\online\text\feign\fallback\SendSMSCodeServiceImpl.class

@ -0,0 +1,4 @@
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\api-passinger\src\main\java\mashibing\online\text\controller\TestController.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\api-passinger\src\main\java\mashibing\online\text\feign\SendSMSCodeService.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\api-passinger\src\main\java\mashibing\online\text\feign\fallback\SendSMSCodeServiceImpl.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\api-passinger\src\main\java\mashibing\online\text\ApiPassingerApplication.java

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.13</version>
</parent>
<groupId>com.mashibing</groupId>
<artifactId>oneline-text-plublic</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<dependencies>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.70</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>3.10.3</version>
</dependency>
</dependencies>
<modules>
<module>api-passinger</module>
<module>send-server</module>
<module>untitled4</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2021.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>oneline-text-plublic</artifactId>
<groupId>com.mashibing</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>send-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>send-server</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,15 @@
package com.mashibing.sendserver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
@SpringBootApplication
@EnableDiscoveryClient
public class SendServerApplication {
public static void main(String[] args) {
SpringApplication.run(SendServerApplication.class, args);
}
}

@ -0,0 +1,180 @@
package com.mashibing.sendserver.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mashibing.sendserver.pojo.vo.SmsAccount;
import com.mashibing.sendserver.utils.MD5Utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.apache.tomcat.util.security.MD5Encoder;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import sun.security.provider.MD5;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* @author zxx
* @Description
* @date 2022/10/7
*/
@Slf4j
@RestController("/send")
public class SendSmsCodeController {
public static final String CHARSET_UTF8 = "UTF-8";
private static PoolingHttpClientConnectionManager cm;
private static RequestConfig requestConfig;
@Resource
private SmsAccount smsAccount;
/**
*
*/
private static String PATH_SEND_SMS = "websms/smsJsonService?action=sendsms";
// public String getTest(){
// String msg="【我来啦】尊敬的用户您的验证码为7062752分钟有效";
// JSONObject jsonObject= prepareSendSms(smsAccount.getAccount(),smsAccount.getPassword(),
// "13710620759",msg,new Date(),false,null, UUID.randomUUID().toString());
// String rutlet=post(smsAccount.getUrl()+PATH_SEND_SMS,jsonObject);
// return "";
// }
/***
*
* @author: nod
* @param
* @return
*/
@GetMapping("/acquireSMSCode")
public String acquireSMSCode(@RequestParam(name = "size") int size){
int radom = (int)(((Math.random()*9)+1) * Math.pow(10,(size-1)));
String msg="【我来啦】尊敬的用户,您的验证码为:"+radom+"2分钟有效";
Map<String, Object> params = prepareParams(smsAccount.getAccount(), smsAccount.getPassword(), "13710620759", msg, null, null,
UUID.randomUUID().toString());
String rutlet=post(smsAccount.getUrl() + PATH_SEND_SMS, params);
log.info("==="+rutlet);
JSONObject jsonObject=JSON.parseObject(rutlet);
Integer status=jsonObject.getInteger("status");
if (!Integer.valueOf(0).equals(status)){
log.info("发送失败。。");
return "";
}
return String.valueOf(radom);
}
public static void main(String[] args) {
// int radom = (int)(((Math.random()*9)+1) * Math.pow(10,5));
String msg="【招商银行】尊敬的用户您的银行卡账号于10月15日14:22入账款项,人民币17,810.62。领黄金红包cmbt.cn/v5";
Map<String, Object> params = prepareParams("bzxxhyhy", "3Vf8S9", "13710620759", msg, null, null,
UUID.randomUUID().toString());
String rutlet=post("http://api.wxxsxx.com/" + PATH_SEND_SMS, params);
System.out.println("==="+rutlet);
}
private static String post(String url, Map<String, Object> params) {
String result = null;
CloseableHttpClient httpClient = null;
CloseableHttpResponse response = null;
HttpEntity entity = null;
try {
httpClient = HttpClients.custom().setConnectionManager(cm).setConnectionManagerShared(true).build();
HttpPost httpPost = new HttpPost(url);
httpPost.setConfig(requestConfig);
List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>();
for (String key : params.keySet()) {
nameValuePairList.add(new BasicNameValuePair(key, String.valueOf(params.get(key))));
}
StringEntity postEntity = new UrlEncodedFormEntity(nameValuePairList, CHARSET_UTF8);
httpPost.setEntity(postEntity);
response = httpClient.execute(httpPost);
entity = response.getEntity();
if (entity != null) {
result = EntityUtils.toString(entity, CHARSET_UTF8);
}
} catch (Exception e) {
log.error("请求错误错误信息:", e);
} finally {
// 关闭连接
if (entity != null) {
EntityUtils.consumeQuietly(entity);
}
if (response != null) {
try {
response.close();
} catch (IOException e) {
log.error("关闭HttpResponse出错错误信息" + e.getMessage());
}
}
if (httpClient != null) {
try {
httpClient.close();
} catch (IOException e) {
log.error("关闭HttpClient出错错误信息" + e.getMessage());
}
}
}
return result;
}
private static Map<String, Object> prepareParams(String account, String password, String mobile, String content,
String contentArr, String extCode, String msgId) {
Map<String, Object> params = new HashMap<>();
params.put("userId", account);
params.put("md5password", MD5Utils.MD5(password));
if (StringUtils.isNotBlank(mobile)) {
params.put("mobile", mobile);
}
if (StringUtils.isNotBlank(content)) {
params.put("content", content);
}
if (StringUtils.isNotBlank(extCode)) {
params.put("extCode", content);
}
if (StringUtils.isNotBlank(msgId)) {
params.put("msgId", msgId);
}
if (StringUtils.isNoneBlank(contentArr)) {
params.put("contentArr", contentArr);
}
return params;
}
}

@ -0,0 +1,29 @@
package com.mashibing.sendserver.pojo.vo;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> com.mashibing.sendserver.pojo.vo
* <br><b>ClassName:</b> SmsAccount
* <br><b>Date:</b> 2022/10/8 10:24
*/
@Data
@ConfigurationProperties(prefix = "xsxx")
@Component
public class SmsAccount {
private String url;
private String account;
private String password;
}

@ -0,0 +1,72 @@
package com.mashibing.sendserver.utils;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Map;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
* <b>Description:</b><br>
*
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> com.mashibing.sendserver.controller
* <br><b>ClassName:</b>
* <br><b>Date:</b> 2022/10/9 16:59
*/
public class MD5Utils {
private static final String[] strs = new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
public MD5Utils() {
}
public static String MD5(String value) {
String md5 = "";
try {
if (value == null) {
return null;
}
byte[] btInput = value.getBytes("UTF-8");
MessageDigest mdInst = MessageDigest.getInstance("MD5");
mdInst.update(btInput);
byte[] md = mdInst.digest();
StringBuffer buffer = new StringBuffer();
for(int i = 0; i < md.length; ++i) {
int num = md[i];
if (num < 0) {
num += 256;
}
int index1 = num / 16;
int index2 = num % 16;
buffer.append(strs[index1] + strs[index2]);
}
md5 = buffer.toString();
} catch (Exception var10) {
var10.printStackTrace();
}
return md5;
}
public static String generateKey(Map<String, String> values) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] bytes = digest.digest(values.toString().getBytes("UTF-8"));
return String.format("%032x", new BigInteger(1, bytes));
} catch (NoSuchAlgorithmException var3) {
throw new IllegalStateException("MD5 algorithm not available. Fatal (should be in the JDK).", var3);
} catch (UnsupportedEncodingException var4) {
throw new IllegalStateException("UTF-8 encoding not available. Fatal (should be in the JDK).", var4);
}
}
}

@ -0,0 +1,16 @@
server:
port: 8083
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: send-server
xsxx:
url: http://api.wxxsxx.com
account: bzxxhyhy
password: 3Vf8S9

@ -0,0 +1,16 @@
server:
port: 8083
spring:
cloud:
nacos:
discovery:
server-addr: 127.0.0.1:8848
application:
name: send-server
xsxx:
url: http://api.wxxsxx.com
account: bzxxhyhy
password: 3Vf8S9

@ -0,0 +1,3 @@
artifactId=send-server
groupId=com.mashibing
version=0.0.1-SNAPSHOT

@ -0,0 +1,2 @@
com\mashibing\sendserver\SendServerApplication.class
com\mashibing\sendserver\controller\TestController.class

@ -0,0 +1,2 @@
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\send-server\src\main\java\com\mashibing\sendserver\controller\TestController.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\send-server\src\main\java\com\mashibing\sendserver\SendServerApplication.java

@ -0,0 +1,11 @@
-------------------------------------------------------------------------------
Test set: com.mashibing.sendserver.SendServerApplicationTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.451 s <<< FAILURE! - in com.mashibing.sendserver.SendServerApplicationTests
contextLoads Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'configurationPropertiesBeans' defined in org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]: Factory method 'configurationPropertiesBeans' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.context.properties.ConfigurationPropertiesBeans]: Factory method 'configurationPropertiesBeans' threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationBeanFactoryMetadata
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata

@ -0,0 +1,23 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>oneline-text-plublic</artifactId>
<groupId>com.mashibing</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>untitled4</artifactId>
<name>Archetype - untitled4</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,22 @@
package com.mashibing.constant;
import lombok.Getter;
public enum CommonStatusEnum {
SUCCESS(1,"SUCCESS"),
FAIL(0,"FAIL");
@Getter
private int code;
@Getter
private String message;
CommonStatusEnum (int code,String message){
this.code=code;
this.message=message;
}
}

@ -0,0 +1,7 @@
package com.mashibing.constant;
public class IdendityConstant {
private static final String PASSENGER_IDENDITY = "1";
private static final String DRIVER_IDENDITY = "2";
}

@ -0,0 +1,23 @@
package com.mashibing.dto;
import lombok.Data;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
* <b>Description:</b><br>
*
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> com.mashibing.dto
* <br><b>ClassName:</b>
* <br><b>Date:</b> 2022/10/14 18:30
*/
@Data
public class PassengerRequestDto {
private String phoneNumberCode;
private String phoneNumber;
}

@ -0,0 +1,35 @@
package com.mashibing.dto;
import com.mashibing.constant.CommonStatusEnum;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)//链式操作
public class ResponseResult<T> {
private int code;
private String message;
private T data;
public static <T> ResponseResult success(T data){
return new ResponseResult().setCode(CommonStatusEnum.SUCCESS.getCode())
.setMessage(CommonStatusEnum.SUCCESS.getMessage())
.setData(data);
}
public static <T> ResponseResult fail(){
return new ResponseResult().setCode(CommonStatusEnum.FAIL.getCode())
.setMessage(CommonStatusEnum.FAIL.getMessage())
.setData(null);
}
public static <T> ResponseResult fail(int code,T data){
return new ResponseResult().setCode(code)
.setMessage(CommonStatusEnum.FAIL.getMessage())
.setData(data);
}
}

@ -0,0 +1,22 @@
package com.mashibing.dto;
import lombok.Data;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
* <b>Description:</b><br>
*
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> com.mashibing.dto
* <br><b>ClassName:</b> TokenResult
* <br><b>Date:</b> 2022/10/14 9:24
*/
@Data
public class TokenResult {
private String phoneNum;
private String idendity;
}

@ -0,0 +1,9 @@
package com.mashibing.response;
import lombok.Data;
@Data
public class NumberCodeResponse {
private String numberCode;
}

@ -0,0 +1,74 @@
package com.mashibing.util;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTCreator;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.Claim;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.mashibing.dto.TokenResult;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Copyright© 2020.10.20 by .All rights reserved.
* 1.
* 2.
* 3.使.
* <b>Description:</b><br>
*
* @author nod
* <b>ProjectName:</b> onelinetextplublic
* <br><b>PackageName:</b> com.mashibing.util
* <br><b>ClassName:</b>
* <br><b>Date:</b> 2022/10/14 9:11
*/
public class JwtUtils {
private static final String SINGN = "VBq12))*&";
private static final String JWT_KEY = "phoneNum";
private static final String IDENDITY = "idendity";
//生成token
public static String genaroteToken(String phoneNum,String idendity){
Map<String,String> map =new HashMap<>();
map.put(JWT_KEY,phoneNum);
map.put(IDENDITY,idendity);
Calendar calendar=Calendar.getInstance();
calendar.add(Calendar.DATE,1);
Date date =calendar.getTime();
JWTCreator.Builder builder = JWT.create();
//遍历map,把map 的逐个元素值放到 builder里面去
map.forEach(
(k,v)->{
builder.withClaim(k,v);
}
);
//把过期时间放到builder
builder.withExpiresAt(date);
//最后生成token
return builder.sign(Algorithm.HMAC256(SINGN));
}
//解析token
public static TokenResult parseToken(String token){
DecodedJWT verify = JWT.require(Algorithm.HMAC256(SINGN)).build().verify(token);
Claim phoneClaim = verify.getClaim(JWT_KEY);
Claim idendityClaim = verify.getClaim(IDENDITY);
TokenResult tokenResult = new TokenResult();
tokenResult.setIdendity(idendityClaim.toString());
tokenResult.setPhoneNum(phoneClaim.toString());
return tokenResult;
}
}

@ -0,0 +1,3 @@
artifactId=untitled4
groupId=com.mashibing
version=1.0-SNAPSHOT

@ -0,0 +1,2 @@
com\mashibing\constant\CommonStatusEnum.class
com\mashibing\dto\ResponseResult.class

@ -0,0 +1,3 @@
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\untitled4\src\main\java\com\mashibing\constant\CommonStatusEnum.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\untitled4\src\main\java\com\mashibing\dto\ResponseResult.java
D:\huaqianlearn\oneLineTxt\v1\onelinetextplublic\untitled4\src\main\java\com\mashibing\response\NumberCodeResponse.java
Loading…
Cancel
Save