添加咨询接口
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
package com.ruoyi.cms.service.msg;
|
||||
|
||||
import com.ruoyi.cms.domain.msg.HrAgencyConsultMsg;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人力中介咨询消息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-07-10
|
||||
*/
|
||||
public interface IHrAgencyConsultMsgService
|
||||
{
|
||||
/**
|
||||
* 查询单条消息
|
||||
*
|
||||
* @param id 主键ID
|
||||
* @return 消息实体
|
||||
*/
|
||||
public HrAgencyConsultMsg selectHrAgencyConsultMsgById(Long id);
|
||||
|
||||
/**
|
||||
* 查询消息列表
|
||||
*
|
||||
* @param hrAgencyConsultMsg 查询条件
|
||||
* @return 消息集合
|
||||
*/
|
||||
public List<HrAgencyConsultMsg> selectHrAgencyConsultMsgList(HrAgencyConsultMsg hrAgencyConsultMsg);
|
||||
|
||||
/**
|
||||
* 新增消息(自动生成sessionId逻辑内置)
|
||||
*
|
||||
* @param hrAgencyConsultMsg 消息实体
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertHrAgencyConsultMsg(HrAgencyConsultMsg hrAgencyConsultMsg);
|
||||
|
||||
/**
|
||||
* 修改消息
|
||||
*
|
||||
* @param hrAgencyConsultMsg 消息实体
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateHrAgencyConsultMsg(HrAgencyConsultMsg hrAgencyConsultMsg);
|
||||
|
||||
/**
|
||||
* 批量删除消息
|
||||
*
|
||||
* @param ids 需要删除的主键数组
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteHrAgencyConsultMsgByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据会话ID查询全部聊天记录
|
||||
*/
|
||||
List<HrAgencyConsultMsg> listMsgBySessionId(String sessionId);
|
||||
|
||||
/**
|
||||
* 标记机构当前会话全部消息已读
|
||||
*/
|
||||
int markAgencyRead(HrAgencyConsultMsg hrAgencyConsultMsg);
|
||||
|
||||
/**
|
||||
* 标记求职者当前会话全部消息已读
|
||||
*/
|
||||
int markSeekerRead(HrAgencyConsultMsg hrAgencyConsultMsg);
|
||||
|
||||
/**
|
||||
* 生成会话唯一sessionId:SESS_机构ID_求职者ID
|
||||
* @param agencyId 人力机构ID
|
||||
* @param seekerId 求职者ID
|
||||
* @return sessionId
|
||||
*/
|
||||
String generateSessionId(Long agencyId, Long seekerId);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.ruoyi.cms.service.msg.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.msg.HrAgencyConsultMsg;
|
||||
import com.ruoyi.cms.mapper.msg.HrAgencyConsultMsgMapper;
|
||||
import com.ruoyi.cms.service.msg.IHrAgencyConsultMsgService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 人力中介咨询消息Service实现
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-07-10
|
||||
*/
|
||||
@Service
|
||||
public class HrAgencyConsultMsgServiceImpl extends ServiceImpl<HrAgencyConsultMsgMapper, HrAgencyConsultMsg> implements IHrAgencyConsultMsgService {
|
||||
@Autowired
|
||||
private HrAgencyConsultMsgMapper hrAgencyConsultMsgMapper;
|
||||
|
||||
@Override
|
||||
public HrAgencyConsultMsg selectHrAgencyConsultMsgById(Long id)
|
||||
{
|
||||
return hrAgencyConsultMsgMapper.selectHrAgencyConsultMsgById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HrAgencyConsultMsg> selectHrAgencyConsultMsgList(HrAgencyConsultMsg hrAgencyConsultMsg)
|
||||
{
|
||||
return hrAgencyConsultMsgMapper.selectHrAgencyConsultMsgList(hrAgencyConsultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertHrAgencyConsultMsg(HrAgencyConsultMsg hrAgencyConsultMsg)
|
||||
{
|
||||
// 默认未读
|
||||
if (hrAgencyConsultMsg.getSeekerRead() == null) {
|
||||
hrAgencyConsultMsg.setSeekerRead(0);
|
||||
}
|
||||
if (hrAgencyConsultMsg.getAgencyRead() == null) {
|
||||
hrAgencyConsultMsg.setAgencyRead(0);
|
||||
}
|
||||
if (hrAgencyConsultMsg.getMsgType() == null) {
|
||||
hrAgencyConsultMsg.setMsgType(1);
|
||||
}
|
||||
return hrAgencyConsultMsgMapper.insert(hrAgencyConsultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateHrAgencyConsultMsg(HrAgencyConsultMsg hrAgencyConsultMsg)
|
||||
{
|
||||
return hrAgencyConsultMsgMapper.updateById(hrAgencyConsultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteHrAgencyConsultMsgByIds(Long[] ids)
|
||||
{
|
||||
return hrAgencyConsultMsgMapper.deleteBatchIds(Arrays.asList(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HrAgencyConsultMsg> listMsgBySessionId(String sessionId) {
|
||||
return hrAgencyConsultMsgMapper.selectMsgBySessionId(sessionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int markAgencyRead(HrAgencyConsultMsg hrAgencyConsultMsg) {
|
||||
return hrAgencyConsultMsgMapper.updateAgencyReadBySessionId(hrAgencyConsultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int markSeekerRead(HrAgencyConsultMsg hrAgencyConsultMsg) {
|
||||
return hrAgencyConsultMsgMapper.updateSeekerReadBySessionId(hrAgencyConsultMsg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String generateSessionId(Long agencyId, Long seekerId) {
|
||||
return "SESS_" + agencyId + "_" + seekerId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user