diff --git a/neutrino-proxy-admin/src/store/modules/user.js b/neutrino-proxy-admin/src/store/modules/user.js index 7a6f7511..cfe31f03 100644 --- a/neutrino-proxy-admin/src/store/modules/user.js +++ b/neutrino-proxy-admin/src/store/modules/user.js @@ -9,6 +9,7 @@ const user = { code: '', token: getToken(), name: '', + loginName: '', avatar: '', introduction: '', roles: [], @@ -36,6 +37,9 @@ const user = { SET_NAME: (state, name) => { state.name = name }, + SET_LOGIN_NAME: (state, loginName) => { + state.loginName = loginName + }, SET_AVATAR: (state, avatar) => { state.avatar = avatar }, @@ -68,6 +72,7 @@ const user = { } commit('SET_ROLES', [response.data.data.loginName]) commit('SET_NAME', response.data.data.name) + commit('SET_LOGIN_NAME', response.data.data.loginName) resolve(response) }).catch(error => { reject(error) @@ -119,8 +124,10 @@ const user = { setToken(role) getUserInfo(role).then(response => { const data = response.data + console.log('111222', data) commit('SET_ROLES', data.roles) commit('SET_NAME', data.name) + commit('SET_LOGIN_NAME', data.loginName) commit('SET_AVATAR', data.avatar) commit('SET_INTRODUCTION', data.introduction) resolve() diff --git a/neutrino-proxy-admin/src/views/layout/components/Navbar.vue b/neutrino-proxy-admin/src/views/layout/components/Navbar.vue index ad96453c..fc00f488 100644 --- a/neutrino-proxy-admin/src/views/layout/components/Navbar.vue +++ b/neutrino-proxy-admin/src/views/layout/components/Navbar.vue @@ -7,19 +7,19 @@
- - - + + + - + - - - + + +
- + {{loginName}}|{{name}}
@@ -28,7 +28,7 @@ {{$t('navbar.dashboard')}} - + {{$t('navbar.github')}} @@ -64,7 +64,8 @@ export default { ...mapGetters([ 'sidebar', 'name', - 'avatar' + 'avatar', + 'loginName' ]) }, methods: { diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/UserController.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/UserController.java index 557a4abf..0a8eb65f 100644 --- a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/UserController.java +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/UserController.java @@ -27,14 +27,8 @@ import fun.asgc.neutrino.core.db.page.Page; import fun.asgc.neutrino.core.db.page.PageQuery; import fun.asgc.neutrino.core.web.annotation.*; import fun.asgc.neutrino.proxy.server.base.rest.annotation.OnlyAdmin; -import fun.asgc.neutrino.proxy.server.controller.req.PortPoolUpdateEnableStatusReq; -import fun.asgc.neutrino.proxy.server.controller.req.UserInfoReq; -import fun.asgc.neutrino.proxy.server.controller.req.UserListReq; -import fun.asgc.neutrino.proxy.server.controller.req.UserUpdateEnableStatusReq; -import fun.asgc.neutrino.proxy.server.controller.res.PortPoolUpdateEnableStatusRes; -import fun.asgc.neutrino.proxy.server.controller.res.UserInfoRes; -import fun.asgc.neutrino.proxy.server.controller.res.UserListRes; -import fun.asgc.neutrino.proxy.server.controller.res.UserUpdateEnableStatusRes; +import fun.asgc.neutrino.proxy.server.controller.req.*; +import fun.asgc.neutrino.proxy.server.controller.res.*; import fun.asgc.neutrino.proxy.server.service.UserService; import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil; @@ -66,8 +60,8 @@ public class UserController { } @GetMapping("info") - public UserInfoRes info() { - return userService.info(); + public UserInfoRes info(UserInfoReq req) { + return userService.info(req); } @OnlyAdmin @@ -79,4 +73,43 @@ public class UserController { return userService.updateEnableStatus(req); } + + @OnlyAdmin + @PostMapping("create") + public UserCreateRes create(@RequestBody UserCreateReq req) { + ParamCheckUtil.checkNotNull(req, "req"); + ParamCheckUtil.checkNotEmpty(req.getName(), "name"); + ParamCheckUtil.checkNotEmpty(req.getLoginName(), "loginName"); + + return userService.create(req); + } + + @OnlyAdmin + @PostMapping("update") + public UserUpdateRes update(@RequestBody UserUpdateReq req) { + ParamCheckUtil.checkNotNull(req, "req"); + ParamCheckUtil.checkNotNull(req.getId(), "id"); + ParamCheckUtil.checkNotEmpty(req.getName(), "name"); + ParamCheckUtil.checkNotEmpty(req.getLoginName(), "loginName"); + + return userService.update(req); + } + + @OnlyAdmin + @PostMapping("update/password") + public UserUpdatePasswordRes updatePassword(@RequestBody UserUpdatePasswordReq req) { + ParamCheckUtil.checkNotNull(req, "req"); + ParamCheckUtil.checkNotNull(req.getId(), "id"); + ParamCheckUtil.checkNotEmpty(req.getLoginPassword(), "loginPassword"); + + return userService.updatePassword(req); + } + + @OnlyAdmin + @PostMapping("delete") + public void delete(@RequestParam("id") Integer id) { + ParamCheckUtil.checkNotNull(id, "id"); + + userService.delete(id); + } } diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserCreateReq.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserCreateReq.java new file mode 100644 index 00000000..d980b3cf --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserCreateReq.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.req; + +import lombok.Data; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +@Data +public class UserCreateReq { + private String name; + private String loginName; +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserInfoReq.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserInfoReq.java index a5390a17..9fca17a0 100644 --- a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserInfoReq.java +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserInfoReq.java @@ -21,10 +21,14 @@ */ package fun.asgc.neutrino.proxy.server.controller.req; +import lombok.Data; + /** * 用户信息请求 - * @author: wen.y + * @author: aoshiguchen * @date: 2022/8/27 */ +@Data public class UserInfoReq { + private Integer id; } diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdatePasswordReq.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdatePasswordReq.java new file mode 100644 index 00000000..f4312382 --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdatePasswordReq.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.req; + +import lombok.Data; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +@Data +public class UserUpdatePasswordReq { + private Integer id; + private String loginPassword; +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdateReq.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdateReq.java new file mode 100644 index 00000000..9f5e820f --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/req/UserUpdateReq.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.req; + +import lombok.Data; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +@Data +public class UserUpdateReq { + private Integer id; + private String name; + private String loginName; +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserCreateRes.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserCreateRes.java new file mode 100644 index 00000000..aab42b49 --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserCreateRes.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.res; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +public class UserCreateRes { + +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdatePasswordRes.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdatePasswordRes.java new file mode 100644 index 00000000..90c3345b --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdatePasswordRes.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.res; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +public class UserUpdatePasswordRes { +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdateRes.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdateRes.java new file mode 100644 index 00000000..f34e911c --- /dev/null +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/controller/res/UserUpdateRes.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2022 aoshiguchen + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +package fun.asgc.neutrino.proxy.server.controller.res; + +/** + * + * @author: aoshiguchen + * @date: 2022/8/28 + */ +public class UserUpdateRes { + +} diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/dal/UserMapper.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/dal/UserMapper.java index 8d1ee328..2bd9162f 100644 --- a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/dal/UserMapper.java +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/dal/UserMapper.java @@ -23,13 +23,12 @@ package fun.asgc.neutrino.proxy.server.dal; import fun.asgc.neutrino.core.annotation.Component; import fun.asgc.neutrino.core.annotation.Param; -import fun.asgc.neutrino.core.db.annotation.ResultType; -import fun.asgc.neutrino.core.db.annotation.Select; -import fun.asgc.neutrino.core.db.annotation.Update; +import fun.asgc.neutrino.core.db.annotation.*; import fun.asgc.neutrino.core.db.mapper.SqlMapper; import fun.asgc.neutrino.core.db.page.Page; import fun.asgc.neutrino.proxy.server.controller.req.UserListReq; import fun.asgc.neutrino.proxy.server.controller.res.UserListRes; +import fun.asgc.neutrino.proxy.server.dal.entity.PortPoolDO; import fun.asgc.neutrino.proxy.server.dal.entity.UserDO; import java.util.List; @@ -73,4 +72,16 @@ public interface UserMapper extends SqlMapper { @Update("update `user` set enable = :enable where id = :id") void updateEnableStatus(@Param("id") Integer id, @Param("enable") Integer enable); + + @Delete("delete from `user` where id = ?") + void delete(Integer id); + + @Update("update `user` set name = :name,login_name = :loginName where id = :id") + void update(UserDO userDO); + + @Update("update `user` set login_password = :loginPassword where id = :id") + void updateLoginPassword(@Param("id") Integer id, @Param("loginPassword") String loginPassword); + + @Insert("insert into user(`name`,`login_name`,`login_password`,`enable`,`create_time`,`update_time`) values(:name,:loginName,:loginPassword,:enable,:createTime,:updateTime)") + void add(UserDO user); } diff --git a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/service/UserService.java b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/service/UserService.java index c30d2015..b5051d1c 100644 --- a/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/service/UserService.java +++ b/neutrino-proxy-server/src/main/java/fun/asgc/neutrino/proxy/server/service/UserService.java @@ -25,17 +25,12 @@ import fun.asgc.neutrino.core.annotation.Autowired; import fun.asgc.neutrino.core.annotation.Component; import fun.asgc.neutrino.core.db.page.Page; import fun.asgc.neutrino.core.db.page.PageQuery; -import fun.asgc.neutrino.core.util.CollectionUtil; import fun.asgc.neutrino.core.util.DateUtil; -import fun.asgc.neutrino.core.web.annotation.GetMapping; -import fun.asgc.neutrino.core.web.annotation.RequestBody; import fun.asgc.neutrino.proxy.server.base.rest.constant.EnableStatusEnum; import fun.asgc.neutrino.proxy.server.base.rest.constant.ExceptionConstant; import fun.asgc.neutrino.proxy.server.base.rest.ServiceException; import fun.asgc.neutrino.proxy.server.base.rest.SystemContextHolder; -import fun.asgc.neutrino.proxy.server.controller.req.LoginReq; -import fun.asgc.neutrino.proxy.server.controller.req.UserListReq; -import fun.asgc.neutrino.proxy.server.controller.req.UserUpdateEnableStatusReq; +import fun.asgc.neutrino.proxy.server.controller.req.*; import fun.asgc.neutrino.proxy.server.controller.res.*; import fun.asgc.neutrino.proxy.server.dal.UserLoginRecordMapper; import fun.asgc.neutrino.proxy.server.dal.UserMapper; @@ -44,7 +39,6 @@ import fun.asgc.neutrino.proxy.server.dal.entity.UserDO; import fun.asgc.neutrino.proxy.server.dal.entity.UserLoginRecordDO; import fun.asgc.neutrino.proxy.server.dal.entity.UserTokenDO; import fun.asgc.neutrino.proxy.server.util.Md5Util; -import fun.asgc.neutrino.proxy.server.util.ParamCheckUtil; import java.util.Calendar; import java.util.Date; @@ -58,6 +52,7 @@ import java.util.UUID; */ @Component public class UserService { + private static final String DEFAULT_PASSWORD = "123456"; @Autowired private UserMapper userMapper; @Autowired @@ -141,8 +136,12 @@ public class UserService { return list; } - public UserInfoRes info() { - UserDO userDO = userMapper.findById(SystemContextHolder.getUser().getId()); + public UserInfoRes info(UserInfoReq req) { + Integer userId = req.getId(); + if (null == userId) { + userId = SystemContextHolder.getUser().getId(); + } + UserDO userDO = userMapper.findById(userId); if (null == userDO) { return null; } @@ -159,4 +158,40 @@ public class UserService { return new UserUpdateEnableStatusRes(); } + + public UserCreateRes create(UserCreateReq req) { + + + Date now = new Date(); + UserDO userDO = new UserDO(); + userDO.setName(req.getName()); + userDO.setLoginName(req.getLoginName()); + userDO.setLoginPassword(Md5Util.encode(DEFAULT_PASSWORD)); + userDO.setEnable(EnableStatusEnum.ENABLE.getStatus()); + userDO.setCreateTime(now); + userDO.setUpdateTime(now); + userMapper.add(userDO); + + return new UserCreateRes(); + } + + public UserUpdateRes update(UserUpdateReq req) { + UserDO userDO = new UserDO(); + userDO.setId(req.getId()); + userDO.setName(req.getName()); + userDO.setLoginName(req.getLoginName()); + userDO.setUpdateTime(new Date()); + userMapper.update(userDO); + return new UserUpdateRes(); + } + + public UserUpdatePasswordRes updatePassword(UserUpdatePasswordReq req) { + String loginPassword = Md5Util.encode(req.getLoginPassword()); + userMapper.updateLoginPassword(req.getId(), loginPassword); + return new UserUpdatePasswordRes(); + } + + public void delete(Integer id) { + userMapper.delete(id); + } }