UserService.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. /*
  2. * Copyright 2019-2020 Zheng Jie
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package me.zhengjie.modules.system.service;
  17. import me.zhengjie.modules.system.domain.User;
  18. import me.zhengjie.modules.system.service.dto.UserDto;
  19. import me.zhengjie.modules.system.service.dto.UserQueryCriteria;
  20. import org.springframework.data.domain.Pageable;
  21. import org.springframework.web.multipart.MultipartFile;
  22. import javax.servlet.http.HttpServletResponse;
  23. import java.io.IOException;
  24. import java.util.List;
  25. import java.util.Map;
  26. import java.util.Set;
  27. /**
  28. * @author Zheng Jie
  29. * @date 2018-11-23
  30. */
  31. public interface UserService {
  32. /**
  33. * 根据ID查询
  34. * @param id ID
  35. * @return /
  36. */
  37. UserDto findById(String id);
  38. /**
  39. * 根据账号查询
  40. * @param username 账号
  41. * @return /
  42. */
  43. UserDto findByUsername(String username);
  44. /**
  45. * 新增用户
  46. * @param resources /
  47. */
  48. void create(User resources);
  49. /**
  50. * 编辑用户
  51. * @param resources /
  52. */
  53. void update(User resources) throws Exception;
  54. /**
  55. * 新增用户
  56. * @param resources /
  57. */
  58. void createSync(User resources);
  59. /**
  60. * 编辑用户
  61. * @param resources /
  62. */
  63. void updateSync(User resources) throws Exception;
  64. /**
  65. * 删除用户
  66. * @param ids /
  67. */
  68. void delete(Set<String> ids);
  69. /**
  70. * 根据用户名查询
  71. * @param userName /
  72. * @return /
  73. */
  74. UserDto findByName(String userName);
  75. /**
  76. * 修改密码
  77. * @param username 用户名
  78. * @param encryptPassword 密码
  79. */
  80. void updatePass(String username, String encryptPassword, String ossPassword);
  81. /**
  82. * 修改密码
  83. * @param userId 用户名
  84. * @param encryptPassword 密码
  85. */
  86. void updatePassById(String userId, String encryptPassword);
  87. /**
  88. * 修改头像
  89. * @param file 文件
  90. * @return /
  91. */
  92. Map<String, String> updateAvatar(MultipartFile file);
  93. /**
  94. * 修改邮箱
  95. * @param username 用户名
  96. * @param email 邮箱
  97. */
  98. void updateEmail(String username, String email);
  99. /**
  100. * 查询全部
  101. * @param criteria 条件
  102. * @param pageable 分页参数
  103. * @return /
  104. */
  105. Object queryAll(UserQueryCriteria criteria, Pageable pageable);
  106. /**
  107. * 查询全部不分页
  108. * @param criteria 条件
  109. * @return /
  110. */
  111. List<UserDto> queryAll(UserQueryCriteria criteria);
  112. /**
  113. * 导出数据
  114. * @param queryAll 待导出的数据
  115. * @param response /
  116. * @throws IOException /
  117. */
  118. void download(List<UserDto> queryAll, HttpServletResponse response) throws IOException;
  119. /**
  120. * 用户自助修改资料
  121. * @param resources /
  122. */
  123. void updateCenter(User resources);
  124. List<User> findByDmUserId(String dmUserId,String userId);
  125. /**
  126. * 解绑用户
  127. * @param ids
  128. */
  129. void unBindDmUser(Set<String> ids) throws Exception;
  130. /**
  131. * 根据账号查询密码
  132. * @param username
  133. */
  134. String findPassWord(String username);
  135. }