diff --git a/pom.xml b/pom.xml index 2bea04706..619bfa3e4 100644 --- a/pom.xml +++ b/pom.xml @@ -46,6 +46,7 @@ 3.12.5 8.16 7.1.0 + 2.0.4 @@ -93,6 +94,20 @@ nimbus-jose-jwt ${nimbus-jose-jwt.version} + + + + + com.github.xiaoymin + knife4j-micro-spring-boot-starter + ${knife4j.version} + + + com.github.xiaoymin + knife4j-spring-boot-starter + ${knife4j.version} + + diff --git a/youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java b/youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java index eb0dceffb..d7c027a92 100644 --- a/youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java +++ b/youlai-admin/src/main/java/com/youlai/admin/controller/SysUserController.java @@ -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({ diff --git a/youlai-admin/src/main/java/com/youlai/admin/service/impl/MinIOService.java b/youlai-admin/src/main/java/com/youlai/admin/service/impl/MinIOService.java index ca53e4a93..33c409249 100644 --- a/youlai-admin/src/main/java/com/youlai/admin/service/impl/MinIOService.java +++ b/youlai-admin/src/main/java/com/youlai/admin/service/impl/MinIOService.java @@ -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); diff --git a/youlai-admin/src/main/resources/bootstrap.yml b/youlai-admin/src/main/resources/bootstrap.yml index db415fbd4..d01f75746 100644 --- a/youlai-admin/src/main/resources/bootstrap.yml +++ b/youlai-admin/src/main/resources/bootstrap.yml @@ -1,5 +1,5 @@ server: - port: 8808 + port: 8080 spring: application: diff --git a/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java b/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java index 3c8d57542..8718abd03 100644 --- a/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java +++ b/youlai-auth/src/main/java/com/youlai/auth/controller/AuthController.java @@ -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); - } - }