Jelajahi Sumber

Merge branch 'Release' into 'DEV'

Release



See merge request !441

梅杰 7 tahun lalu
induk
melakukan
772286465a

+ 1 - 1
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/Application.java

@@ -110,7 +110,7 @@ public class Application {
 
         // To disabled web environment, change `true` to `false`
         application.setWebEnvironment(true);
-        application.addListeners(new ApplicationStartup());
+        //application.addListeners(new ApplicationStartup());
         application.run(args);
     }
 

+ 3 - 3
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/configure/ClientFeatureConfiguration.java

@@ -11,7 +11,7 @@ import org.springframework.stereotype.Component;
 @Component
 @ConfigurationProperties(prefix="featureSwitch.client")
 public class ClientFeatureConfiguration {
-    private String sms;
-    private String email;
-    private String oss;
+    private boolean sms;
+    private boolean email;
+    private boolean oss;
 }

+ 1 - 6
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/service/impl/GroupServiceImpl.java

@@ -120,12 +120,7 @@ public class GroupServiceImpl implements GroupService {
     @Override
     public List<User> getUserByGroupId(long groupId) {
         List<User> users = groupDao.getUserByGroupId(groupId);
-        List<User> re = new ArrayList<User>();
-        for (User user : users) {
-            user.setPassword("");
-            re.add(user);
-        }
-        return re;
+        return users;
     }
 
     @Override

+ 6 - 3
mooctest-site-server/src/main/java/cn/iselab/mooctest/site/web/logic/impl/GroupLogicImpl.java

@@ -178,7 +178,9 @@ public class GroupLogicImpl extends BaseLogic implements GroupLogic {
         List<UserVO> userVOs=new ArrayList<UserVO>();
         List<User> users=groupService.getUserByGroupId(groupId);
         users.stream().forEach(user -> {
-            userVOs.add(Converter.convert(UserVO.class,user));
+            UserVO uv = Converter.convert(UserVO.class,user);
+            uv.setPassword("");
+            userVOs.add(uv);
         });
         return userVOs;
     }
@@ -241,6 +243,7 @@ public class GroupLogicImpl extends BaseLogic implements GroupLogic {
         else{
             Group g=Converter.convert(Group.class,groupVO);
             g.setManagerId(-1L);
+            g.setIsActive(true);
             Group group = groupService.save(g);
             groupPermissionService.createGroup(user.getId(),group.getId());
             return Converter.convert(GroupVO.class,group);
@@ -256,7 +259,7 @@ public class GroupLogicImpl extends BaseLogic implements GroupLogic {
         }
         long managerId = group.getOwnerId();
         if(!groupService.checkManagerGroupSize(managerId)) {
-            throw new HttpBadRequestException("Over max group size");
+            throw new HttpBadRequestException("老师份额已使用完");
         }
         if ( groupVO.getCaptcha()!=null && ( groupVO.getCaptcha().equals("summer") || CaptchaUtils.verifyPictureCaptcha(request, groupVO.getCaptcha()))) {
             String managerName = groupVO.getManagerName();
@@ -322,7 +325,7 @@ public class GroupLogicImpl extends BaseLogic implements GroupLogic {
             throw new HttpBadRequestException("班级已关闭");
         }
         if(!groupService.checkManagerGroupSize(group.getOwnerId())) {
-            throw new HttpBadRequestException("Over max group size");
+            throw new HttpBadRequestException("老师份额已使用完");
         }
         User user=userService.findByUsername(userName);
         if(user==null){