feat:密码模式登陆v1
This commit is contained in:
11
xs-server/src/main/java/com/xiang/AuthApplication.java
Normal file
11
xs-server/src/main/java/com/xiang/AuthApplication.java
Normal file
@@ -0,0 +1,11 @@
|
||||
package com.xiang;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class AuthApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AuthApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.xiang.xservice.auth.server.controller;
|
||||
|
||||
import com.xiang.xservice.auth.api.dto.req.LoginRequest;
|
||||
import com.xiang.xservice.auth.api.dto.resp.LoginResp;
|
||||
import com.xiang.xservice.auth.service.service.XUserService;
|
||||
import com.xiang.xservice.basic.common.resp.Result;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
public class TokenController {
|
||||
|
||||
private final XUserService userService;
|
||||
|
||||
@PostMapping("/public/auth/login")
|
||||
public Result<LoginResp> login(@RequestBody @NotNull(message = "请求参数不能为空") @Valid LoginRequest request) {
|
||||
return Result.success("操作成功", userService.login(request));
|
||||
}
|
||||
}
|
||||
23
xs-server/src/main/resources/application-local.yml
Normal file
23
xs-server/src/main/resources/application-local.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
datasource:
|
||||
master:
|
||||
url: jdbc:mysql://rm-bp1j371yx9d9894ewbo.mysql.rds.aliyuncs.com:3306/xservice-user?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||
username: root
|
||||
password: xb#UWqnhH24&XpX
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
sshConnect: false
|
||||
redis:
|
||||
host: r-bp1dqqbzlfw04fldp3pd.redis.rds.aliyuncs.com
|
||||
port: 6379
|
||||
password: Admin@123 # 如果无密码可以省略
|
||||
database: 0
|
||||
timeout: 5000
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8
|
||||
max-idle: 8
|
||||
min-idle: 0
|
||||
max-wait: 1000
|
||||
11
xs-server/src/main/resources/application.yml
Normal file
11
xs-server/src/main/resources/application.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
server:
|
||||
port: 38011
|
||||
spring:
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
mybatis:
|
||||
mapper-locations:
|
||||
- classpath*:mapper/*/*.xml
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
Reference in New Issue
Block a user