|
@@ -1,25 +1,22 @@
|
|
package com.nokia.controller;
|
|
package com.nokia.controller;
|
|
|
|
|
|
import com.nokia.common.R;
|
|
import com.nokia.common.R;
|
|
|
|
+import com.nokia.constants.ClientEnum;
|
|
import com.nokia.pojo.User;
|
|
import com.nokia.pojo.User;
|
|
import com.nokia.service.AclService;
|
|
import com.nokia.service.AclService;
|
|
-import com.nokia.vo.DapingUserVo;
|
|
|
|
-import com.nokia.vo.FenxiUserVo;
|
|
|
|
-import com.nokia.vo.LiuchengUserVo;
|
|
|
|
-import com.nokia.vo.TokenVo;
|
|
|
|
-import com.nokia.vo.VolteT2UserVo;
|
|
|
|
-import com.nokia.vo.YuceUserVo;
|
|
|
|
-import com.nokia.vo.HeidiankuUserVo;
|
|
|
|
-
|
|
|
|
|
|
+import com.nokia.vo.*;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import javax.validation.Valid;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
@Slf4j
|
|
@@ -38,8 +35,9 @@ public class VerificationController {
|
|
@Value("${top.redirect.url}")
|
|
@Value("${top.redirect.url}")
|
|
private String topRedirectUrl;
|
|
private String topRedirectUrl;
|
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
@PostMapping("/verification")
|
|
@PostMapping("/verification")
|
|
- public R verifySystem(@RequestBody TokenVo tokenEntity) {
|
|
|
|
|
|
+ public R verifySystem(@Valid @RequestBody TokenVo tokenEntity) {
|
|
User userEntity = aclService.verifySystem(tokenEntity.getToken(), tokenEntity.getFromSystem());
|
|
User userEntity = aclService.verifySystem(tokenEntity.getToken(), tokenEntity.getFromSystem());
|
|
log.debug("输出用户信息: {}", userEntity);
|
|
log.debug("输出用户信息: {}", userEntity);
|
|
Map<String, String> map = new HashMap<>();
|
|
Map<String, String> map = new HashMap<>();
|
|
@@ -65,6 +63,7 @@ public class VerificationController {
|
|
if (userEntity == null) {
|
|
if (userEntity == null) {
|
|
return R.error().data(map).message("用户不存在");
|
|
return R.error().data(map).message("用户不存在");
|
|
} else {
|
|
} else {
|
|
|
|
+ aclService.logVerification(tokenEntity, userEntity);
|
|
switch (tokenEntity.getSystem().trim().toLowerCase()) {
|
|
switch (tokenEntity.getSystem().trim().toLowerCase()) {
|
|
case "liucheng":
|
|
case "liucheng":
|
|
return R.ok().data(new LiuchengUserVo(userEntity));
|
|
return R.ok().data(new LiuchengUserVo(userEntity));
|
|
@@ -98,6 +97,10 @@ public class VerificationController {
|
|
case "luyin":
|
|
case "luyin":
|
|
LvYinVo lvYinVo = new LvYinVo(userEntity);
|
|
LvYinVo lvYinVo = new LvYinVo(userEntity);
|
|
return R.ok().data(lvYinVo);
|
|
return R.ok().data(lvYinVo);
|
|
|
|
+ case "app":
|
|
|
|
+ List<AppVerificationVO> vo = aclService.listUserFunctions(tokenEntity, userEntity.getUserId(),
|
|
|
|
+ ClientEnum.APP.value);
|
|
|
|
+ return R.ok().data(vo);
|
|
default:
|
|
default:
|
|
return R.error().message("当前允许的system为: liucheng/fenxi/daping/yuce/heidianku/volte_t2/luyin");
|
|
return R.error().message("当前允许的system为: liucheng/fenxi/daping/yuce/heidianku/volte_t2/luyin");
|
|
}
|
|
}
|