浏览代码

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

yonge 5 年之前
父节点
当前提交
c4d85a07d6

+ 2 - 1
mec-auth/mec-auth-server/src/main/java/com/ym/mec/auth/service/impl/SysUserServiceImpl.java

@@ -23,7 +23,8 @@ import com.ym.mec.common.entity.ImUserModel;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
 import com.ym.mec.im.ImFeignService;
-import com.ym.mec.user.UserFeignService;
+import com.ym.mec.im.UserFeignService;
+import org.springframework.transaction.annotation.Transactional;
 
 @Service
 public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implements SysUserService {

+ 7 - 7
mec-client-api/src/main/java/com/ym/mec/user/UserFeignService.java → mec-client-api/src/main/java/com/ym/mec/im/UserFeignService.java

@@ -1,15 +1,15 @@
-package com.ym.mec.user;
+package com.ym.mec.im;
 
+import com.ym.mec.common.config.FeignConfiguration;
+import com.ym.mec.task.fallback.UserFeignServiceFallback;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-
-import com.ym.mec.common.config.FeignConfiguration;
-import com.ym.mec.user.fallback.UserFeignServiceFallback;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 @FeignClient(name = "web-server", contextId = "UserFeignService", configuration = FeignConfiguration.class, fallback = UserFeignServiceFallback.class)
 public interface UserFeignService {
 
-	@GetMapping(value = "api/createCashAccount/{userId}")
-	public Boolean createCashAccount(@PathVariable("userId") Integer userId);
+	@RequestMapping(value = "api/createCashAccount")
+	Boolean createCashAccount(@RequestParam("userId") Integer userId);
 }

+ 2 - 2
mec-client-api/src/main/java/com/ym/mec/user/fallback/UserFeignServiceFallback.java → mec-client-api/src/main/java/com/ym/mec/task/fallback/UserFeignServiceFallback.java

@@ -1,8 +1,8 @@
-package com.ym.mec.user.fallback;
+package com.ym.mec.task.fallback;
 
 import org.springframework.stereotype.Component;
 
-import com.ym.mec.user.UserFeignService;
+import com.ym.mec.im.UserFeignService;
 
 @Component
 public class UserFeignServiceFallback implements UserFeignService {

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -25,7 +25,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0").antMatchers("/v2/api-docs","/classGroup/highClassGroups","/code/*").permitAll().anyRequest().authenticated()
+				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0").antMatchers("/v2/api-docs","/classGroup/highClassGroups","/code/*","/api/*").permitAll().anyRequest().authenticated()
 				.and().httpBasic();
 	}
 

+ 2 - 2
mec-web/src/main/java/com/ym/mec/web/controller/APIController.java

@@ -20,8 +20,8 @@ public class APIController extends BaseController {
 	@Autowired
 	private SysUserCashAccountDao sysUserCashAccountDao;
 
-	@GetMapping("/createCashAccount/{userId}")
-	public Boolean createCashAccount(@PathVariable("userId") Integer userId) {
+	@GetMapping("/createCashAccount")
+	public Boolean createCashAccount(Integer userId) {
 		// 添加用户现金账户
 		sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));