Compare commits
No commits in common. "8fe9b3e3567dc85ce7b7ef687575149dffb8bd87" and "16f8f98b6437ef222872411a54f23aacaacf7247" have entirely different histories.
8fe9b3e356
...
16f8f98b64
|
|
@ -9,7 +9,6 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RequestMapping("/data/ed/user")
|
@RequestMapping("/data/ed/user")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -81,8 +80,8 @@ public class UserController {
|
||||||
|
|
||||||
@ApiOperation(value = "人员绑定", notes = "")
|
@ApiOperation(value = "人员绑定", notes = "")
|
||||||
@RequestMapping(value = "/bindRoles", method = RequestMethod.POST)
|
@RequestMapping(value = "/bindRoles", method = RequestMethod.POST)
|
||||||
public ElectromagneticResult<?> bindRoles(@RequestBody List<UserBindRoleDTO> list) {
|
public ElectromagneticResult<?> bindRoles(@RequestBody UserRoleRequest userRoleRequest) {
|
||||||
if (userService.bindRoles(list)) {
|
if (userService.bindRoles(userRoleRequest)) {
|
||||||
return ElectromagneticResultUtil.success(true);
|
return ElectromagneticResultUtil.success(true);
|
||||||
} else {
|
} else {
|
||||||
return ElectromagneticResultUtil.fail("500", "不可绑定空用户");
|
return ElectromagneticResultUtil.fail("500", "不可绑定空用户");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.electromagnetic.industry.software.manage.pojo.req;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UserRoleRequest {
|
||||||
|
|
||||||
|
List<UserBindRoleDTO> bindData;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,6 @@ package com.electromagnetic.industry.software.manage.service;
|
||||||
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
import com.electromagnetic.industry.software.common.resp.ElectromagneticResult;
|
||||||
import com.electromagnetic.industry.software.manage.pojo.req.*;
|
import com.electromagnetic.industry.software.manage.pojo.req.*;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface UserService {
|
public interface UserService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,7 +81,7 @@ public interface UserService {
|
||||||
/**
|
/**
|
||||||
* 人员绑定
|
* 人员绑定
|
||||||
*/
|
*/
|
||||||
Boolean bindRoles(List<UserBindRoleDTO> list);
|
Boolean bindRoles(UserRoleRequest userRoleRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重置密码
|
* 重置密码
|
||||||
|
|
|
||||||
|
|
@ -274,11 +274,11 @@ public class UserServiceImpl implements UserService {
|
||||||
* 人员绑定
|
* 人员绑定
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean bindRoles(List<UserBindRoleDTO> list) {
|
public Boolean bindRoles(UserRoleRequest userRolesRequest) {
|
||||||
if (list == null || list.isEmpty()) {
|
if (userRolesRequest == null || userRolesRequest.getBindData().isEmpty()) {
|
||||||
throw new BizException(-1, "请勿发布空数据");
|
throw new BizException(-1, "请勿发布空数据");
|
||||||
}
|
}
|
||||||
for (UserBindRoleDTO dto : list) {
|
for (UserBindRoleDTO dto : userRolesRequest.getBindData()) {
|
||||||
activeRole(dto);
|
activeRole(dto);
|
||||||
bindRole(dto);
|
bindRole(dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue