From cae34fd833b820f88608075c045317b53f663bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Wed, 13 Apr 2022 00:01:13 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=94=A8=E6=88=B7=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=92=8C=E7=94=A8=E6=88=B7=E6=96=B0=E5=A2=9E=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=9A=84=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/UserController.java | 46 ++++---- .../youlai/admin/mapper/SysUserMapper.java | 5 +- .../youlai/admin/pojo/entity/SysUserRole.java | 2 + .../com/youlai/admin/pojo/form/UserForm.java | 42 +++++++ .../admin/pojo/form/UserImportForm.java | 16 ++- .../{UserFormVO.java => UserDetailVO.java} | 6 +- .../youlai/admin/service/ISysUserService.java | 20 ++-- .../service/impl/SysUserServiceImpl.java | 108 +++++++++++------- .../main/resources/mapper/SysUserMapper.xml | 4 +- .../service/impl/SysUserServiceImplTest.java | 6 - 10 files changed, 159 insertions(+), 96 deletions(-) create mode 100644 youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserForm.java rename youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/{UserFormVO.java => UserDetailVO.java} (90%) diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java index 2055f7896..2837c273a 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/controller/UserController.java @@ -1,18 +1,18 @@ package com.youlai.admin.controller; import cn.hutool.core.bean.BeanUtil; -import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.youlai.admin.dto.AuthUserDTO; import com.youlai.admin.pojo.entity.SysUser; +import com.youlai.admin.pojo.form.UserForm; import com.youlai.admin.pojo.form.UserImportForm; import com.youlai.admin.pojo.query.UserPageQuery; import com.youlai.admin.pojo.vo.user.LoginUserVO; +import com.youlai.admin.pojo.vo.user.UserDetailVO; import com.youlai.admin.pojo.vo.user.UserExportVO; -import com.youlai.admin.pojo.vo.user.UserFormVO; import com.youlai.admin.pojo.vo.user.UserPageVO; import com.youlai.admin.service.ISysPermissionService; import com.youlai.admin.service.ISysUserService; @@ -25,7 +25,6 @@ import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; @@ -47,10 +46,11 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/api/v1/users") @RequiredArgsConstructor -public class UserController { +public class UserController { + private final ISysUserService iSysUserService; - private final PasswordEncoder passwordEncoder; private final ISysPermissionService iSysPermissionService; + private final PasswordEncoder passwordEncoder; @ApiOperation(value = "用户分页列表") @GetMapping("/page") @@ -61,19 +61,19 @@ public class UserController { return PageResult.success(result); } - @ApiOperation(value = "获取用户表单详情") - @GetMapping("/{userId}/form_detail") - public Result getUserDetail( - @ApiParam(value = "用户ID", example = "1") @PathVariable Long userId + @ApiOperation(value = "获取用户详情") + @GetMapping("/{userId}") + public Result getUserDetail( + @ApiParam(value = "用户ID") @PathVariable Long userId ) { - UserFormVO userDetail = iSysUserService.getUserFormDetail(userId); + UserDetailVO userDetail = iSysUserService.getUserDetail(userId); return Result.success(userDetail); } @ApiOperation(value = "新增用户") @PostMapping - public Result addUser(@RequestBody SysUser user) { - boolean result = iSysUserService.saveUser(user); + public Result addUser(@RequestBody UserForm userForm) { + boolean result = iSysUserService.saveUser(userForm); return Result.judge(result); } @@ -81,9 +81,9 @@ public class UserController { @PutMapping(value = "/{userId}") public Result updateUser( @ApiParam("用户ID") @PathVariable Long userId, - @RequestBody SysUser user + @RequestBody UserForm userForm ) { - boolean result = iSysUserService.updateUser(user); + boolean result = iSysUserService.updateUser(userId, userForm); return Result.judge(result); } @@ -96,7 +96,7 @@ public class UserController { return Result.judge(status); } - @ApiOperation(value = "选择性更新用户") + @ApiOperation(value = "选择性修改用户") @PatchMapping(value = "/{userId}") public Result updateUserPart( @ApiParam("用户ID") @PathVariable Long userId, @@ -145,7 +145,7 @@ public class UserController { public void downloadTemplate(HttpServletResponse response) throws IOException { String fileName = "用户导入模板.xlsx"; response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName,"UTF-8")); + response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); String fileClassPath = "excel-templates" + File.separator + fileName; InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(fileClassPath); @@ -158,15 +158,9 @@ public class UserController { @ApiOperation("导入用户") @PostMapping("/_import") - public Result importUsers(@RequestBody UserImportForm userImportForm, MultipartFile file) throws IOException { - InputStream inputStream = file.getInputStream(); - String errMsg = iSysUserService.importUsers(inputStream, userImportForm); - - if (StrUtil.isNotBlank(errMsg)) { - return Result.failed(errMsg); - } - return Result.success(); - + public Result importUsers(UserImportForm userImportForm) throws IOException { + String msg = iSysUserService.importUsers(userImportForm); + return Result.success(msg); } @ApiOperation("导出用户") @@ -174,7 +168,7 @@ public class UserController { public void exportUsers(UserPageQuery queryParams, HttpServletResponse response) throws IOException { String fileName = "用户列表.xlsx"; response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName,"UTF-8")); + response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); List exportUserList = iSysUserService.listExportUsers(queryParams); diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysUserMapper.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysUserMapper.java index b6be8f178..ebc54e333 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysUserMapper.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/mapper/SysUserMapper.java @@ -6,11 +6,10 @@ import com.youlai.admin.dto.AuthUserDTO; import com.youlai.admin.pojo.entity.SysUser; import com.youlai.admin.pojo.query.UserPageQuery; import com.youlai.admin.pojo.vo.user.UserExportVO; -import com.youlai.admin.pojo.vo.user.UserFormVO; +import com.youlai.admin.pojo.vo.user.UserDetailVO; import com.youlai.admin.pojo.vo.user.UserPageVO; import com.youlai.common.mybatis.annotation.DataPermission; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; import java.util.List; @@ -39,7 +38,7 @@ public interface SysUserMapper extends BaseMapper { * @param userId 用户ID * @return */ - UserFormVO getUserFormDetail(Long userId); + UserDetailVO getUserDetail(Long userId); /** * 根据用户名获取认证信息 diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/entity/SysUserRole.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/entity/SysUserRole.java index f6cc90eb2..fd85cface 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/entity/SysUserRole.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/entity/SysUserRole.java @@ -1,10 +1,12 @@ package com.youlai.admin.pojo.entity; +import lombok.AllArgsConstructor; import lombok.Data; import lombok.experimental.Accessors; @Data @Accessors(chain = true) +@AllArgsConstructor public class SysUserRole { private Long userId; diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserForm.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserForm.java new file mode 100644 index 000000000..c7f90125e --- /dev/null +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserForm.java @@ -0,0 +1,42 @@ +package com.youlai.admin.pojo.form; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableLogic; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 用户表单对象 + * + * @author haoxr + * @date 2022/4/12 11:04 + */ +@Data +public class UserForm { + + private Long id; + + private String username; + + private String nickname; + + private String mobile; + + private Integer gender; + + private String avatar; + + private String password; + + private String email; + + private Integer status; + + private Long deptId; + + private List roleIds; + + +} diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserImportForm.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserImportForm.java index 25d4906d6..a974541c0 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserImportForm.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/form/UserImportForm.java @@ -1,8 +1,10 @@ package com.youlai.admin.pojo.form; import com.alibaba.excel.annotation.ExcelProperty; +import lombok.AllArgsConstructor; import lombok.Data; -import org.apache.catalina.User; +import lombok.NoArgsConstructor; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -23,7 +25,10 @@ public class UserImportForm { /** * 角色ID */ - private Long roleId; + private String roleIds; + + + private MultipartFile file; /** * 导入的用户列表 @@ -31,7 +36,10 @@ public class UserImportForm { private List userList; @Data - public class UserItem { + @NoArgsConstructor + @AllArgsConstructor + public static class UserItem { + @ExcelProperty(value = "用户名") private String username; @@ -39,7 +47,7 @@ public class UserImportForm { private String nickname; @ExcelProperty(value = "性别") - private String genderLabel; + private String gender; @ExcelProperty(value = "手机号码") private String mobile; diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserFormVO.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserDetailVO.java similarity index 90% rename from youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserFormVO.java rename to youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserDetailVO.java index 0ef32a809..1118cb1b9 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserFormVO.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/pojo/vo/user/UserDetailVO.java @@ -7,14 +7,14 @@ import lombok.Data; import java.util.List; /** - * 用户表单视图对象 + * 用户详情视图对象 * * @author haoxr * @date 2022/1/14 */ -@ApiModel("用户表单视图对象") +@ApiModel("用户详情视图对象") @Data -public class UserFormVO { +public class UserDetailVO { @ApiModelProperty("用户ID") private Long id; diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/ISysUserService.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/ISysUserService.java index 9bd26ff82..cacbb1eda 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/ISysUserService.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/ISysUserService.java @@ -5,13 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.youlai.admin.dto.AuthUserDTO; import com.youlai.admin.pojo.entity.SysUser; +import com.youlai.admin.pojo.form.UserForm; import com.youlai.admin.pojo.form.UserImportForm; import com.youlai.admin.pojo.query.UserPageQuery; +import com.youlai.admin.pojo.vo.user.UserDetailVO; import com.youlai.admin.pojo.vo.user.UserExportVO; -import com.youlai.admin.pojo.vo.user.UserFormVO; import com.youlai.admin.pojo.vo.user.UserPageVO; -import java.io.InputStream; +import java.io.IOException; import java.util.List; /** @@ -32,18 +33,19 @@ public interface ISysUserService extends IService { /** * 新增用户 * - * @param user + * @param userForm 用户表单对象 * @return */ - boolean saveUser(SysUser user); + boolean saveUser(UserForm userForm); /** * 修改用户 * - * @param user + * @param userId 用户ID + * @param userForm 用户表单对象 * @return */ - boolean updateUser(SysUser user); + boolean updateUser(Long userId,UserForm userForm); /** * 根据用户名获取认证信息 @@ -59,15 +61,15 @@ public interface ISysUserService extends IService { * @param userId * @return */ - UserFormVO getUserFormDetail(Long userId); + UserDetailVO getUserDetail(Long userId); /** * 导入用户 * - * @param inputStream + * @param userImportForm * @return */ - String importUsers(InputStream inputStream, UserImportForm userImportForm); + String importUsers( UserImportForm userImportForm) throws IOException; /** * 获取导出用户列表 diff --git a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java index 09667388b..cdd7f360c 100644 --- a/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java +++ b/youlai-admin/admin-boot/src/main/java/com/youlai/admin/service/impl/SysUserServiceImpl.java @@ -1,6 +1,8 @@ package com.youlai.admin.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.convert.Convert; import cn.hutool.core.lang.Assert; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; @@ -14,26 +16,29 @@ import com.youlai.admin.common.constant.SystemConstants; import com.youlai.admin.common.enums.GenderEnum; import com.youlai.admin.component.listener.excel.UserImportListener; import com.youlai.admin.dto.AuthUserDTO; -import com.youlai.admin.pojo.entity.SysUser; import com.youlai.admin.mapper.SysUserMapper; +import com.youlai.admin.pojo.entity.SysUser; import com.youlai.admin.pojo.entity.SysUserRole; +import com.youlai.admin.pojo.form.UserForm; import com.youlai.admin.pojo.form.UserImportForm; import com.youlai.admin.pojo.query.UserPageQuery; +import com.youlai.admin.pojo.vo.user.UserDetailVO; import com.youlai.admin.pojo.vo.user.UserExportVO; -import com.youlai.admin.pojo.vo.user.UserFormVO; import com.youlai.admin.pojo.vo.user.UserPageVO; import com.youlai.admin.service.ISysUserRoleService; import com.youlai.admin.service.ISysUserService; import com.youlai.common.base.IBaseEnum; import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -67,19 +72,25 @@ public class SysUserServiceImpl extends ServiceImpl impl /** * 新增用户 * - * @param user + * @param userForm 用户表单对象 * @return */ @Override - public boolean saveUser(SysUser user) { - user.setPassword(passwordEncoder.encode(SystemConstants.DEFAULT_USER_PASSWORD)); + public boolean saveUser(UserForm userForm) { + + SysUser user = new SysUser(); + user.setPassword(passwordEncoder.encode(SystemConstants.DEFAULT_USER_PASSWORD)); // 初始化默认密码 + + BeanUtil.copyProperties(userForm, user); boolean result = this.save(user); if (result) { + Long userId = user.getId(); List roleIds = user.getRoleIds(); - if (CollectionUtil.isNotEmpty(roleIds)) { - List userRoleList = new ArrayList<>(); - roleIds.forEach(roleId -> userRoleList.add(new SysUserRole().setUserId(user.getId()).setRoleId(roleId))); - result = iSysUserRoleService.saveBatch(userRoleList); + List sysUserRoles = Optional.ofNullable(roleIds).orElse(new ArrayList<>()) + .stream().map(roleId -> new SysUserRole(userId, roleId)) + .collect(Collectors.toList()); + if (CollectionUtil.isNotEmpty(sysUserRoles)) { + iSysUserRoleService.saveBatch(sysUserRoles); } } return result; @@ -88,41 +99,46 @@ public class SysUserServiceImpl extends ServiceImpl impl /** * 更新用户 * - * @param user + * @param userId 用户ID + * @param userForm 用户表单对象 * @return */ @Override - public boolean updateUser(SysUser user) { + @Transactional + public boolean updateUser(Long userId, UserForm userForm) { + SysUser user = this.getById(userId); + Assert.isTrue(user != null, "用户不存在或已被删除"); - // 用户的旧的角色ID集合 + // 用户旧角色ID集合 List oldRoleIds = iSysUserRoleService.list(new LambdaQueryWrapper() - .eq(SysUserRole::getUserId, user.getId())).stream() + .eq(SysUserRole::getUserId, userId)) + .stream() .map(item -> item.getRoleId()) .collect(Collectors.toList()); - // 用户的新的角色ID集合 - List newRoleIds = user.getRoleIds(); + // 用户新角色ID集合 + List newRoleIds = userForm.getRoleIds(); - // 需要新增的用户角色ID集合 + // 新增的用户角色 List addRoleIds = newRoleIds.stream().filter(roleId -> !oldRoleIds.contains(roleId)).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(addRoleIds)) { - List addUserRoleList = new ArrayList<>(); - addRoleIds.forEach(roleId -> { - addUserRoleList.add(new SysUserRole().setUserId(user.getId()).setRoleId(roleId)); - }); - iSysUserRoleService.saveBatch(addUserRoleList); - } + List addUserRoles = Optional.ofNullable(addRoleIds).orElse(new ArrayList<>()) + .stream().map(roleId -> new SysUserRole(userId, roleId)) + .collect(Collectors.toList()); + iSysUserRoleService.saveBatch(addUserRoles); - // 需要删除的用户的角色ID集合 + // 删除的用户角色 List removeRoleIds = oldRoleIds.stream().filter(roleId -> !newRoleIds.contains(roleId)).collect(Collectors.toList()); if (CollectionUtil.isNotEmpty(removeRoleIds)) { - removeRoleIds.forEach(roleId -> { - iSysUserRoleService.remove(new LambdaQueryWrapper().eq(SysUserRole::getUserId, user.getId()).eq(SysUserRole::getRoleId, roleId)); - }); + iSysUserRoleService.remove(new LambdaQueryWrapper() + .eq(SysUserRole::getUserId, userId) + .in(SysUserRole::getRoleId, removeRoleIds) + ); } - // 最后更新用户 - return this.updateById(user); + BeanUtil.copyProperties(userForm, user); + + boolean updateRes = this.updateById(user); + return updateRes; } /** @@ -144,8 +160,8 @@ public class SysUserServiceImpl extends ServiceImpl impl * @return */ @Override - public UserFormVO getUserFormDetail(Long userId) { - UserFormVO userDetail = this.baseMapper.getUserFormDetail(userId); + public UserDetailVO getUserDetail(Long userId) { + UserDetailVO userDetail = this.baseMapper.getUserDetail(userId); return userDetail; } @@ -153,16 +169,16 @@ public class SysUserServiceImpl extends ServiceImpl impl /** * 导入用户 * - * @param inputStream * @param userImportForm * @return */ - @SneakyThrows @Override @Transactional - public String importUsers(InputStream inputStream, UserImportForm userImportForm) { + public String importUsers(UserImportForm userImportForm) throws IOException { + Long deptId = userImportForm.getDeptId(); - Long roleId = userImportForm.getRoleId(); + List roleIds = Arrays.stream(userImportForm.getRoleIds().split(",")).map(roleId -> Convert.toLong(roleId)).collect(Collectors.toList()); + InputStream inputStream = userImportForm.getFile().getInputStream(); ExcelReaderBuilder excelReaderBuilder = EasyExcel.read(inputStream, UserImportForm.UserItem.class, userImportListener); ExcelReaderSheetBuilder sheet = excelReaderBuilder.sheet(); @@ -211,7 +227,7 @@ public class SysUserServiceImpl extends ServiceImpl impl // 默认密码 user.setPassword(passwordEncoder.encode(SystemConstants.DEFAULT_USER_PASSWORD)); // 性别转换 - Integer gender = (Integer) IBaseEnum.getValueByLabel(userItem.getGenderLabel(), GenderEnum.class); + Integer gender = (Integer) IBaseEnum.getValueByLabel(userItem.getGender(), GenderEnum.class); user.setGender(gender); saveUserList.add(user); @@ -221,12 +237,18 @@ public class SysUserServiceImpl extends ServiceImpl impl boolean result = this.saveBatch(saveUserList); Assert.isTrue(result, "导入数据失败,原因:保存用户出错"); - List userRoleList = saveUserList.stream().map(user -> { - SysUserRole userRole = new SysUserRole(); - userRole.setUserId(user.getId()); - userRole.setRoleId(roleId); - return userRole; - }).collect(Collectors.toList()); + List userRoleList = new ArrayList<>(); + + if (CollectionUtil.isNotEmpty(roleIds)) { + + roleIds.forEach(roleId -> { + userRoleList.addAll( + saveUserList.stream() + .map(user -> new SysUserRole(user.getId(), roleId)). + collect(Collectors.toList())); + }); + } + iSysUserRoleService.saveBatch(userRoleList); } diff --git a/youlai-admin/admin-boot/src/main/resources/mapper/SysUserMapper.xml b/youlai-admin/admin-boot/src/main/resources/mapper/SysUserMapper.xml index 9d905b2d6..50a8bd305 100644 --- a/youlai-admin/admin-boot/src/main/resources/mapper/SysUserMapper.xml +++ b/youlai-admin/admin-boot/src/main/resources/mapper/SysUserMapper.xml @@ -44,7 +44,7 @@ - + @@ -63,7 +63,7 @@ - SELECT id, username, nickname, diff --git a/youlai-admin/admin-boot/src/test/java/com/youlai/admin/service/impl/SysUserServiceImplTest.java b/youlai-admin/admin-boot/src/test/java/com/youlai/admin/service/impl/SysUserServiceImplTest.java index 12274b4f2..3d1eba82a 100644 --- a/youlai-admin/admin-boot/src/test/java/com/youlai/admin/service/impl/SysUserServiceImplTest.java +++ b/youlai-admin/admin-boot/src/test/java/com/youlai/admin/service/impl/SysUserServiceImplTest.java @@ -19,11 +19,5 @@ class SysUserServiceImplTest { @Test public void saveUser() { - SysUser user=new SysUser(); - user.setUsername("root"); - user.setNickname("有来技术"); - user.setMobile("17621590365"); - user.setEmail("youlaitech@163.com"); - iSysUserService.saveUser(user); } } \ No newline at end of file