fix🛠️: 修改get bill传输的bill type字段为int

This commit is contained in:
车厘子 2022-12-11 16:05:32 +08:00
parent 7c41b42fb1
commit 5857abbe05

View File

@ -1,9 +1,11 @@
package cn.fadinglight.routes
import cn.fadinglight.libs.Resp
import cn.fadinglight.models.Bill
import cn.fadinglight.services.BillServiceImpl
import cn.fadinglight.vo.BillVO
import cn.fadinglight.vo.bill
import cn.fadinglight.vo.vo
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.request.*
@ -20,11 +22,11 @@ fun Route.billRoute() {
val month = call.parameters["month"]
val day = call.parameters["day"]
if (month is String && day is String) {
billService.getManyBills(year, month, day)
billService.getManyBills(year, month, day).map(Bill::vo)
} else if (month is String) {
billService.getManyBills(year, month)
billService.getManyBills(year, month).map(Bill::vo)
} else {
billService.getManyBills(year)
billService.getManyBills(year).map(Bill::vo)
}
}.onSuccess {
call.respond(Resp.Ok(it).json())