WANG 6 éve
szülő
commit
f539369b2d

+ 0 - 136
src/main/java/cn/com/qmth/examcloud/web/helpers/page/PageInfo.java

@@ -1,136 +0,0 @@
-package cn.com.qmth.examcloud.web.helpers.page;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.springframework.data.domain.Page;
-
-/**
- * 分页
- *
- * @author WANGWEI
- * @date 2018年6月25日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- * @param <T>
- */
-public class PageInfo<T> implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * 当前页码
-	 */
-	private long index = 1;
-
-	/**
-	 * 每页的数量
-	 */
-	private long limit = 10;
-
-	/**
-	 * 当前页的数量
-	 */
-	private long size;
-
-	/**
-	 * 总记录数
-	 */
-	private long total;
-
-	/**
-	 * 总页数
-	 */
-	private long pages;
-
-	/**
-	 * 结果集
-	 */
-	private List<T> list;
-
-	/**
-	 * 构造函数
-	 *
-	 */
-	public PageInfo() {
-
-	}
-
-	/**
-	 * 构造函数
-	 *
-	 * @param page
-	 */
-	public PageInfo(Page<T> page) {
-		this.total = page.getTotalElements();
-		this.pages = page.getTotalPages();
-		this.index = page.getNumber();
-		this.size = page.getNumberOfElements();
-		this.limit = page.getSize();
-
-		this.list = page.getContent();
-	}
-
-	/**
-	 * 构造函数
-	 *
-	 * @param page
-	 * @param list
-	 */
-	public PageInfo(Page<?> page, List<T> list) {
-		this.total = page.getTotalElements();
-		this.pages = page.getTotalPages();
-		this.index = page.getNumber();
-		this.size = page.getNumberOfElements();
-		this.limit = page.getSize();
-
-		this.list = list;
-	}
-
-	public long getIndex() {
-		return index;
-	}
-
-	public void setIndex(long index) {
-		this.index = index;
-	}
-
-	public long getLimit() {
-		return limit;
-	}
-
-	public void setLimit(long limit) {
-		this.limit = limit;
-	}
-
-	public long getSize() {
-		return size;
-	}
-
-	public void setSize(long size) {
-		this.size = size;
-	}
-
-	public long getTotal() {
-		return total;
-	}
-
-	public void setTotal(long total) {
-		this.total = total;
-	}
-
-	public long getPages() {
-		return pages;
-	}
-
-	public void setPages(long pages) {
-		this.pages = pages;
-	}
-
-	public List<T> getList() {
-		return list;
-	}
-
-	public void setList(List<T> list) {
-		this.list = list;
-	}
-
-}

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/web/interceptor/SeqlockInterceptor.java

@@ -8,11 +8,11 @@ import org.springframework.web.method.HandlerMethod;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
+import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.util.ThreadLocalUtil;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
-import cn.com.qmth.examcloud.web.security.bean.User;
 import cn.com.qmth.examcloud.web.support.ServletUtil;
 import cn.com.qmth.examcloud.web.support.StatusResponse;
 

+ 1 - 1
src/main/java/cn/com/qmth/examcloud/web/security/RequestPermissionInterceptor.java

@@ -20,6 +20,7 @@ import com.google.common.collect.Sets;
 
 import cn.com.qmth.examcloud.api.commons.CloudService;
 import cn.com.qmth.examcloud.api.commons.EnterpriseService;
+import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.util.JsonUtil;
@@ -27,7 +28,6 @@ import cn.com.qmth.examcloud.commons.util.PathUtil;
 import cn.com.qmth.examcloud.commons.util.RegExpUtil;
 import cn.com.qmth.examcloud.web.RedisKeys;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
-import cn.com.qmth.examcloud.web.security.bean.User;
 import cn.com.qmth.examcloud.web.support.ServletUtil;
 import cn.com.qmth.examcloud.web.support.StatusResponse;
 

+ 0 - 64
src/main/java/cn/com/qmth/examcloud/web/security/bean/Role.java

@@ -1,64 +0,0 @@
-package cn.com.qmth.examcloud.web.security.bean;
-
-/**
- * 角色
- *
- * @author WANGWEI
- * @date 2018年5月23日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class Role {
-
-	private Long roleId;
-
-	private String roleCode;
-
-	private String roleName;
-
-	/**
-	 * 构造函数
-	 *
-	 */
-	public Role() {
-		super();
-	}
-
-	/**
-	 * 构造函数
-	 *
-	 * @param roleId
-	 * @param roleCode
-	 * @param roleName
-	 */
-	public Role(Long roleId, String roleCode, String roleName) {
-		super();
-		this.roleId = roleId;
-		this.roleCode = roleCode;
-		this.roleName = roleName;
-	}
-
-	public Long getRoleId() {
-		return roleId;
-	}
-
-	public void setRoleId(Long roleId) {
-		this.roleId = roleId;
-	}
-
-	public String getRoleCode() {
-		return roleCode;
-	}
-
-	public void setRoleCode(String roleCode) {
-		this.roleCode = roleCode;
-	}
-
-	public String getRoleName() {
-		return roleName;
-	}
-
-	public void setRoleName(String roleName) {
-		this.roleName = roleName;
-	}
-
-}

+ 0 - 149
src/main/java/cn/com/qmth/examcloud/web/security/bean/User.java

@@ -1,149 +0,0 @@
-package cn.com.qmth.examcloud.web.security.bean;
-
-import java.util.Date;
-import java.util.List;
-
-import cn.com.qmth.examcloud.api.commons.exchange.JsonSerializable;
-
-/**
- * 用户
- *
- * @author WANGWEI
- * @date 2018年5月22日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public class User implements JsonSerializable {
-
-	private static final long serialVersionUID = 8766713125414955078L;
-
-	/**
-	 * 全局唯一用户标识符
-	 */
-	private String key;
-
-	/**
-	 * 用户类型
-	 */
-	private UserType userType;
-
-	/**
-	 * 用户ID(包含普通用户ID,学生用户ID)
-	 */
-	private Long userId;
-
-	/**
-	 * 显示名
-	 */
-	private String displayName;
-
-	/**
-	 * 顶级机构ID
-	 */
-	private Long rootOrgId;
-
-	/**
-	 * 顶级机构名称
-	 */
-	private String rootOrgName;
-
-	/**
-	 * 鉴权token创建时间
-	 */
-	private Date tokenCreationTime;
-
-	/**
-	 * 角色集合
-	 */
-	private List<Role> roleList;
-
-	/**
-	 * 客户端IP
-	 */
-	private String clientIp;
-
-	/**
-	 * 鉴权token
-	 */
-	private String token;
-
-	public String getKey() {
-		return key;
-	}
-
-	public void setKey(String key) {
-		this.key = key;
-	}
-
-	public UserType getUserType() {
-		return userType;
-	}
-
-	public void setUserType(UserType userType) {
-		this.userType = userType;
-	}
-
-	public Long getUserId() {
-		return userId;
-	}
-
-	public void setUserId(Long userId) {
-		this.userId = userId;
-	}
-
-	public String getDisplayName() {
-		return displayName;
-	}
-
-	public void setDisplayName(String displayName) {
-		this.displayName = displayName;
-	}
-
-	public Long getRootOrgId() {
-		return rootOrgId;
-	}
-
-	public void setRootOrgId(Long rootOrgId) {
-		this.rootOrgId = rootOrgId;
-	}
-
-	public String getRootOrgName() {
-		return rootOrgName;
-	}
-
-	public void setRootOrgName(String rootOrgName) {
-		this.rootOrgName = rootOrgName;
-	}
-
-	public Date getTokenCreationTime() {
-		return tokenCreationTime;
-	}
-
-	public void setTokenCreationTime(Date tokenCreationTime) {
-		this.tokenCreationTime = tokenCreationTime;
-	}
-
-	public List<Role> getRoleList() {
-		return roleList;
-	}
-
-	public void setRoleList(List<Role> roleList) {
-		this.roleList = roleList;
-	}
-
-	public String getClientIp() {
-		return clientIp;
-	}
-
-	public void setClientIp(String clientIp) {
-		this.clientIp = clientIp;
-	}
-
-	public String getToken() {
-		return token;
-	}
-
-	public void setToken(String token) {
-		this.token = token;
-	}
-
-}

+ 0 - 59
src/main/java/cn/com/qmth/examcloud/web/security/bean/UserType.java

@@ -1,59 +0,0 @@
-package cn.com.qmth.examcloud.web.security.bean;
-
-/**
- * 用户类型
- *
- * @author WANGWEI
- * @date 2018年5月25日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public enum UserType {
-
-	/**
-	 * 学生
-	 */
-	STUDENT("S", "学生"),
-
-	/**
-	 * 常规用户
-	 */
-	COMMON("C", "常规用户");
-
-	// ===========================================================================
-
-	/**
-	 * 码
-	 */
-	private String code;
-
-	/**
-	 * 描述
-	 */
-	private String desc;
-
-	/**
-	 * 构造函数
-	 *
-	 * @param code
-	 * @param desc
-	 */
-	private UserType(String code, String desc) {
-		this.code = code;
-		this.desc = desc;
-	}
-
-	/**
-	 * @return the code
-	 */
-	public String getCode() {
-		return code;
-	}
-
-	/**
-	 * @return the desc
-	 */
-	public String getDesc() {
-		return desc;
-	}
-
-}

+ 0 - 49
src/main/java/cn/com/qmth/examcloud/web/security/enums/RoleMeta.java

@@ -1,49 +0,0 @@
-package cn.com.qmth.examcloud.web.security.enums;
-
-/**
- * Created by songyue on 17/2/24.
- */
-public enum RoleMeta {
-
-	SUPER_ADMIN("超级管理员"),
-
-	ORG_ADMIN("机构管理员"),
-
-	LC_USER("学习中心用户"),
-
-	MARKING_ADMIN("阅卷管理员"),
-
-	MARKER("评卷员"),
-
-	QUESTION_ADMIN("题库管理员"),
-
-	OE_ADMIN("网考管理员"),
-
-	PRINT_SUPPLIER("印刷供应商"),
-
-	PRINT_SCHOOL_LEADER("印刷学校管理员"),
-
-	PRINT_SUPER_LEADER("印刷总负责人"),
-
-	PRINT_PROJECT_LEADER("项目经理"),
-
-	PRINT_LOCALE_LEADER("印刷现场负责人"),
-
-	PRINT_SALE_LEADER("销售负责人"),
-
-	PRINT_FINANCE_LEADER("财务负责人");
-
-	/**
-	 * 角色名
-	 */
-	private String name;
-
-	RoleMeta(String name) {
-		this.name = name;
-	}
-
-	public String getName() {
-		return name;
-	}
-
-}

+ 3 - 3
src/main/java/cn/com/qmth/examcloud/web/support/ControllerSupport.java

@@ -22,14 +22,14 @@ import org.springframework.web.context.request.ServletRequestAttributes;
 
 import com.google.common.collect.Lists;
 
+import cn.com.qmth.examcloud.api.commons.security.bean.Role;
+import cn.com.qmth.examcloud.api.commons.security.bean.User;
+import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
 import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
 import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
 import cn.com.qmth.examcloud.commons.util.ObjectUtil;
-import cn.com.qmth.examcloud.web.security.bean.Role;
-import cn.com.qmth.examcloud.web.security.bean.User;
-import cn.com.qmth.examcloud.web.security.enums.RoleMeta;
 
 /**
  * contorller 基类