diff --git a/src/main/java/com/rymcu/forest/web/api/bank/BankAccountController.java b/src/main/java/com/rymcu/forest/web/api/bank/BankAccountController.java index ab81e25..fd399ab 100644 --- a/src/main/java/com/rymcu/forest/web/api/bank/BankAccountController.java +++ b/src/main/java/com/rymcu/forest/web/api/bank/BankAccountController.java @@ -6,10 +6,13 @@ import com.rymcu.forest.core.result.GlobalResult; import com.rymcu.forest.core.result.GlobalResultGenerator; import com.rymcu.forest.dto.BankAccountDTO; import com.rymcu.forest.dto.BankAccountSearchDTO; +import com.rymcu.forest.dto.TransactionRecordDTO; import com.rymcu.forest.service.BankAccountService; +import com.rymcu.forest.util.Utils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -45,4 +48,19 @@ public class BankAccountController { return GlobalResultGenerator.genSuccessResult(bankAccount); } + @GetMapping("/transaction-records") + public GlobalResult transactionRecords(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "20") Integer rows, HttpServletRequest request) { + String bankAccount = request.getParameter("bankAccount"); + String startDate = request.getParameter("startDate"); + String endDate = request.getParameter("endDate"); + PageHelper.startPage(page, rows); + List list = bankAccountService.findUserTransactionRecords(bankAccount, startDate, endDate); + PageInfo pageInfo = new PageInfo(list); + Map map = new HashMap(2); + map.put("records", pageInfo.getList()); + Map pagination = Utils.getPagination(pageInfo); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } + }