riku
2020-06-02 9a5f9bfc4f4b153dd0175c63f563d8047e1e2515
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.flightfeather.uav.lightshare.service.impl
 
import com.flightfeather.uav.lightshare.bean.VehicleInfoVo
import com.flightfeather.uav.lightshare.service.VehicleService
import com.flightfeather.uav.repository.VehicleRepository
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
 
/**
 * @author riku
 * Date: 2019/10/25
 */
@Service
class VehicleServiceImpl(val vehicleRepository: VehicleRepository) : VehicleService {
    override fun getVehicleInfo(pageNum: Int?, pageSize: Int?): List<VehicleInfoVo> {
        val dbResult = vehicleRepository.getVehicleInfo(pageNum, pageSize)
 
        val resultList = mutableListOf<VehicleInfoVo>()
 
        dbResult.forEach {
            val vo = VehicleInfoVo()
            BeanUtils.copyProperties(it, vo)
            resultList.add(vo)
        }
 
        return resultList
    }
}