licailing 3 anni fa
parent
commit
ee3f582d68

+ 1 - 1
src/main/java/com/izouma/nineth/service/UserService.java

@@ -1212,7 +1212,7 @@ public class UserService {
             cacheService.clearUserMy(user.getId());
             cacheService.clearUser(user.getId());
         }
-        UserProperty userProperty = userPropertyRepo.findById(invitor).orElse(new UserProperty(invitor, point));
+        UserProperty userProperty = userPropertyRepo.findById(invitor).orElse(new UserProperty(invitor, 0));
         if (userProperty.getMaxCount() < 10 && userProperty.getMaxCount() != point) {
             userProperty.setMaxCount(point);
             userPropertyRepo.save(userProperty);

+ 6 - 0
src/test/java/com/izouma/nineth/service/UserServiceTest.java

@@ -210,4 +210,10 @@ public class UserServiceTest extends ApplicationTests {
     public void checkauth() throws AlipayApiException {
         userService.checkFaceAuth("7160e6a875cb67648bc7a3cce6e5397e");
     }
+
+    @Test
+    public void testSavePoint() {
+        User user = userRepo.findById(7961793L).orElse(null);
+        userService.savePoint(user);
+    }
 }