package com.yuchen.saas.park.service.wrapper;


import com.yuchen.saas.park.api.enums.MaskEnum;
import com.yuchen.saas.park.api.entity.park.TemperaturePrevention;
import com.yuchen.saas.park.api.vo.park.prevention.TemperaturePreventionVO;
import com.yuchen.saas.park.service.util.DateTimeUtils;
import org.nest.springwrap.core.mp.support.BaseEntityWrapper;
import org.springframework.beans.BeanUtils;

/**
 * @author 颜艺波
 * @date 2022/6/16 17:52
 * @Description
 */
public class TemperaturePreventionWrapper extends BaseEntityWrapper<TemperaturePrevention, TemperaturePreventionVO> {


    @Override
    public TemperaturePreventionVO entityVO(TemperaturePrevention entity) {
        TemperaturePreventionVO temperaturePreventionVO = new TemperaturePreventionVO();
        BeanUtils.copyProperties(entity, temperaturePreventionVO);
        temperaturePreventionVO.setEnterTime(DateTimeUtils.timestampToDateTime(entity.getEnterTime()));
        temperaturePreventionVO.setWearMaskDesc(MaskEnum.getDescByCode(temperaturePreventionVO.getWearMask()));
        return temperaturePreventionVO;
    }
}
