|
@@ -5,6 +5,7 @@ import cn.iselab.mooctest.rpc.user.data.AddIntegralDTO;
|
|
|
import cn.iselab.mooctest.rpc.user.data.IntegralCaughtDTO;
|
|
|
import cn.iselab.mooctest.rpc.user.data.UserIntegralDTO;
|
|
|
import cn.iselab.mooctest.user.configure.IntegralMap;
|
|
|
+import cn.iselab.mooctest.user.mapper.User2IntegralDao;
|
|
|
import cn.iselab.mooctest.user.model.Integral;
|
|
|
import cn.iselab.mooctest.user.model.User2Integral;
|
|
|
import cn.iselab.mooctest.user.model.UserIntegral;
|
|
@@ -106,6 +107,15 @@ public class IntegralLogicImpl extends BaseLogic implements IntegralLogic {
|
|
|
return integralMap.reload();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<IntegralCaughtDTO> getUserIntegralRecord(long userId, long type, String source) {
|
|
|
+ List<User2Integral> user2IntegralList = integralService.findUserIntegralCaught(userId,
|
|
|
+ type, source);
|
|
|
+ return user2IntegralList.stream()
|
|
|
+ .map(user2Integral -> integralCaughtWrapper.wrap(user2Integral))
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ }
|
|
|
+
|
|
|
public UserIntegral addIntegral(User2Integral integral){
|
|
|
UserIntegral userIntegral=integralService.findByUserId(integral.getUserId());
|
|
|
if(userIntegral!=null) {
|