diff --git a/youlai-admin/admin-api/src/main/java/com/youlai/admin/api/UserFeignService.java b/youlai-admin/admin-api/src/main/java/com/youlai/admin/api/UserFeignService.java index c21222722..a506bb01b 100644 --- a/youlai-admin/admin-api/src/main/java/com/youlai/admin/api/UserFeignService.java +++ b/youlai-admin/admin-api/src/main/java/com/youlai/admin/api/UserFeignService.java @@ -2,6 +2,7 @@ package com.youlai.admin.api; import com.youlai.admin.pojo.dto.UserDTO; import com.youlai.common.result.Result; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; diff --git a/youlai-auth/src/main/java/com/youlai/AuthApplication.java b/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java similarity index 67% rename from youlai-auth/src/main/java/com/youlai/AuthApplication.java rename to youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java index 99ef21be8..bb2e56bbc 100644 --- a/youlai-auth/src/main/java/com/youlai/AuthApplication.java +++ b/youlai-auth/src/main/java/com/youlai/auth/AuthApplication.java @@ -1,11 +1,13 @@ -package com.youlai; +package com.youlai.auth; +import com.youlai.admin.api.UserFeignService; +import com.youlai.mall.ums.api.MemberFeignService; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.openfeign.EnableFeignClients; -@EnableFeignClients +@EnableFeignClients(basePackageClasses = {UserFeignService.class, MemberFeignService.class}) @SpringBootApplication @EnableDiscoveryClient public class AuthApplication { diff --git a/youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/OptLogAspect.java b/youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/LogAspect.java similarity index 89% rename from youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/OptLogAspect.java rename to youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/LogAspect.java index c5bf83c49..2919d4267 100644 --- a/youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/OptLogAspect.java +++ b/youlai-common/common-web/src/main/java/com/youlai/common/web/aspect/LogAspect.java @@ -1,11 +1,9 @@ package com.youlai.common.web.aspect; import cn.hutool.json.JSONUtil; -import com.youlai.common.web.pojo.domain.LoginLog; import com.youlai.common.web.pojo.domain.OptLog; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; -import lombok.extern.slf4j.Slf4j; import net.logstash.logback.marker.Markers; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.Signature; @@ -25,16 +23,16 @@ import java.util.HashMap; import java.util.Map; /** - * @Author HXR - * @CreateTime 2021-03-01 16:47 + * @author HXR + * @date 2021-03-01 16:47 */ @Aspect @Component @AllArgsConstructor -public class OptLogAspect { +public class LogAspect { - private static final Logger LOGGER = LoggerFactory.getLogger(OptLogAspect.class); - @Pointcut("execution(public * com.youlai..*.controller.*.*(..)) || execution(public * com.youlai.*.controller.*(..))") + private static final Logger LOGGER = LoggerFactory.getLogger(LogAspect.class); + @Pointcut("@annotation(io.swagger.annotations.ApiOperation)") public void Log() { } diff --git a/youlai-common/common-web/src/main/resources/META-INF/spring.factories b/youlai-common/common-web/src/main/resources/META-INF/spring.factories index 741887f88..112fdc735 100644 --- a/youlai-common/common-web/src/main/resources/META-INF/spring.factories +++ b/youlai-common/common-web/src/main/resources/META-INF/spring.factories @@ -1,3 +1,4 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.youlai.common.web.config.WebMvcConfig,\ - com.youlai.common.web.exception.GlobalExceptionHandler + com.youlai.common.web.exception.GlobalExceptionHandler,\ + com.youlai.common.web.aspect.LogAspect diff --git a/youlai-common/common-web/src/main/resources/logback-spring.xml b/youlai-common/common-web/src/main/resources/logback-spring.xml index 47fd94397..b4d394a0c 100644 --- a/youlai-common/common-web/src/main/resources/logback-spring.xml +++ b/youlai-common/common-web/src/main/resources/logback-spring.xml @@ -63,7 +63,7 @@ DEBUG - ${LOG_STASH_HOST}:5044 + ${LOG_STASH_HOST}:4560 @@ -101,7 +101,7 @@ ACCEPT DENY - ${LOG_STASH_HOST}:5044 + ${LOG_STASH_HOST}:4560 @@ -134,7 +134,7 @@ - ${LOG_STASH_HOST}:5044 + ${LOG_STASH_HOST}:4560 @@ -167,7 +167,7 @@ - ${LOG_STASH_HOST}:5044 + ${LOG_STASH_HOST}:4560 @@ -211,7 +211,7 @@ - +