1 回答
TA贡献1836条经验 获得超3个赞
解决方案1
@Autowired
SolrSubscriptionsRepository solrSubscriptionsRepository;
@GetMapping("/subscriptions/{subscriptionId}")
public Subscriptions getSubscriptions(@PathVariable Long subscriptionId) {
solrSubscriptionsRepository.findSubscriptions(subscriptionId);
return solrSubscriptionsRepository.findById(subscriptionId);
}
解决方案2:
@Autowired
SolrSubscriptionsRepository solrSubscriptionsRepository;
@GetMapping("/subscriptions/{subscriptionId}")
public Subscriptions getSubscriptions(@PathVariable Long subscriptionId) {
solrSubscriptionsRepository.findSubscriptions(subscriptionId);
return solrSubscriptionsRepository.findBySubscriptionId(subscriptionId);
}
public interface SolrSubscriptionsRepository extends SolrCrudRepository{
Subscriptions findBySubscriptionId(Long subscriptionId);
}
添加回答
举报