package com.yunzhupaas.portal.model;

import com.yunzhupaas.base.MyBatisPrimaryBase;
import com.yunzhupaas.base.UserInfo;
import com.yunzhupaas.portal.constant.PortalConst;
import com.yunzhupaas.portal.entity.PortalEntity;
import com.yunzhupaas.util.UserProvider;
import lombok.Data;

/**
 * 类功能
 *
 * @author 云筑产品开发平台组
 * @version v3.4.8
 * @copyrignt 深圳市乐程软件有限公司
 * @date 2023-04-21
 */
@Data
public class PortalViewPrimary extends MyBatisPrimaryBase<PortalEntity> {

    private String creatorId;

    private String portalId;

    private String platForm = PortalConst.WEB;

    private String systemId;

    public PortalViewPrimary(String platForm, String portalId){
        if(platForm != null) this.platForm = platForm;
        this.portalId = portalId;
        UserInfo userInfo = UserProvider.getUser();
        this.systemId = PortalConst.WEB.equals(platForm) ? userInfo.getSystemId() : userInfo.getAppSystemId();
        this.creatorId = userInfo.getId();
    }

}

