From 7dfb83cff9fa1cf52ffd51b0018a1964da922da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E7=8B=BC=E8=93=9D=E5=A4=A9?= Date: Mon, 23 Sep 2024 16:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=B8=8E=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../harmony/HarmonyLifeServerApplication.java | 1 + .../harmony/config/StpInterfaceImpl.java | 5 +- .../harmony/controller/AuthController.java | 16 ++++ .../harmony/controller/UserController.java | 31 +++++++ .../harmony/domain/entity/SystemAction.java | 55 ++---------- .../domain/entity/SystemPermissionAction.java | 3 +- .../harmony/domain/entity/SystemRole.java | 41 +-------- .../harmony/domain/vo/ActionEntitySet.java | 10 +++ .../harmony/domain/vo/PermissionInfo.java | 15 ++++ .../harmony/domain/vo/RoleInfo.java | 18 ++++ .../harmony/domain/vo/UserInfoLogin.java | 4 +- .../harmony/mapper/AuthMapper.java | 21 ++++- .../harmony/mapper/UserMapper.java | 14 ++++ .../harmony/service/UserService.java | 7 ++ .../harmony/service/impl/AuthServiceImpl.java | 10 ++- .../harmony/service/impl/UserServiceImpl.java | 83 +++++++++++++++++++ .../mapper/AuthMapper.xml | 26 +++++- src/main/resources/mapper/UserMapper.xml | 6 ++ .../HarmonyLifeServerApplicationTests.java | 4 + 19 files changed, 267 insertions(+), 103 deletions(-) create mode 100644 src/main/java/com/guaiguailang/harmony/controller/UserController.java create mode 100644 src/main/java/com/guaiguailang/harmony/domain/vo/ActionEntitySet.java create mode 100644 src/main/java/com/guaiguailang/harmony/domain/vo/PermissionInfo.java create mode 100644 src/main/java/com/guaiguailang/harmony/domain/vo/RoleInfo.java create mode 100644 src/main/java/com/guaiguailang/harmony/mapper/UserMapper.java create mode 100644 src/main/java/com/guaiguailang/harmony/service/UserService.java create mode 100644 src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java rename src/main/{java/com/guaiguailang/harmony => resources}/mapper/AuthMapper.xml (52%) create mode 100644 src/main/resources/mapper/UserMapper.xml diff --git a/src/main/java/com/guaiguailang/harmony/HarmonyLifeServerApplication.java b/src/main/java/com/guaiguailang/harmony/HarmonyLifeServerApplication.java index 1647bba..bc14408 100644 --- a/src/main/java/com/guaiguailang/harmony/HarmonyLifeServerApplication.java +++ b/src/main/java/com/guaiguailang/harmony/HarmonyLifeServerApplication.java @@ -2,6 +2,7 @@ package com.guaiguailang.harmony; import com.github.yitter.contract.IdGeneratorOptions; import com.github.yitter.idgen.YitIdHelper; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ConfigurableApplicationContext; diff --git a/src/main/java/com/guaiguailang/harmony/config/StpInterfaceImpl.java b/src/main/java/com/guaiguailang/harmony/config/StpInterfaceImpl.java index 6d23673..1950eee 100644 --- a/src/main/java/com/guaiguailang/harmony/config/StpInterfaceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/config/StpInterfaceImpl.java @@ -2,6 +2,7 @@ package com.guaiguailang.harmony.config; import cn.dev33.satoken.stp.StpInterface; import com.guaiguailang.harmony.mapper.AuthMapper; +import com.guaiguailang.harmony.mapper.UserMapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -18,6 +19,8 @@ import java.util.Map; public class StpInterfaceImpl implements StpInterface { @Autowired AuthMapper authMapper; + @Autowired + UserMapper userMapper; /** * 返回一个账号所拥有的权限码集合 @@ -61,7 +64,7 @@ public class StpInterfaceImpl implements StpInterface { public List getRoleList(Object loginId, String loginType) { Long uid = (Long)loginId;//得到用戶id List list = new ArrayList(); - list.add(authMapper.getUserById(uid).getRoleId()); + list.add(userMapper.getUserById(uid).getRoleId()); log.info("用户{}角色:{}", uid.toString(), list.toString()); return list; } diff --git a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java index c055d95..a4c2ff5 100644 --- a/src/main/java/com/guaiguailang/harmony/controller/AuthController.java +++ b/src/main/java/com/guaiguailang/harmony/controller/AuthController.java @@ -1,5 +1,7 @@ package com.guaiguailang.harmony.controller; +import cn.dev33.satoken.stp.StpUtil; +import cn.dev33.satoken.util.SaResult; import com.guaiguailang.harmony.domain.dto.ParamLogin; import com.guaiguailang.harmony.domain.vo.ResponseResult; import com.guaiguailang.harmony.service.AuthService; @@ -69,6 +71,20 @@ public class AuthController { ) @PostMapping("/login") public ResponseEntity loginByAccount(@RequestBody ParamLogin loginParam) throws NoSuchAlgorithmException { + /* + 测试账号:xrilang + 测试密码:e10adc3949ba59abbe56e057f20f883e + */ return ResponseEntity.ok(authService.loginByAccount(loginParam)); } + @Operation( + summary = "用户注销 退出登录", + description = "用户退出登录", + tags = {"系统认证接口"} + ) + @PostMapping("/logout") + public ResponseEntity logout() { + StpUtil.logout(); + return ResponseEntity.ok().build(); + } } diff --git a/src/main/java/com/guaiguailang/harmony/controller/UserController.java b/src/main/java/com/guaiguailang/harmony/controller/UserController.java new file mode 100644 index 0000000..7ea1dbe --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/controller/UserController.java @@ -0,0 +1,31 @@ +package com.guaiguailang.harmony.controller; + +import com.guaiguailang.harmony.domain.dto.ParamLogin; +import com.guaiguailang.harmony.service.UserService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.security.NoSuchAlgorithmException; + +@RestController +@Tag(name="用户相关接口") +@RequestMapping("/user") +public class UserController { + @Autowired + private UserService userService; + @Operation( + summary = "用户信息", + description = "包含了用户权限的用户信息", + tags = {"用户相关接口"} + ) + @GetMapping("/info") + public ResponseEntity loginByAccount(){ + return ResponseEntity.ok(userService.getUserInfo()); + } +} diff --git a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemAction.java b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemAction.java index a73d4ec..def12cf 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemAction.java +++ b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemAction.java @@ -1,57 +1,12 @@ package com.guaiguailang.harmony.domain.entity; +import lombok.Data; +@Data public class SystemAction { - - private long id; + private Long id; private String tag; private String describe; - private long defaultCheck; - private long status; - - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - - public String getDescribe() { - return describe; - } - - public void setDescribe(String describe) { - this.describe = describe; - } - - - public long getDefaultCheck() { - return defaultCheck; - } - - public void setDefaultCheck(long defaultCheck) { - this.defaultCheck = defaultCheck; - } - - - public long getStatus() { - return status; - } - - public void setStatus(long status) { - this.status = status; - } - + private Boolean defaultCheck; + private int status; } diff --git a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemPermissionAction.java b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemPermissionAction.java index e3e9a75..f4687d8 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemPermissionAction.java +++ b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemPermissionAction.java @@ -8,5 +8,6 @@ public class SystemPermissionAction { private long id; private String actionTag; private String permissionId; - private long status; + private int status; + private Long uid; } diff --git a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java index 8ff6f37..d5bb308 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java +++ b/src/main/java/com/guaiguailang/harmony/domain/entity/SystemRole.java @@ -1,47 +1,12 @@ package com.guaiguailang.harmony.domain.entity; +import lombok.Data; +@Data public class SystemRole { - private long id; private String roleName; private String roleId; private long status; - - - public long getId() { - return id; - } - - public void setId(long id) { - this.id = id; - } - - - public String getRoleName() { - return roleName; - } - - public void setRoleName(String roleName) { - this.roleName = roleName; - } - - - public String getRoleId() { - return roleId; - } - - public void setRoleId(String roleId) { - this.roleId = roleId; - } - - - public long getStatus() { - return status; - } - - public void setStatus(long status) { - this.status = status; - } - + private String description; } diff --git a/src/main/java/com/guaiguailang/harmony/domain/vo/ActionEntitySet.java b/src/main/java/com/guaiguailang/harmony/domain/vo/ActionEntitySet.java new file mode 100644 index 0000000..61f3d97 --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/domain/vo/ActionEntitySet.java @@ -0,0 +1,10 @@ +package com.guaiguailang.harmony.domain.vo; + +import lombok.Data; + +@Data +public class ActionEntitySet { + private String action; + private String describe; + private boolean defaultCheck; +} diff --git a/src/main/java/com/guaiguailang/harmony/domain/vo/PermissionInfo.java b/src/main/java/com/guaiguailang/harmony/domain/vo/PermissionInfo.java new file mode 100644 index 0000000..910957a --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/domain/vo/PermissionInfo.java @@ -0,0 +1,15 @@ +package com.guaiguailang.harmony.domain.vo; + +import lombok.Data; + +import java.util.List; + +@Data +public class PermissionInfo { + private String roleId;//角色id 文本型 + private String permissionId;// 权限di,文本型 + private String permissionName;// 权限名称,文本型 + private List actionEntitySet; + private List actionList; + private Object dataAccess;//object类型是因为还没确定好它的内容类型 +} diff --git a/src/main/java/com/guaiguailang/harmony/domain/vo/RoleInfo.java b/src/main/java/com/guaiguailang/harmony/domain/vo/RoleInfo.java new file mode 100644 index 0000000..f7ae615 --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/domain/vo/RoleInfo.java @@ -0,0 +1,18 @@ +package com.guaiguailang.harmony.domain.vo; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +public class RoleInfo { + private String id;//roleId是文本型 + private String name;//显示的角色名称 + private String description; + private int status; + private String creatorId; + private LocalDateTime createTime; + private int deleted; + private List permissions; +} diff --git a/src/main/java/com/guaiguailang/harmony/domain/vo/UserInfoLogin.java b/src/main/java/com/guaiguailang/harmony/domain/vo/UserInfoLogin.java index e20b4cc..900da04 100644 --- a/src/main/java/com/guaiguailang/harmony/domain/vo/UserInfoLogin.java +++ b/src/main/java/com/guaiguailang/harmony/domain/vo/UserInfoLogin.java @@ -30,8 +30,8 @@ public class UserInfoLogin{ private String creator; // 角色权限 private String merchantCode;//商户编号 -// private String roleId; - private String role;//角色 如果是一个人有多个角色,此处应当是列表,但是本系统设定一人一个角色,就算多角色,登录的时候就要选择角色登录 + private String roleId; + private RoleInfo role;//角色 如果是一个人有多个角色,此处应当是列表,但是本系统设定一人一个角色,就算多角色,登录的时候就要选择角色登录 // token 相关 private String token; private LocalDateTime expireTime; diff --git a/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.java b/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.java index 6f177e2..c71b01d 100644 --- a/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.java +++ b/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.java @@ -16,14 +16,27 @@ public interface AuthMapper { // 有没有想过注解写SQL的方式好不好,对比xml写SQL的方式哪种更好? // 与其说好不好,不如说 合不合适。简单SQL写注解,方便又省事;复杂SQL写xml,高效且清晰;就这样。 - @Select("SELECT * from user_info where id=#{id} AND status=1") - UserInfo getUserById(@Param("id") Long id); + /** + * 获取用户权限列表 + * @param id 用户id + * @return List 用户权限列表 + */ List getUserPermissionList(@Param("id") Long id); List getPermissionActionList(String permissionId); List> getAllPermissionsAndActionsByUserId(Long uid); - @Select("SELECT * from user_info where username=#{username} AND status=1") - UserInfo getUserByAccount(String username); + @Select("SELECT * from system_role where role_id=#{roleId} AND status=1") + SystemRole getUserRoleById(@Param("roleId") String roleId); + /** + * 根据权限ID获取动作列表 + * @param permissionId 权限ID + * @return 动作列表 + */ + List getActionByPermissionId(@Param("permissionId") String permissionId); +// @Select("SELECT * from system_role_permission where role_id=#{roleId} AND status=1") + List getUserPermissionListByRoleId(String roleId); + + List getActionByPermissionIdAndUid(String permissionId, Long uid); } diff --git a/src/main/java/com/guaiguailang/harmony/mapper/UserMapper.java b/src/main/java/com/guaiguailang/harmony/mapper/UserMapper.java new file mode 100644 index 0000000..605730b --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/mapper/UserMapper.java @@ -0,0 +1,14 @@ +package com.guaiguailang.harmony.mapper; + +import com.guaiguailang.harmony.domain.entity.UserInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +@Mapper +public interface UserMapper { + @Select("SELECT * from user_info where id=#{id} AND status=1") + UserInfo getUserById(@Param("id") Long id); + @Select("SELECT * from user_info where username=#{username} AND status=1") + UserInfo getUserByAccount(String username); +} diff --git a/src/main/java/com/guaiguailang/harmony/service/UserService.java b/src/main/java/com/guaiguailang/harmony/service/UserService.java new file mode 100644 index 0000000..3b7a725 --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/service/UserService.java @@ -0,0 +1,7 @@ +package com.guaiguailang.harmony.service; + +import com.guaiguailang.harmony.domain.vo.ResponseResult; + +public interface UserService { + ResponseResult getUserInfo(); +} diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java index fd8e1bf..34bb5a4 100644 --- a/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java +++ b/src/main/java/com/guaiguailang/harmony/service/impl/AuthServiceImpl.java @@ -7,6 +7,7 @@ import com.guaiguailang.harmony.domain.entity.UserInfo; import com.guaiguailang.harmony.domain.vo.ResponseResult; import com.guaiguailang.harmony.domain.vo.UserInfoLogin; import com.guaiguailang.harmony.mapper.AuthMapper; +import com.guaiguailang.harmony.mapper.UserMapper; import com.guaiguailang.harmony.service.AuthService; import com.guaiguailang.harmony.utils.PasswordEncryptor; import jdk.jshell.execution.Util; @@ -23,9 +24,12 @@ import java.time.LocalDateTime; public class AuthServiceImpl implements AuthService { @Autowired private final AuthMapper authMapper; + @Autowired + private final UserMapper userMapper; - public AuthServiceImpl(AuthMapper authMapper) { + public AuthServiceImpl(AuthMapper authMapper, UserMapper userMapper) { this.authMapper = authMapper; + this.userMapper = userMapper; } @Override @@ -33,7 +37,7 @@ public class AuthServiceImpl implements AuthService { // 根据账号查询用户 - UserInfo userInfo = authMapper.getUserByAccount(loginParam.getUsername()); + UserInfo userInfo = userMapper.getUserByAccount(loginParam.getUsername()); if (userInfo == null) { return ResponseResult.error("用户不存在"); } @@ -57,7 +61,7 @@ public class AuthServiceImpl implements AuthService { BeanUtils.copyProperties(userInfo, userInfoLogin); userInfoLogin.setToken(token); userInfoLogin.setExpireTime(expireTime); - userInfoLogin.setRole(userInfo.getRoleId()); + userInfoLogin.setRoleId(userInfo.getRoleId()); return ResponseResult.success(userInfoLogin); } diff --git a/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java new file mode 100644 index 0000000..8158da5 --- /dev/null +++ b/src/main/java/com/guaiguailang/harmony/service/impl/UserServiceImpl.java @@ -0,0 +1,83 @@ +package com.guaiguailang.harmony.service.impl; + +import cn.dev33.satoken.stp.StpUtil; +import com.guaiguailang.harmony.domain.entity.SystemAction; +import com.guaiguailang.harmony.domain.entity.SystemPermission; +import com.guaiguailang.harmony.domain.entity.SystemRole; +import com.guaiguailang.harmony.domain.entity.UserInfo; +import com.guaiguailang.harmony.domain.vo.*; +import com.guaiguailang.harmony.mapper.AuthMapper; +import com.guaiguailang.harmony.mapper.UserMapper; +import com.guaiguailang.harmony.service.UserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@Service +public class UserServiceImpl implements UserService { + @Autowired + private final UserMapper userMapper; + @Autowired + private final AuthMapper authMapper; + + public UserServiceImpl(UserMapper userMapper, AuthMapper authMapper) { + this.userMapper = userMapper; + this.authMapper = authMapper; + } + // 如果存在大量的引用,有些可以使用字段注入的方式,以便构造函数过于臃肿 + + @Override + public ResponseResult getUserInfo() { + log.info("查询用户{}的用户信息", StpUtil.getLoginId()); // object类型 输出值1 + UserInfo userInfo = userMapper.getUserById(Long.parseLong((String) StpUtil.getLoginId()));// 报错 class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap') + // 用户基本信息准备 + UserInfoLogin userInfoLogin = new UserInfoLogin(); + BeanUtils.copyProperties(userInfo, userInfoLogin); + // 用户角色准备 + userInfoLogin.setRoleId(userInfo.getRoleId()); + SystemRole systemRole = authMapper.getUserRoleById(userInfo.getRoleId()); + RoleInfo roleInfo = new RoleInfo(); +// BeanUtils.copyProperties(systemRole, roleInfo); + roleInfo.setId(systemRole.getRoleId()); + roleInfo.setName(systemRole.getRoleName()); + roleInfo.setDescription(systemRole.getDescription()); + //权限准备 + Long uid = userInfo.getId(); +// log.info("开始为用户{}准备权限。",uid); +// List permissionInfoList = authMapper.getUserPermissionList(uid); + List permissionInfoList = authMapper.getUserPermissionListByRoleId(userInfo.getRoleId()); +// log.info("权限列表({}):{}",permissionInfoList.size(),permissionInfoList.toString()); + List permissionInfos = new ArrayList<>(); + int i = 0; + for (SystemPermission permission : permissionInfoList) { + log.info("得到的权限:{}", permission.toString()); + PermissionInfo permissionInfo = new PermissionInfo(); + permissionInfo.setRoleId(systemRole.getRoleId()); + permissionInfo.setPermissionId(permission.getPermissionId()); + permissionInfo.setPermissionName(permission.getPermissionName()); + // 开始获取action + List systemActionList = authMapper.getActionByPermissionIdAndUid(permission.getPermissionId(),userInfoLogin.getId()); + List actionEntitySets = new ArrayList<>(); + for (SystemAction systemAction : systemActionList) { + ActionEntitySet actionEntitySet = new ActionEntitySet(); + actionEntitySet.setAction(systemAction.getTag()); + actionEntitySet.setDescribe(systemAction.getDescribe()); + actionEntitySet.setDefaultCheck(systemAction.getDefaultCheck()); + actionEntitySets.add(actionEntitySet); + } + permissionInfo.setActionEntitySet(actionEntitySets); + // 更改计数值 + i++; + permissionInfos.add(permissionInfo); + } + roleInfo.setPermissions(permissionInfos); + userInfoLogin.setRole(roleInfo); + log.info(userInfoLogin.toString()); + return ResponseResult.success(userInfoLogin); + } +} diff --git a/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.xml b/src/main/resources/mapper/AuthMapper.xml similarity index 52% rename from src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.xml rename to src/main/resources/mapper/AuthMapper.xml index 7b7c2ea..b94fb39 100644 --- a/src/main/java/com/guaiguailang/harmony/mapper/AuthMapper.xml +++ b/src/main/resources/mapper/AuthMapper.xml @@ -5,7 +5,7 @@ - SELECT * FROM system_role_permission srp INNER JOIN system_permission sp ON srp.permission_id = sp.id @@ -15,7 +15,7 @@ - SELECT sa.* FROM system_permission_action spa LEFT JOIN system_action sa ON spa.action_tag = sa.tag @@ -23,13 +23,31 @@ - SELECT sp.permission_id, sa.tag FROM user_info ui JOIN system_role_permission srp ON ui.role_id = srp.role_id JOIN system_permission sp ON srp.permission_id = sp.permission_id JOIN system_permission_action spa ON sp.permission_id = spa.permission_id JOIN system_action sa ON spa.action_tag = sa.tag - WHERE ui.id = #{userId} AND ui.deleted = 0 AND srp.status = 1 AND spa.status = 1 AND sa.status = 1 + WHERE ui.id = #{userId} AND ui.deleted = 0 AND srp.status = 1 AND spa.status = 1 AND sa.status = 1 AND spa.uid=#{userId} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml new file mode 100644 index 0000000..f4dfc39 --- /dev/null +++ b/src/main/resources/mapper/UserMapper.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java b/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java index ed29736..ff5694f 100644 --- a/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java +++ b/src/test/java/com/guaiguailang/harmony/HarmonyLifeServerApplicationTests.java @@ -12,4 +12,8 @@ class HarmonyLifeServerApplicationTests { void contextLoads() { } + public void add(int a){ + System.out.println(a); + } + }