|
@@ -1,6 +1,8 @@
|
|
package com.lantone.security.web;
|
|
package com.lantone.security.web;
|
|
|
|
|
|
|
|
+import com.google.common.collect.Lists;
|
|
import com.lantone.common.api.CommonResult;
|
|
import com.lantone.common.api.CommonResult;
|
|
|
|
+import com.lantone.common.domain.UserDto;
|
|
import com.lantone.security.facade.UserAdminFacade;
|
|
import com.lantone.security.facade.UserAdminFacade;
|
|
import com.lantone.security.vo.LoginVO;
|
|
import com.lantone.security.vo.LoginVO;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
@@ -11,6 +13,7 @@ import org.springframework.validation.annotation.Validated;
|
|
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.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -40,4 +43,29 @@ public class UserAdminController {
|
|
return CommonResult.success(null);
|
|
return CommonResult.success(null);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "登录以后返回token")
|
|
|
|
+ @RequestMapping(value = "/getMyName", method = RequestMethod.POST)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public CommonResult getMyName() {
|
|
|
|
+ return CommonResult.success("任国宾");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @ApiOperation("根据用户名获取通用用户信息")
|
|
|
|
+ @RequestMapping(value = "/loadByUsername", method = RequestMethod.GET)
|
|
|
|
+ @ResponseBody
|
|
|
|
+ public UserDto loadUserByUsername(@RequestParam String username) {
|
|
|
|
+ if (!username.equals("lantone")) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ UserDto userDTO = new UserDto();
|
|
|
|
+ userDTO.setUsername("lantone");
|
|
|
|
+ userDTO.setPassword("$2a$10$T/ndIW6vgydYOVqj0syXeeSvgYbChiIU.azRmoZ.uqDQhYjN.yozy");
|
|
|
|
+ userDTO.setId(1l);
|
|
|
|
+ userDTO.setClientId("security-center");
|
|
|
|
+ userDTO.setStatus(1);
|
|
|
|
+ userDTO.setRoles(Lists.newArrayList("t1"));
|
|
|
|
+ return userDTO;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|