bug修复

This commit is contained in:
chuyan 2020-04-06 15:53:53 +08:00 committed by yourtree
parent 62f52e0709
commit f7040e0111
2 changed files with 9 additions and 3 deletions

View File

@ -18,6 +18,4 @@ public interface ActivityRepository extends JpaRepository<Activity, Integer> {
Optional<Activity> findByCreator(String creatorName);
List<Activity> findByUserAndType(User user, String type);
}

View File

@ -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