Prechádzať zdrojové kódy

Merge branch 'dev_v4.1.0' of http://git.qmth.com.cn/examcloud-backend/examcloud-core-examwork into dev_v4.1.0

qinchao 4 rokov pred
rodič
commit
154ee4e7f3

+ 2 - 3
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/NoticeServiceImpl.java

@@ -6,7 +6,7 @@ import cn.com.qmth.examcloud.api.commons.exchange.PageInfo;
 import cn.com.qmth.examcloud.api.commons.security.bean.UserType;
 import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
 import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.commons.util.DBUtil;
+import cn.com.qmth.examcloud.commons.util.SqlUtil;
 import cn.com.qmth.examcloud.core.basic.api.UserCloudService;
 import cn.com.qmth.examcloud.core.basic.api.request.GetAllUsersByRoleReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetAllUsersByRoleResp;
@@ -129,7 +129,7 @@ public class NoticeServiceImpl implements NoticeService {
             predicates.add(cb.equal(root.get("rootOrgId"), rootOrgId));
             if (!StringUtils.isNullOrEmpty(infoQuery.getTitle())) {
                 predicates.add(cb.like(root.get("title"),
-                        DBUtil.toSqlSearchPattern(infoQuery.getTitle())));
+                        SqlUtil.toSqlSearchPattern(infoQuery.getTitle())));
             }
             if (null != infoQuery.getPublishStatus()) {
                 predicates.add(cb.equal(root.get("noticeStatus"), infoQuery.getPublishStatus()));
@@ -316,7 +316,6 @@ public class NoticeServiceImpl implements NoticeService {
     /**
      * 更新发布进度
      *
-     * @param publishSchedule
      * @param maxUserId
      */
     @Transactional

+ 5 - 6
examcloud-core-examwork-starter/src/main/java/cn/com/qmth/examcloud/core/examwork/starter/config/ExamCloudResourceManager.java

@@ -3,8 +3,6 @@ package cn.com.qmth.examcloud.core.examwork.starter.config;
 import cn.com.qmth.examcloud.api.commons.enums.DataRuleType;
 import cn.com.qmth.examcloud.api.commons.security.bean.*;
 import cn.com.qmth.examcloud.api.commons.security.enums.RoleMeta;
-import cn.com.qmth.examcloud.commons.util.PathUtil;
-import cn.com.qmth.examcloud.commons.util.PropertiesUtil;
 import cn.com.qmth.examcloud.commons.util.RegExpUtil;
 import cn.com.qmth.examcloud.core.basic.api.UserDataRuleCloudService;
 import cn.com.qmth.examcloud.core.basic.api.request.QueryUserDataRuleReq;
@@ -13,6 +11,7 @@ import cn.com.qmth.examcloud.support.cache.CacheHelper;
 import cn.com.qmth.examcloud.support.cache.bean.AppCacheBean;
 import cn.com.qmth.examcloud.web.redis.RedisClient;
 import cn.com.qmth.examcloud.web.security.ResourceManager;
+import cn.com.qmth.examcloud.web.security.SecurityProperty;
 import cn.com.qmth.examcloud.web.support.ApiInfo;
 import com.google.common.collect.Sets;
 import org.apache.commons.collections4.CollectionUtils;
@@ -40,7 +39,7 @@ public class ExamCloudResourceManager implements ResourceManager {
     UserDataRuleCloudService userDataRuleCloudService;
 
     static {
-        PropertiesUtil.loadFromPath(PathUtil.getResoucePath("security.properties"));
+        SecurityProperty.loadProperties("security.properties");
     }
 
     @Override
@@ -83,7 +82,7 @@ public class ExamCloudResourceManager implements ResourceManager {
         // 学生鉴权
         if (user.getUserType().equals(UserType.STUDENT)) {
             String key = "[s]" + mapping;
-            return PropertiesUtil.getBoolean(key, false);
+            return SecurityProperty.getBooleanProperty(key, false);
         }
 
         List<Role> roleList = user.getRoleList();
@@ -99,8 +98,8 @@ public class ExamCloudResourceManager implements ResourceManager {
         }
 
         // 权限组集合
-        String privilegeGroups = PropertiesUtil.getString(mapping);
-        if (StringUtils.isBlank(privilegeGroups)) {
+        String privilegeGroups = SecurityProperty.getProperty(mapping);
+        if (StringUtils.isEmpty(privilegeGroups)) {
             return true;
         }
 

+ 1 - 1
examcloud-core-examwork-starter/src/main/resources/application.properties

@@ -1,7 +1,7 @@
 spring.profiles.active=dev
 
 examcloud.startup.startupCode=8001
-examcloud.startup.configCenterHost=localhost
+examcloud.startup.configCenterHost=192.168.10.39
 examcloud.startup.configCenterPort=9999
 examcloud.startup.appCode=E
 

+ 1 - 1
examcloud-core-examwork-starter/src/main/resources/log4j2.xml

@@ -3,7 +3,7 @@
 
     <Properties>
         <Property name="LOG_LEVEL" value="${sys:log.commonLevel}"/>
-        <Property name="LOG_DIR" value="./logs/examcloud-core-examwork"/>
+        <Property name="LOG_DIR" value="../logs/examcloud-core-examwork"/>
         <Property name="LOG_PATTERN">
             %d{yyyy-MM-dd HH:mm:ss.SSS} | %clr{%level} | %X{TRACE_ID} %X{CALLER} | %clr{%c{1.1}:%L}{cyan} | %m%n
         </Property>