|
@@ -1,13 +1,15 @@
|
|
|
package com.uas.sso.sso.backend.api;
|
|
package com.uas.sso.sso.backend.api;
|
|
|
|
|
|
|
|
import com.uas.sso.entity.User;
|
|
import com.uas.sso.entity.User;
|
|
|
|
|
+import com.uas.sso.sso.backend.dto.AddNewUserInfo;
|
|
|
import com.uas.sso.sso.backend.dto.UpdateUserInfo;
|
|
import com.uas.sso.sso.backend.dto.UpdateUserInfo;
|
|
|
-import com.uas.sso.sso.backend.service.UserService;
|
|
|
|
|
|
|
+import com.uas.sso.sso.backend.service.UserBackendService;
|
|
|
import com.uas.sso.sso.backend.support.ResultBean;
|
|
import com.uas.sso.sso.backend.support.ResultBean;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
|
|
+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;
|
|
@@ -23,11 +25,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping(path = "/api/user")
|
|
@RequestMapping(path = "/api/user")
|
|
|
public class UserManageController {
|
|
public class UserManageController {
|
|
|
|
|
|
|
|
- private final UserService userService;
|
|
|
|
|
|
|
+ private final UserBackendService userBackendService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- public UserManageController(UserService userService) {
|
|
|
|
|
- this.userService = userService;
|
|
|
|
|
|
|
+ public UserManageController(UserBackendService userBackendService) {
|
|
|
|
|
+ this.userBackendService = userBackendService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.GET, path = "//showUserByPagination",
|
|
@RequestMapping(method = RequestMethod.GET, path = "//showUserByPagination",
|
|
@@ -38,14 +40,15 @@ public class UserManageController {
|
|
|
@RequestParam(required = false) String key,
|
|
@RequestParam(required = false) String key,
|
|
|
@RequestParam(required = false) String keyword) {
|
|
@RequestParam(required = false) String keyword) {
|
|
|
// Controller中的Pageable类型参数默认根据查询参数 page 和 size 注入并实例化
|
|
// Controller中的Pageable类型参数默认根据查询参数 page 和 size 注入并实例化
|
|
|
- return new ResultBean<>(userService.showUserByPagination(page, fromApp, mobileValidCode, key, keyword));
|
|
|
|
|
|
|
+ return new ResultBean<>(
|
|
|
|
|
+ userBackendService.showUserByPagination(page, fromApp, mobileValidCode, key, keyword));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.GET, path = "//showEnUserByPagination",
|
|
@RequestMapping(method = RequestMethod.GET, path = "//showEnUserByPagination",
|
|
|
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
public ResultBean<org.springframework.data.domain.Page<User>> showEnUserByPagination(Pageable page, Long spaceUU) {
|
|
public ResultBean<org.springframework.data.domain.Page<User>> showEnUserByPagination(Pageable page, Long spaceUU) {
|
|
|
|
|
|
|
|
- return new ResultBean<>(userService.showEnUserByPagination(page, spaceUU));
|
|
|
|
|
|
|
+ return new ResultBean<>(userBackendService.showEnUserByPagination(page, spaceUU));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.GET, path = "//searchUserByKeyword",
|
|
@RequestMapping(method = RequestMethod.GET, path = "//searchUserByKeyword",
|
|
@@ -53,13 +56,20 @@ public class UserManageController {
|
|
|
public ResultBean<List<User>> searchUserByKeyword(@RequestParam("spaceUU") Long spaceUu,
|
|
public ResultBean<List<User>> searchUserByKeyword(@RequestParam("spaceUU") Long spaceUu,
|
|
|
String key, String keyword) {
|
|
String key, String keyword) {
|
|
|
|
|
|
|
|
- return new ResultBean<>(userService.searchUserByKeyword(spaceUu, key, keyword));
|
|
|
|
|
|
|
+ return new ResultBean<>(userBackendService.searchUserByKeyword(spaceUu, key, keyword));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(method = RequestMethod.PUT, path = "//modifyUserInfo",
|
|
@RequestMapping(method = RequestMethod.PUT, path = "//modifyUserInfo",
|
|
|
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
public ResultBean<Boolean> modifyUserInfo(@RequestBody UpdateUserInfo userInfo) {
|
|
public ResultBean<Boolean> modifyUserInfo(@RequestBody UpdateUserInfo userInfo) {
|
|
|
|
|
|
|
|
- return new ResultBean<>(userService.modifyUserInfo(userInfo));
|
|
|
|
|
|
|
+ return new ResultBean<>(userBackendService.modifyUserInfo(userInfo));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @RequestMapping(method = RequestMethod.POST, path = "//addNewUser",
|
|
|
|
|
+ produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
|
|
+ public ResultBean<User> addNewUser(@RequestBody @Validated AddNewUserInfo userInfo) {
|
|
|
|
|
+
|
|
|
|
|
+ return new ResultBean<>(userBackendService.addNewUser(userInfo));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|