mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复旧版本时,直链多次创建后,根据条件查询时数据不唯一的 BUG
This commit is contained in:
@@ -23,7 +23,7 @@ public interface ShortLinkConfigRepository extends JpaRepository<ShortLinkConfig
|
||||
* @param key
|
||||
* 短链 Key
|
||||
*/
|
||||
ShortLinkConfig findByKey(String key);
|
||||
ShortLinkConfig findFirstByKey(String key);
|
||||
|
||||
@Query(nativeQuery = true,
|
||||
value = " select * from SHORT_LINK where " +
|
||||
@@ -57,7 +57,7 @@ public interface ShortLinkConfigRepository extends JpaRepository<ShortLinkConfig
|
||||
* @param url
|
||||
* 短链 URL
|
||||
*/
|
||||
ShortLinkConfig findByUrl(String url);
|
||||
ShortLinkConfig findFirstByUrl(String url);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ShortLinkConfigService {
|
||||
private ShortLinkConfigRepository shortLinkConfigRepository;
|
||||
|
||||
public ShortLinkConfig findByKey(String key) {
|
||||
return shortLinkConfigRepository.findByKey(key);
|
||||
return shortLinkConfigRepository.findFirstByKey(key);
|
||||
}
|
||||
|
||||
public ShortLinkConfig findById(Integer id) {
|
||||
@@ -34,7 +34,7 @@ public class ShortLinkConfigService {
|
||||
}
|
||||
|
||||
public ShortLinkConfig findByUrl(String url) {
|
||||
return shortLinkConfigRepository.findByUrl(url);
|
||||
return shortLinkConfigRepository.findFirstByUrl(url);
|
||||
}
|
||||
|
||||
public void save(ShortLinkConfig shortLinkConfig) {
|
||||
|
||||
Reference in New Issue
Block a user