use of com.tony.billing.response.budget.BudgetListResponse in project BillingDubbo by TonyJiangWJ.
the class BudgetController method listBudget.
@RequestMapping("/budget/list")
public BudgetListResponse listBudget(@ModelAttribute("request") @Validated BudgetListRequest request) {
BudgetListResponse response = new BudgetListResponse();
try {
Budget query = new Budget();
query.setBelongMonth(request.getMonth());
query.setBelongYear(request.getYear());
query.setUserId(request.getUserId());
List<BudgetDTO> budgets = budgetService.queryBudgetsByCondition(query);
if (CollectionUtils.isNotEmpty(budgets)) {
response.setBudgetList(budgets);
ResponseUtil.success(response);
} else {
ResponseUtil.dataNotExisting(response);
}
} catch (Exception e) {
logger.error("/budget/list error", e);
ResponseUtil.sysError(response);
}
return response;
}
Aggregations