+ many
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package space.luminic.finance.api
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.PathVariable
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RequestParam
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
import space.luminic.finance.dtos.DashboardDataDTO
|
||||
import space.luminic.finance.mappers.DashboardDataMapper.toDto
|
||||
import space.luminic.finance.models.DashboardData
|
||||
import space.luminic.finance.services.DashboardService
|
||||
import java.time.LocalDate
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/spaces/{spaceId}/dashboard")
|
||||
@SecurityScheme(
|
||||
name = "bearerAuth",
|
||||
type = SecuritySchemeType.HTTP,
|
||||
bearerFormat = "JWT",
|
||||
scheme = "bearer"
|
||||
)
|
||||
class DashboardController(private val dashboardService: DashboardService) {
|
||||
@GetMapping
|
||||
fun getDashboardData(
|
||||
@PathVariable spaceId: Int,
|
||||
@RequestParam startDate: LocalDate,
|
||||
@RequestParam endDate: LocalDate
|
||||
): DashboardDataDTO {
|
||||
return dashboardService.getDashboardData(spaceId, startDate, endDate).toDto()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class TransactionController (
|
||||
|
||||
@PostMapping("/_search")
|
||||
fun getTransactions(@PathVariable spaceId: Int, @RequestBody filter: TransactionService.TransactionsFilter) : List<TransactionDTO>{
|
||||
return transactionService.getTransactions(spaceId, filter,"date", "DESC").map { it.toDto() }
|
||||
return transactionService.getTransactions(spaceId, filter).map { it.toDto() }
|
||||
}
|
||||
|
||||
@GetMapping("/{transactionId}")
|
||||
|
||||
Reference in New Issue
Block a user