-
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.
Merge pull request #227 from Dapp-Learning-DAO/dev
release v1.0.9
- Loading branch information
Showing
35 changed files
with
772 additions
and
96 deletions.
There are no files selected for viewing
57 changes: 0 additions & 57 deletions
57
src/main/java/com/dl/officialsite/aave/controller/DeFiController.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/main/java/com/dl/officialsite/admin/HookController.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,34 @@ | ||
package com.dl.officialsite.admin; | ||
|
||
import com.dl.officialsite.common.base.BaseResponse; | ||
import com.dl.officialsite.defi.service.AaveTokenAPYService; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @ClassName TiggerController | ||
* @Author jackchen | ||
* @Date 2024/4/5 19:04 | ||
* @Description HookController | ||
**/ | ||
@RestController | ||
@RequestMapping("/hook") | ||
@Slf4j | ||
@ConditionalOnProperty(name = "hook.open", havingValue = "true", matchIfMissing = false) | ||
public class HookController { | ||
|
||
private final AaveTokenAPYService aaveService; | ||
|
||
public HookController(AaveTokenAPYService aaveService) { | ||
this.aaveService = aaveService; | ||
} | ||
|
||
@GetMapping("/token/apy") | ||
public BaseResponse HookTokenApy() { | ||
aaveService.updateTokenAPYInfo(); | ||
return BaseResponse.success(); | ||
} | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
.../dl/officialsite/aave/DeFiTokenYield.java → .../dl/officialsite/defi/DeFiTokenYield.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.dl.officialsite.aave; | ||
package com.dl.officialsite.defi; | ||
|
||
import lombok.Data; | ||
|
||
|
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
2 changes: 1 addition & 1 deletion
2
...om/dl/officialsite/aave/TokenAPYInfo.java → ...om/dl/officialsite/defi/TokenAPYInfo.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
2 changes: 1 addition & 1 deletion
2
...cialsite/aave/TokenAPYInfoRepository.java → ...cialsite/defi/TokenAPYInfoRepository.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
2 changes: 1 addition & 1 deletion
2
...a/com/dl/officialsite/aave/TokenInfo.java → ...a/com/dl/officialsite/defi/TokenInfo.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.dl.officialsite.aave; | ||
package com.dl.officialsite.defi; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
|
2 changes: 1 addition & 1 deletion
2
...m/dl/officialsite/aave/TokenInfoList.java → ...m/dl/officialsite/defi/TokenInfoList.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.dl.officialsite.aave; | ||
package com.dl.officialsite.defi; | ||
|
||
import lombok.Data; | ||
|
||
|
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
106 changes: 106 additions & 0 deletions
106
src/main/java/com/dl/officialsite/defi/controller/DeFiController.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,106 @@ | ||
package com.dl.officialsite.defi.controller; | ||
|
||
import com.dl.officialsite.common.base.BaseResponse; | ||
import com.dl.officialsite.config.ChainInfo; | ||
import com.dl.officialsite.defi.entity.WhaleTxRow; | ||
import com.dl.officialsite.defi.service.AaveTokenAPYService; | ||
import com.dl.officialsite.defi.service.WhaleService; | ||
import com.dl.officialsite.defi.vo.HealthInfoVo; | ||
import com.dl.officialsite.defi.vo.params.QueryWhaleParams; | ||
import com.dl.officialsite.member.MemberService; | ||
import com.dl.officialsite.team.TeamService; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageRequest; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @ClassName DeFiController | ||
* @Author jackchen | ||
* @Date 2024/3/6 19:45 | ||
* @Description defi | ||
**/ | ||
@RestController | ||
@RequestMapping("/defi") | ||
@Slf4j | ||
public class DeFiController { | ||
|
||
private final AaveTokenAPYService aaveService; | ||
|
||
private final WhaleService whaleService; | ||
|
||
private final MemberService memberService; | ||
|
||
private final TeamService teamService; | ||
|
||
public DeFiController(AaveTokenAPYService aaveService, WhaleService whaleService, | ||
MemberService memberService, TeamService teamService) { | ||
this.aaveService = aaveService; | ||
this.whaleService = whaleService; | ||
this.memberService = memberService; | ||
this.teamService = teamService; | ||
} | ||
|
||
|
||
/** | ||
* get all chainName | ||
*/ | ||
@GetMapping("/chainList") | ||
public BaseResponse chainList() { | ||
return BaseResponse.successWithData(aaveService.queryChainList()); | ||
} | ||
|
||
/** | ||
* get all token apy | ||
*/ | ||
@GetMapping("/tokenApy") | ||
public BaseResponse tokenApy() { | ||
return BaseResponse.successWithData(aaveService.queryTokenApy()); | ||
} | ||
|
||
/** | ||
* get healthInfo by wallet address | ||
*/ | ||
@PostMapping("/healthInfo") | ||
public BaseResponse detail(@RequestParam String address, @RequestBody ChainInfo chainInfo) { | ||
HealthInfoVo healthInfo = aaveService.getHealthInfo(chainInfo, address); | ||
return BaseResponse.successWithData(healthInfo); | ||
} | ||
|
||
@GetMapping("/init") | ||
public BaseResponse init(@RequestParam String address) { | ||
teamService.checkMemberIsSuperAdmin(address); | ||
whaleService.init(); | ||
return BaseResponse.success(); | ||
} | ||
|
||
@GetMapping("/Listener") | ||
public BaseResponse Listener() { | ||
whaleService.aaveListener(); | ||
return BaseResponse.success(); | ||
} | ||
|
||
@PostMapping("/query/whale") | ||
public BaseResponse queryWhale( | ||
@RequestParam(defaultValue = "1") Integer pageNumber, | ||
@RequestParam(defaultValue = "10") Integer pageSize, | ||
@RequestBody QueryWhaleParams query) { | ||
Pageable pageable = null; | ||
if (query.getOrder() == 1) { | ||
pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime")); | ||
} else { | ||
pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.ASC, "createTime")); | ||
} | ||
Page<WhaleTxRow> whaleDataVos = whaleService.queryWhale(pageable, query); | ||
return BaseResponse.successWithData(whaleDataVos); | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.