parent
7701d5c69d
commit
8adb116246
45 changed files with 604 additions and 98 deletions
@ -0,0 +1,70 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Getter; |
||||
import lombok.ToString; |
||||
|
||||
/** |
||||
* @Author: gongsj. |
||||
* @Description: 系统操作状态集 |
||||
* @Date:Created in 2020/09/07 11:35. |
||||
* @Modified By: |
||||
*/ |
||||
@ToString |
||||
@AllArgsConstructor |
||||
public enum CommonCode implements ResultCode { |
||||
|
||||
SUCCESS(true, 10000, "操作成功!"), |
||||
FAIL(false, 11111, "操作失败!"), |
||||
INEXISTENCE(false,10004,"抱歉,当前客户信息已不存在!"), |
||||
START_FAIL(false,10009,"启用或禁用失败,当前用户状态异常!"), |
||||
RESET_FAIL(false,10010,"重置密码失败,当前用户状态异常!"), |
||||
PERMISSION_IS_NOT(false,10011,"当前角色的权限信息不存在!"), |
||||
DISABLE_FAIL(false,10012,"禁用失败,禁用结束时间可能早于当前时间"), |
||||
UPDATE_FAIL(false,10005,"更新信息失败!"), |
||||
SAVE_FAIL(false,10006,"新增信息失败!"), |
||||
DELETE_FAIL(false,10007,"删除失败!"), |
||||
UNAUTHENTICATED(false, 10001, "此操作需要登陆系统!"), |
||||
UNAUTHORISE(false, 10002, "权限不足,无权操作!"), |
||||
INVALID_PARAM(false, 10003, "非法参数!"), |
||||
USER_IS_NOT_EXIST(false, 10004, "用户不存在或用户已禁用!"), |
||||
USER_LOGIN_NULL(false,10013,"获取当前用户登录信息失败!"), |
||||
POSITION_DEPT_NOT_NULL(false,10014,"职位名称或所属部门不能为空!"), |
||||
PASSWORD_IS_ERROR(false, 10005, "密码错误!"), |
||||
IMPORT_ERROR(false,10008,"导入数据失败!"), |
||||
SERVER_ERROR(false, 99999, "抱歉,系统繁忙,请稍后重试!"), |
||||
GET_LOGIN_USER_FAIL(false,10015,"获取当前登录用户失败,请稍后重试!"); |
||||
|
||||
/** |
||||
* 操作是否成功 |
||||
*/ |
||||
@Getter |
||||
private boolean success; |
||||
|
||||
/** |
||||
* 状态码 |
||||
*/ |
||||
@Getter |
||||
private int code; |
||||
|
||||
/** |
||||
* 提示信息 |
||||
*/ |
||||
@Getter |
||||
private String message; |
||||
|
||||
@Override |
||||
public boolean success() { |
||||
return this.success; |
||||
} |
||||
|
||||
@Override |
||||
public int code() { |
||||
return this.code; |
||||
} |
||||
|
||||
@Override |
||||
public String message() { |
||||
return this.message; |
||||
} |
||||
} |
@ -0,0 +1,75 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.ToString; |
||||
|
||||
/** |
||||
* @Author: gongsj. |
||||
* @Description: 统一返回的结果集。 |
||||
* @Date:Created in 2020/09/07 12:28. |
||||
* @Modified By: |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
@NoArgsConstructor |
||||
@AllArgsConstructor |
||||
public class ResponseResult<T> { |
||||
/** |
||||
* 操作是否成功 |
||||
*/ |
||||
private boolean success; |
||||
|
||||
/** |
||||
* 状态码 |
||||
*/ |
||||
private int code; |
||||
|
||||
/** |
||||
* 返回的数据 |
||||
*/ |
||||
private T data; |
||||
|
||||
/** |
||||
* 提示信息 |
||||
*/ |
||||
private String message; |
||||
|
||||
public ResponseResult(boolean success, int code, String message) { |
||||
this.success = success; |
||||
this.code = code; |
||||
this.message = message; |
||||
} |
||||
|
||||
public ResponseResult(ResultCode resultCode) { |
||||
this.success = resultCode.success(); |
||||
this.code = resultCode.code(); |
||||
this.message = resultCode.message(); |
||||
} |
||||
|
||||
public static ResponseResult SUCCESS() { |
||||
return new ResponseResult(CommonCode.SUCCESS); |
||||
} |
||||
|
||||
public static ResponseResult SUCCESS(Object t) { |
||||
return new ResponseResult<>(true, 10000, t, "操作成功!"); |
||||
} |
||||
|
||||
public static ResponseResult FAIL(Object t) { |
||||
return new ResponseResult<>(false, 99999, t, "操作失败,请检查客户名称是否已存在或者文件和数据格式是否正确!"); |
||||
} |
||||
|
||||
public ResponseResult SUCCESS_DATA(T t) { |
||||
return new ResponseResult<>(false, 20000, t, "操作失败!"); |
||||
} |
||||
|
||||
public static ResponseResult FAIL() { |
||||
return new ResponseResult(CommonCode.FAIL); |
||||
} |
||||
|
||||
public static ResponseResult FAIL(int code, String message) { |
||||
return new ResponseResult<>(false, code, null, message); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,37 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
/** |
||||
* @Author: gongsj. |
||||
* @Description: 系统操作状态集接口 |
||||
* @Date:Created in 2020/09/09 15:35. |
||||
* @Modified By: |
||||
* 10000-- 通用错误码 |
||||
* 22000-- 人资管理系统错误码 |
||||
* 23000-- 人资管理系统认证系统错误码 |
||||
* 24000-- 客户管理系统错误码 |
||||
* 25000-- 客户管理系统认证系统错误码 |
||||
* 26000-- 工作流程管理系统错误码 |
||||
* 27000-- 担保业务系统错误码 |
||||
*/ |
||||
public interface ResultCode { |
||||
/** |
||||
* 操作是否成功 |
||||
* |
||||
* @return true为成功,false操作失败 |
||||
*/ |
||||
boolean success(); |
||||
|
||||
/** |
||||
* 操作码 |
||||
* |
||||
* @return 操作码 |
||||
*/ |
||||
int code(); |
||||
|
||||
/** |
||||
* 提示信息 |
||||
* |
||||
* @return 提示信息 |
||||
*/ |
||||
String message(); |
||||
} |
@ -0,0 +1,65 @@ |
||||
package com.yipin.liuwanr.entity.response; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import lombok.Data; |
||||
import lombok.ToString; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* <p> |
||||
* 用户管理列表 |
||||
* </p> |
||||
* |
||||
* @author Qyq |
||||
* @since 2021-03-17 |
||||
*/ |
||||
@Data |
||||
@ToString |
||||
public class UserInfoListRes implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 用户id |
||||
*/ |
||||
@TableId(value = "userId", type = IdType.AUTO) |
||||
private Integer userId; |
||||
|
||||
/** |
||||
* 用户账号 |
||||
*/ |
||||
private String account; |
||||
|
||||
/** |
||||
* 用户姓名 |
||||
*/ |
||||
private String userName; |
||||
|
||||
/** |
||||
* 学校名称 |
||||
*/ |
||||
private String schoolName; |
||||
|
||||
/** |
||||
* 平台来源 |
||||
*/ |
||||
private String platformName; |
||||
|
||||
/** |
||||
* 手机号 |
||||
*/ |
||||
private String phone; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private String creationTime; |
||||
|
||||
/** |
||||
* 登录次数 |
||||
*/ |
||||
private Integer logInNumber; |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package com.yipin.liuwanr.entity.vo; |
||||
|
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @Author chen |
||||
* @DATE 2021/6/7 16:20 |
||||
* @Version 1.0 |
||||
*/ |
||||
@Data |
||||
public class UserInfoReq { |
||||
|
||||
private String countries; |
||||
private Integer provinceId; |
||||
private Integer cityId; |
||||
private Integer page; |
||||
private Integer size; |
||||
private Integer schoolId; |
||||
private String roleId; |
||||
private String searchContent; |
||||
private Integer month; |
||||
private String creationTime; |
||||
private String endTime; |
||||
private Integer platformId; |
||||
} |
@ -0,0 +1,111 @@ |
||||
/** |
||||
* Copyright (c) 2016-2019 人人开源 All rights reserved. |
||||
* <p> |
||||
* https://www.renren.io
|
||||
* <p> |
||||
* 版权所有,侵权必究! |
||||
*/ |
||||
|
||||
package com.yipin.liuwanr.util; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 分页工具类 |
||||
* |
||||
* @author Mark sunlightcs@gmail.com |
||||
*/ |
||||
public class PageUtils implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
/** |
||||
* 总记录数 |
||||
*/ |
||||
private int totalCount; |
||||
/** |
||||
* 每页记录数 |
||||
*/ |
||||
private int pageSize; |
||||
/** |
||||
* 总页数 |
||||
*/ |
||||
private int totalPage; |
||||
/** |
||||
* 当前页数 |
||||
*/ |
||||
private int currPage; |
||||
/** |
||||
* 列表数据 |
||||
*/ |
||||
private List<?> list; |
||||
|
||||
/** |
||||
* 分页 |
||||
* @param list 列表数据 |
||||
* @param totalCount 总记录数 |
||||
* @param pageSize 每页记录数 |
||||
* @param currPage 当前页数 |
||||
*/ |
||||
public PageUtils(List<?> list, int totalCount, int pageSize, int currPage) { |
||||
this.list = list; |
||||
this.totalCount = totalCount; |
||||
this.pageSize = pageSize; |
||||
this.currPage = currPage; |
||||
this.totalPage = (int) Math.ceil((double) totalCount / pageSize); |
||||
} |
||||
|
||||
/** |
||||
* 分页 |
||||
*/ |
||||
public PageUtils(IPage<?> page) { |
||||
this.list = page.getRecords(); |
||||
this.totalCount = (int) page.getTotal(); |
||||
this.pageSize = (int) page.getSize(); |
||||
this.currPage = (int) page.getCurrent(); |
||||
this.totalPage = (int) page.getPages(); |
||||
} |
||||
|
||||
public int getTotalCount() { |
||||
return totalCount; |
||||
} |
||||
|
||||
public void setTotalCount(int totalCount) { |
||||
this.totalCount = totalCount; |
||||
} |
||||
|
||||
public int getPageSize() { |
||||
return pageSize; |
||||
} |
||||
|
||||
public void setPageSize(int pageSize) { |
||||
this.pageSize = pageSize; |
||||
} |
||||
|
||||
public int getTotalPage() { |
||||
return totalPage; |
||||
} |
||||
|
||||
public void setTotalPage(int totalPage) { |
||||
this.totalPage = totalPage; |
||||
} |
||||
|
||||
public int getCurrPage() { |
||||
return currPage; |
||||
} |
||||
|
||||
public void setCurrPage(int currPage) { |
||||
this.currPage = currPage; |
||||
} |
||||
|
||||
public List<?> getList() { |
||||
return list; |
||||
} |
||||
|
||||
public void setList(List<?> list) { |
||||
this.list = list; |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue