package com.ecep.contract.vm;

import com.ecep.contract.vo.ProjectVo;
import com.ecep.contract.vo.ProjectFileVo;

import javafx.beans.property.SimpleObjectProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class ProjectFileViewModel extends IdentityViewModel<ProjectFileVo> implements ProjectBasedViewModel {
    /**
     * 关联的项目
     */
    private SimpleObjectProperty<Integer> project = new SimpleObjectProperty<>();

    public static ProjectFileViewModel from(ProjectFileVo file) {
        ProjectFileViewModel viewModel = new ProjectFileViewModel();
        viewModel.update(file);
        return viewModel;
    }
}
