package com.yc.crm.mail.entity; import com.yc.utils.SessionKey; import lombok.Data; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; /** * @BelongsProject: eCoWorksV3 * @BelongsPackage: com.yc.crm.mail.entity * @author: xinyb * @CreateTime: 2024-09-12 10:13 * @Description: */ @Data public class FoundationEntity { private Integer dbId; private String userCode; private String userName; private String companyId; private String companyName; public FoundationEntity(HttpServletRequest request) throws Exception { HttpSession session = request.getSession(); // DataSourceEntity dataSource= MultiDataSource.getDataSourceMap(request); this.dbId = Integer.parseInt((String) session.getAttribute(SessionKey.DATA_BASE_ID)); this.userCode = (String) session.getAttribute(SessionKey.USERCODE); this.userName = (String) session.getAttribute(SessionKey.USERNAME); this.companyId = (String) session.getAttribute(SessionKey.COMPANY_ID); this.companyName = (String) session.getAttribute(SessionKey.COMPANY_NAME); } public FoundationEntity(){ } }