package cn.stylefeng.team.portal.modular.management.factory;

import cn.stylefeng.team.portal.modular.management.entity.PortalDesignManager;
import cn.stylefeng.team.portal.modular.management.pojo.request.ManagerUpdateRequest;

import java.util.ArrayList;
import java.util.List;

public class ManagerFactory {

    public static List<PortalDesignManager> createManagerList(ManagerUpdateRequest managerUpdateRequest) {
        List<PortalDesignManager> result = new ArrayList<>();
        for (Long managerUserId : managerUpdateRequest.getManagerUserIdList()) {
            PortalDesignManager portalDesignManager = new PortalDesignManager();
            portalDesignManager.setDesignId(managerUpdateRequest.getDesignId());
            portalDesignManager.setManagerUserId(managerUserId);
            portalDesignManager.setAuthTypeList(managerUpdateRequest.getAuthTypeList());
            result.add(portalDesignManager);
        }
        return result;
    }

}
