123333
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.test.business;
|
||||
|
||||
import com.ruoyi.cai.domain.UserCount;
|
||||
import com.ruoyi.cai.service.UserCountService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@SpringBootTest
|
||||
@Slf4j
|
||||
public class UserTest {
|
||||
|
||||
@Autowired
|
||||
private UserCountService userCountService;
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
List<UserCount> list = userCountService.list();
|
||||
for (UserCount userCount : list) {
|
||||
userCountService.reset(userCount.getUserId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class UserCountServiceImpl extends ServiceImpl<UserCountMapper, UserCount
|
||||
@Override
|
||||
public void visitor(Long fromUserId, Long toUserId) {
|
||||
baseMapper.visitorIncs(fromUserId,1,0);
|
||||
baseMapper.visitorIncs(toUserId,0,-1);
|
||||
baseMapper.visitorIncs(toUserId,0,1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user