添加用户名密码登录

master
ShiSiWei 2023-10-26 14:56:03 +08:00
parent b903d54254
commit f611a02dda
11 changed files with 268 additions and 28 deletions

View File

@ -0,0 +1,204 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaDocConfiguration">
<GENERAL>
<MODE>UPDATE</MODE>
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
<LEVELS>
<LEVEL>TYPE</LEVEL>
<LEVEL>METHOD</LEVEL>
<LEVEL>FIELD</LEVEL>
</LEVELS>
<VISIBILITIES>
<VISIBILITY>PUBLIC</VISIBILITY>
<VISIBILITY>PROTECTED</VISIBILITY>
<VISIBILITY>DEFAULT</VISIBILITY>
</VISIBILITIES>
</GENERAL>
<TEMPLATES>
<CLASSES>
<CLASS>
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
<VALUE>/**\n
* The interface ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
<VALUE>/**\n
* The enum ${name}.\n
*/</VALUE>
</CLASS>
<CLASS>
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
<VALUE>/**\n
* The type ${name}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
*/</VALUE>
</CLASS>
<CLASS>
<KEY>.+</KEY>
<VALUE>/**\n
* The type ${name}.\n
*/</VALUE>
</CLASS>
</CLASSES>
<CONSTRUCTORS>
<CONSTRUCTOR>
<KEY>.+</KEY>
<VALUE>/**\n
* Instantiates a new ${name}.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</CONSTRUCTOR>
</CONSTRUCTORS>
<METHODS>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*&lt;.+&gt;)*)+\s+get\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Gets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*&lt;.+&gt;)*)+\s+set\w+\s*\(.*\).+</KEY>
<VALUE>/**\n
* Sets ${partName}.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${partName}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
<VALUE>/**\n
* The entry point of application.\n
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
* @param ${element.parameterList.parameters[0].name} the input arguments\n
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
<METHOD>
<KEY>.+</KEY>
<VALUE>/**\n
* ${name}&lt;#if isNotVoid&gt; ${return}&lt;/#if&gt;.\n
&lt;#if element.typeParameters?has_content&gt; * \n
&lt;/#if&gt;
&lt;#list element.typeParameters as typeParameter&gt;
* @param &lt;${typeParameter.name}&gt; the type parameter\n
&lt;/#list&gt;
&lt;#if element.parameterList.parameters?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.parameterList.parameters as parameter&gt;
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
&lt;/#list&gt;
&lt;#if isNotVoid&gt;
*\n
* @return the ${return}\n
&lt;/#if&gt;
&lt;#if element.throwsList.referenceElements?has_content&gt;
*\n
&lt;/#if&gt;
&lt;#list element.throwsList.referenceElements as exception&gt;
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
&lt;/#list&gt;
*/</VALUE>
</METHOD>
</METHODS>
<FIELDS>
<FIELD>
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
* The constant ${element.getName()}.\n
*/</VALUE>
</FIELD>
<FIELD>
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isInterface()&gt;
* The constant ${element.getName()}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt; */</VALUE>
</FIELD>
<FIELD>
<KEY>.+</KEY>
<VALUE>/**\n
&lt;#if element.parent.isEnum()&gt;
*${name} ${typeName}.\n
&lt;#else&gt;
* The ${name}.\n
&lt;/#if&gt;*/</VALUE>
</FIELD>
</FIELDS>
</TEMPLATES>
</component>
</project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,5 +1,6 @@
package com.four.system.api;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -21,15 +22,31 @@ import com.four.system.api.model.LoginUser;
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteUserService
{
/**
*
*
* @param username
* @param email
* @param source
* @return
*/
@GetMapping("/user/info/{username}")
public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
@GetMapping("/user/infoByEmail/{email}")
public R<LoginUser> getUserInfoByEmail(@PathVariable("email") String email,@RequestHeader(SecurityConstants.FROM_SOURCE)String source);
/**
*
*
* @param userName
* @param source
* @return
*/
@GetMapping("/user/info/{userName}")
public R<LoginUser> getUserInfo(@PathVariable("userName") String userName, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
/**
*

View File

@ -25,9 +25,14 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
log.error("用户服务调用失败:{}", throwable.getMessage());
return new RemoteUserService()
{
@Override
public R<LoginUser> getUserInfo(String username, String source)
{
public R<LoginUser> getUserInfoByEmail(String email, String source) {
return R.fail("获取用户信息失败:"+ throwable.getMessage());
}
@Override
public R<LoginUser> getUserInfo(String userName,String source){
return R.fail("获取用户失败:"+throwable.getMessage());
}
@ -37,5 +42,6 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
return R.fail("注册用户失败:" + throwable.getMessage());
}
};
}
}

View File

@ -18,6 +18,11 @@ public class LoginUser implements Serializable
*/
private String token;
/**
*
* */
private String email;
/**
* id
*/
@ -26,7 +31,7 @@ public class LoginUser implements Serializable
/**
*
*/
private String username;
private String userName;
/**
*
@ -80,12 +85,20 @@ public class LoginUser implements Serializable
public String getUsername()
{
return username;
return userName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public void setUsername(String username)
{
this.username = username;
this.userName = username;
}
public Long getLoginTime()

View File

@ -1,5 +1,5 @@
#Generated by Maven
#Tue Oct 24 20:34:51 CST 2023
#Thu Oct 26 13:56:24 CST 2023
groupId=com.four
artifactId=four-api-system
version=3.6.3

View File

@ -1,15 +1,15 @@
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysRole.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\factory\RemoteUserFallbackFactory.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysLogininfor.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysDictType.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysUser.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\RemoteUserService.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysFile.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\factory\RemoteLogFallbackFactory.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysOperLog.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\RemoteLogService.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysDictData.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\RemoteFileService.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\domain\SysDept.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\model\LoginUser.java
D:\ruoyi\Four\four-api\four-api-system\src\main\java\com\four\system\api\factory\RemoteFileFallbackFactory.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysDictData.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\factory\RemoteFileFallbackFactory.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysRole.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\model\LoginUser.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\factory\RemoteUserFallbackFactory.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\factory\RemoteLogFallbackFactory.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\RemoteFileService.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysOperLog.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\RemoteUserService.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysLogininfor.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysDictType.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysDept.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysUser.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\RemoteLogService.java
D:\hospital\api-system\four-api-system\src\main\java\com\four\system\api\domain\SysFile.java