mirror of
https://gitee.com/youlaitech/youlai-mall.git
synced 2024-12-23 05:00:25 +08:00
项目整合knife4j
This commit is contained in:
parent
4e5c1719a1
commit
1d2a4c07fd
15
pom.xml
15
pom.xml
@ -46,6 +46,7 @@
|
||||
<redisson.version>3.12.5</redisson.version>
|
||||
<nimbus-jose-jwt.version>8.16</nimbus-jose-jwt.version>
|
||||
<minio.version>7.1.0</minio.version>
|
||||
<knife4j.version>2.0.4</knife4j.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -93,6 +94,20 @@
|
||||
<artifactId>nimbus-jose-jwt</artifactId>
|
||||
<version>${nimbus-jose-jwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--Knife4j API文档-->
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
<version>${knife4j.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
@ -32,11 +32,9 @@ import java.util.stream.Collectors;
|
||||
@AllArgsConstructor
|
||||
public class SysUserController {
|
||||
|
||||
private ISysUserService iSysUserService;
|
||||
|
||||
private ISysUserRoleService iSysUserRoleService;
|
||||
|
||||
private ISysRoleService iSysRoleService;
|
||||
private final ISysUserService iSysUserService;
|
||||
private final ISysUserRoleService iSysUserRoleService;
|
||||
private final ISysRoleService iSysRoleService;
|
||||
|
||||
@ApiOperation(value = "列表分页", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
|
@ -7,9 +7,12 @@ import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@ -52,6 +55,7 @@ public class MinIOService implements InitializingBean {
|
||||
PutObjectArgs putObjectArgs = PutObjectArgs.builder()
|
||||
.bucket(bucketName)
|
||||
.object(objectName)
|
||||
.contentType(MediaType.IMAGE_JPEG_VALUE)
|
||||
.stream(inputStream, inputStream.available(), -1)
|
||||
.build();
|
||||
client.putObject(putObjectArgs);
|
||||
|
@ -1,5 +1,5 @@
|
||||
server:
|
||||
port: 8808
|
||||
port: 8080
|
||||
|
||||
spring:
|
||||
application:
|
||||
|
@ -1,19 +1,18 @@
|
||||
package com.youlai.auth.controller;
|
||||
|
||||
import com.youlai.admin.api.dto.UserDTO;
|
||||
import com.youlai.admin.api.service.UmsAdminService;
|
||||
import com.youlai.auth.domain.Oauth2Token;
|
||||
import com.youlai.common.result.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
||||
import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint;
|
||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -51,24 +50,4 @@ public class AuthController {
|
||||
.build();
|
||||
return Result.success(oauth2Token);
|
||||
}
|
||||
|
||||
|
||||
@Value("${rsa.publicKey}")
|
||||
public String publicKey;
|
||||
|
||||
@GetMapping("/publicKey")
|
||||
public Result getPublicKey(){
|
||||
return Result.success(this.publicKey);
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private UmsAdminService umsAdminService;
|
||||
|
||||
@GetMapping("/loadUserByUsername")
|
||||
public Result loadUserByUsername(){
|
||||
UserDTO userDTO = umsAdminService.loadUserByUsername("admin");
|
||||
return Result.success(userDTO);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user