Commit 6f43d9c5 authored by fangxinjiang's avatar fangxinjiang

init

parent 0e381407
......@@ -16,16 +16,14 @@
package com.yifu.cloud.plus.v1.yifu.auth;
import com.yifu.cloud.plus.v1.yifu.common.feign.annotation.EnableYifuFeignClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author lengleng
* @date 2018年06月21日 认证授权中心
*/
@EnableYifuFeignClients
//@EnableYifuFeignClients
@SpringBootApplication
public class YifuAuthApplication {
......
......@@ -16,9 +16,7 @@
package com.yifu.cloud.plus.v1.yifu.common.log;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteLogService;
import com.yifu.cloud.plus.v1.yifu.common.log.aspect.SysLogAspect;
import com.yifu.cloud.plus.v1.yifu.common.log.event.SysLogListener;
import lombok.RequiredArgsConstructor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
......@@ -35,10 +33,10 @@ import org.springframework.scheduling.annotation.EnableAsync;
@Configuration(proxyBeanMethods = false)
public class LogAutoConfiguration {
@Bean
/*@Bean
public SysLogListener sysLogListener(RemoteLogService remoteLogService) {
return new SysLogListener(remoteLogService);
}
}*/
@Bean
public SysLogAspect sysLogAspect() {
......
......@@ -17,8 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.common.log.event;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteLogService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
......@@ -32,14 +30,14 @@ import org.springframework.scheduling.annotation.Async;
@RequiredArgsConstructor
public class SysLogListener {
private final RemoteLogService remoteLogService;
//private final RemoteLogService remoteLogService;
@Async
@Order
@EventListener(SysLogEvent.class)
public void saveSysLog(SysLogEvent event) {
SysLog sysLog = (SysLog) event.getSource();
remoteLogService.saveLog(sysLog, SecurityConstants.FROM_IN);
//remoteLogService.saveLog(sysLog, SecurityConstants.FROM_IN);
}
}
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.yifu.common.security.service;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteUserService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -37,7 +36,7 @@ import org.springframework.security.core.userdetails.UserDetails;
@RequiredArgsConstructor
public class YifuAppUserDetailsServiceImpl implements YifuUserDetailsService {
private final RemoteUserService remoteUserService;
//private final RemoteUserService remoteUserService;
private final CacheManager cacheManager;
......@@ -54,7 +53,7 @@ public class YifuAppUserDetailsServiceImpl implements YifuUserDetailsService {
return (YifuUser) cache.get(phone).get();
}
R<UserInfo> result = remoteUserService.infoByMobile(phone, SecurityConstants.FROM_IN);
R<UserInfo> result = null;//remoteUserService.infoByMobile(phone, SecurityConstants.FROM_IN);
UserDetails userDetails = getUserDetails(result);
if (cache != null) {
......
......@@ -17,16 +17,13 @@
package com.yifu.cloud.plus.v1.yifu.common.security.service;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteUserService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprUpmsProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
......@@ -44,7 +41,7 @@ import org.springframework.security.core.userdetails.UserDetails;
@RequiredArgsConstructor
public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
private final RemoteUserService remoteUserService;
//private final RemoteUserService remoteUserService;
private final CacheManager cacheManager;
......
......@@ -42,11 +42,11 @@
<artifactId>swagger-annotations</artifactId>
</dependency>
<!--feign 注解依赖-->
<dependency>
<!--<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<optional>true</optional>
</dependency>
</dependency>-->
<!--mybatis 依赖-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
......
......@@ -17,9 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -29,7 +27,7 @@ import java.util.List;
/**
* @author hccake
*/
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UMPS_SERVICE)
//@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteDeptService {
/**
......
package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysDictItem;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -15,7 +13,7 @@ import java.util.List;
* <p>
* 查询参数相关
*/
@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.UMPS_SERVICE)
//@FeignClient(contextId = "remoteDictService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteDictService {
/**
......
......@@ -18,9 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.admin.api.entity.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -29,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestHeader;
* @author lengleng
* @date 2019/2/1
*/
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.UMPS_SERVICE)
//@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteLogService {
/**
......
package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -14,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestHeader;
* <p>
* 查询参数相关
*/
@FeignClient(contextId = "remoteParamService", value = ServiceNameConstants.UMPS_SERVICE)
//@FeignClient(contextId = "remoteParamService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteParamService {
/**
......
......@@ -17,9 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
......@@ -28,7 +26,7 @@ import java.util.Map;
* @author lengleng
* @date 2019/2/1
*/
@FeignClient(contextId = "remoteTokenService", value = ServiceNameConstants.AUTH_SERVICE)
//@FeignClient(contextId = "remoteTokenService", value = ServiceNameConstants.AUTH_SERVICE)
public interface RemoteTokenService {
/**
......
......@@ -18,9 +18,7 @@ package com.yifu.cloud.plus.v1.yifu.admin.api.feign;
import com.yifu.cloud.plus.v1.yifu.admin.api.dto.UserInfo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ServiceNameConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -33,7 +31,7 @@ import java.util.Set;
* @author lengleng
* @date 2019/2/1
*/
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UMPS_SERVICE)
//@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UMPS_SERVICE)
public interface RemoteUserService {
/**
......
......@@ -41,10 +41,10 @@
<artifactId>oss-spring-boot-starter</artifactId>
</dependency>
<!--feign 调用-->
<dependency>
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-feign</artifactId>
</dependency>
</dependency>-->
<!--安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
......@@ -56,10 +56,10 @@
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--接口文档-->
<dependency>
<!--<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
</dependency>-->
<!-- orm 模块-->
<dependency>
<groupId>com.baomidou</groupId>
......
......@@ -16,20 +16,17 @@
package com.yifu.cloud.plus.v1.yifu.admin;
import com.yifu.cloud.plus.v1.yifu.common.feign.annotation.EnableYifuFeignClients;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.EnableYifuResourceServer;
import com.yifu.cloud.plus.v1.yifu.common.swagger.annotation.EnableYifuDoc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* @author lengleng
* @date 2018年06月21日 用户统一管理系统
*/
@EnableYifuDoc
//@EnableYifuDoc
@EnableYifuResourceServer
@EnableYifuFeignClients
//@EnableYifuFeignClients
@SpringBootApplication
public class YifuAdminApplication {
......
......@@ -16,8 +16,6 @@
package com.yifu.cloud.plus.v1.yifu.admin.controller;
import com.yifu.cloud.plus.v1.yifu.admin.api.feign.RemoteTokenService;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -39,7 +37,7 @@ import java.util.Map;
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class TokenController {
private final RemoteTokenService remoteTokenService;
//private final RemoteTokenService remoteTokenService;
/**
* 分页token 信息
......@@ -48,7 +46,7 @@ public class TokenController {
*/
@GetMapping("/page")
public R token(@RequestParam Map<String, Object> params) {
return remoteTokenService.getTokenPage(params, SecurityConstants.FROM_IN);
return null;//remoteTokenService.getTokenPage(params, SecurityConstants.FROM_IN);
}
/**
......@@ -59,7 +57,7 @@ public class TokenController {
@DeleteMapping("/{id}")
@PreAuthorize("@pms.hasPermission('sys_token_del')")
public R<Boolean> delete(@PathVariable String id) {
return remoteTokenService.removeToken(id, SecurityConstants.FROM_IN);
return null;//remoteTokenService.removeToken(id, SecurityConstants.FROM_IN);
}
}
......@@ -66,14 +66,14 @@ oss:
secretKey: lengleng
bucket-name: tmp
# swagger 配置
swagger:
enabled: true
title: Yifu Swagger API
gateway: http://${GATEWAY_HOST:yifu-gateway}:${GATEWAY-PORT:9999}
token-url: ${swagger.gateway}/auth/oauth/token
services:
yifu-upms-biz: admin
yifu-codegen: gen
#swagger:
# enabled: true
# title: Yifu Swagger API
# gateway: http://${GATEWAY_HOST:yifu-gateway}:${GATEWAY-PORT:9999}
# token-url: ${swagger.gateway}/auth/oauth/token
# services:
# yifu-upms-biz: admin
# yifu-codegen: gen
# Spring 相关
spring:
application:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment