bug修复
This commit is contained in:
parent
62f52e0709
commit
f7040e0111
@ -18,6 +18,4 @@ public interface ActivityRepository extends JpaRepository<Activity, Integer> {
|
||||
|
||||
Optional<Activity> findByCreator(String creatorName);
|
||||
|
||||
List<Activity> findByUserAndType(User user, String type);
|
||||
|
||||
}
|
@ -35,7 +35,15 @@ public class ActivityService implements IActivityService {
|
||||
|
||||
@Override
|
||||
public List<Activity> findActivityByType(User user, String type) {
|
||||
return activityRepository.findByUserAndType(user, type);
|
||||
|
||||
List<Activity> activities = this.findAll(user);
|
||||
List<Activity> actsByType = new ArrayList<>();
|
||||
for (Activity activity : activities) {
|
||||
if (activity.getType().equals(type)) {
|
||||
actsByType.add(activity);
|
||||
}
|
||||
}
|
||||
return actsByType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user