-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
253 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/com/dl/officialsite/defi/dao/WhaleChainTokenRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.dl.officialsite.defi.dao; | ||
|
||
import com.dl.officialsite.defi.entity.WhaleChainToken; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
/** | ||
* @ClassName whaleChainTokenRepository | ||
* @Author jackchen | ||
* @Date 2024/4/15 22:52 | ||
* @Description TODO | ||
**/ | ||
public interface WhaleChainTokenRepository extends JpaRepository<WhaleChainToken, Long>, | ||
JpaSpecificationExecutor<WhaleChainToken> { | ||
|
||
List<WhaleChainToken> findByWhaleAddress(String whaleAddress); | ||
|
||
@Query(value = "select * from whale_chain_token order by id DESC limit 1", nativeQuery = true) | ||
WhaleChainToken findAgoWhaleChainToken(); | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/dl/officialsite/defi/dao/WhaleChainValueRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.dl.officialsite.defi.dao; | ||
|
||
import com.dl.officialsite.defi.entity.WhaleChainValue; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | ||
import org.springframework.data.jpa.repository.Query; | ||
|
||
/** | ||
* @ClassName WhaleChainValueRepository | ||
* @Author jackchen | ||
* @Date 2024/4/15 22:27 | ||
* @Description WhaleChainValueRepository | ||
**/ | ||
public interface WhaleChainValueRepository extends JpaRepository<WhaleChainValue, Long>, | ||
JpaSpecificationExecutor<WhaleChainValue> { | ||
|
||
@Query(value = "select * from whale_chain_value where whale_address = ?1", nativeQuery = true) | ||
List<WhaleChainValue> findByWhaleAddress(String whaleAddress); | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/com/dl/officialsite/defi/entity/WhaleChainToken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.dl.officialsite.defi.entity; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import lombok.Data; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
/** | ||
* @ClassName WhaleChainToken | ||
* @Author jackchen | ||
* @Date 2024/4/15 22:46 | ||
* @Description WhaleChainToken | ||
**/ | ||
@Data | ||
@Entity | ||
@Table(name = "whale_chain_token") | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class WhaleChainToken { | ||
|
||
@Id | ||
private Long id; | ||
|
||
private String whaleAddress; | ||
|
||
private String chainName; | ||
|
||
private String tokenAddress; | ||
|
||
private String tokenSymbol; | ||
|
||
private String amount; | ||
|
||
private String price; | ||
|
||
private Integer decimals; | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/java/com/dl/officialsite/defi/entity/WhaleChainValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.dl.officialsite.defi.entity; | ||
|
||
import javax.persistence.Entity; | ||
import javax.persistence.EntityListeners; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.GenerationType; | ||
import javax.persistence.Id; | ||
import javax.persistence.Table; | ||
import lombok.Data; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
/** | ||
* @ClassName WhaleChainValue | ||
* @Author jackchen | ||
* @Date 2024/4/15 22:16 | ||
* @Description WhaleChainValue | ||
**/ | ||
@Data | ||
@Entity | ||
@Table(name = "whale_chain_value") | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class WhaleChainValue { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.AUTO) | ||
private Long id; | ||
|
||
private String whaleAddress; | ||
|
||
private String chainId; | ||
|
||
private String chainName; | ||
|
||
private String value; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters