package com.zhgd.xmgl.call; import cn.hutool.core.util.StrUtil; import com.zhgd.xmgl.modules.project.entity.ProjectEnterprise; import com.zhgd.xmgl.modules.worker.entity.DepartmentInfo; import com.zhgd.xmgl.modules.worker.entity.EnterpriseInfo; import com.zhgd.xmgl.modules.worker.entity.TeamInfo; import com.zhgd.xmgl.modules.worker.entity.WorkerInfo; import com.zhgd.xmgl.util.ThirdPartRequestUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component @Slf4j public class JiLianDaCall { @Value("${jld_push_url:}") String jldPushUrl; @Autowired ThirdPartRequestUtil thirdPartRequestUtil; private boolean ifSend() { return StrUtil.isNotBlank(jldPushUrl); } /** * 保存企业 * * @param enterpriseInfo */ public void saveEnterpriseInfo(EnterpriseInfo enterpriseInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/saveEnterpriseInfo", enterpriseInfo); } /** * 删除企业 * * @param projectEnterprise */ public void removeEnterpriseInfo(ProjectEnterprise projectEnterprise) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/removeEnterpriseInfo", projectEnterprise); } public void saveTeamInfo(TeamInfo teamInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/saveTeamInfo", teamInfo); } public void removeTeamInfo(TeamInfo teamInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/removeTeamInfo", teamInfo); } public void saveWorkerInfo(WorkerInfo workerInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/saveWorkerInfo", workerInfo); } public void removeWorkerInfo(WorkerInfo workerInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/removeWorkerInfo", workerInfo); } public void saveDepartmentInfo(DepartmentInfo departmentInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/saveDepartmentInfo", departmentInfo); } public void removeDepartmentInfo(DepartmentInfo departmentInfo) { if (!ifSend()) { return; } thirdPartRequestUtil.postJson(jldPushUrl + "/removeDepartmentInfo", departmentInfo); } }