package com.shanghaichengdi.ghjgitem.vo;

import com.shanghaichengdi.ghjgitem.domain.SysGroup;
import com.shanghaigeography.Util.DateUtils;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class SysGroupVo {

  private String id;

  private String name;

  private String parentId;

  private Integer available;

  private String createTime;

  private String updateTime;

  public static SysGroupVo from(SysGroup sysGroup) {
    SysGroupVo vo = new SysGroupVo();
    BeanUtils.copyProperties(sysGroup, vo);
    vo.setCreateTime(DateUtils.dateToString(sysGroup.getCreateTime(), DateUtils.DATE_FORMAT_19));
    vo.setUpdateTime(DateUtils.dateToString(sysGroup.getUpdateTime(), DateUtils.DATE_FORMAT_19));
    return vo;
  }
}
