Skip to content

Commit

Permalink
chore: 优化用户管理相关代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 30, 2024
1 parent 872bc1c commit 9ecdeb5
Show file tree
Hide file tree
Showing 23 changed files with 202 additions and 199 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.apache.ibatis.annotations.Select;
import top.continew.admin.common.config.mybatis.DataPermissionMapper;
import top.continew.admin.system.model.entity.UserDO;
import top.continew.admin.system.model.resp.UserDetailResp;
import top.continew.admin.system.model.resp.user.UserDetailResp;
import top.continew.starter.extension.datapermission.annotation.DataPermission;
import top.continew.starter.security.crypto.annotation.FieldEncrypt;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import cn.hutool.core.lang.RegexPool;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import cn.hutool.core.lang.RegexPool;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import cn.hutool.core.lang.RegexPool;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import cn.hutool.core.lang.RegexPool;
import io.swagger.v3.oas.annotations.media.Schema;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.req;
package top.continew.admin.system.model.req.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.user;

import cn.crane4j.annotation.Assemble;
import cn.crane4j.annotation.AssembleMethod;
Expand All @@ -30,6 +30,7 @@
import top.continew.admin.common.context.UserContextHolder;
import top.continew.admin.common.enums.DisEnableStatusEnum;
import top.continew.admin.common.enums.GenderEnum;
import top.continew.admin.system.model.resp.DeptResp;
import top.continew.admin.system.service.DeptService;
import top.continew.starter.extension.crud.model.resp.BaseDetailResp;
import top.continew.starter.file.excel.converter.ExcelBaseEnumConverter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,35 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;

/**
* 用户导入结果
* 用户导入解析结果
*
* @author kils
* @since 2024-06-18 14:37
* @since 2024/6/18 14:37
*/
@Data
@Schema(description = "用户导入结果")
@AllArgsConstructor
@NoArgsConstructor
public class UserImportParseResp {
@Schema(description = "用户导入解析结果")
public class UserImportParseResp implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

/**
* 导入会话KEY
* 导入会话 Key
*/
@Schema(description = "导入会话KEY", example = "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed")
@Schema(description = "导入会话Key", example = "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed")
private String importKey;

/**
Expand All @@ -54,9 +58,9 @@ public class UserImportParseResp {
private Integer validRows;

/**
* 用户重复行数
* 重复行数
*/
@Schema(description = "用户重复行数", example = "100")
@Schema(description = "重复行数", example = "100")
private Integer duplicateUserRows;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.user;

import cn.crane4j.annotation.Assemble;
import cn.crane4j.core.executor.handler.ManyToManyAssembleOperationHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.system.model.resp;
package top.continew.admin.system.model.resp.user;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import org.springframework.web.multipart.MultipartFile;
import top.continew.admin.system.model.entity.UserDO;
import top.continew.admin.system.model.query.UserQuery;
import top.continew.admin.system.model.req.*;
import top.continew.admin.system.model.resp.UserDetailResp;
import top.continew.admin.system.model.resp.UserImportParseResp;
import top.continew.admin.system.model.resp.UserImportResp;
import top.continew.admin.system.model.resp.UserResp;
import top.continew.admin.system.model.req.user.*;
import top.continew.admin.system.model.resp.user.UserDetailResp;
import top.continew.admin.system.model.resp.user.UserImportParseResp;
import top.continew.admin.system.model.resp.user.UserImportResp;
import top.continew.admin.system.model.resp.user.UserResp;
import top.continew.starter.data.mp.service.IService;
import top.continew.starter.extension.crud.service.BaseService;

Expand All @@ -47,6 +47,30 @@ public interface UserService extends BaseService<UserResp, UserDetailResp, UserQ
*/
Long add(UserDO user);

/**
* 下载导入模板
*
* @param response 响应对象
* @throws IOException /
*/
void downloadImportTemplate(HttpServletResponse response) throws IOException;

/**
* 解析导入数据
*
* @param file 导入文件
* @return 解析结果
*/
UserImportParseResp parseImport(MultipartFile file);

/**
* 导入数据
*
* @param req 导入信息
* @return 导入结果
*/
UserImportResp importUser(UserImportReq req);

/**
* 重置密码
*
Expand Down Expand Up @@ -139,28 +163,4 @@ public interface UserService extends BaseService<UserResp, UserDetailResp, UserQ
* @return 用户数量
*/
Long countByDeptIds(List<Long> deptIds);

/**
* 下载用户导入模板
*
* @param response 响应对象
* @throws IOException /
*/
void downloadImportUserTemplate(HttpServletResponse response) throws IOException;

/**
* 导入用户
*
* @param req 导入信息
* @return 导入结果
*/
UserImportResp importUser(UserImportReq req);

/**
* 解析用户导入数据
*
* @param file 导入用户文件
* @return 解析结果
*/
UserImportParseResp parseImportUser(MultipartFile file);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import top.continew.admin.system.model.query.UserQuery;
import top.continew.admin.system.model.req.DeptReq;
import top.continew.admin.system.model.resp.DeptResp;
import top.continew.admin.system.model.resp.UserResp;
import top.continew.admin.system.model.resp.user.UserResp;
import top.continew.admin.system.service.DeptService;
import top.continew.admin.system.service.RoleDeptService;
import top.continew.admin.system.service.UserService;
Expand Down
Loading

0 comments on commit 9ecdeb5

Please sign in to comment.