Pu Zhibing
2024-12-24 d09284975427910441eeaf59d34a4d50d2fd5fdc
UserAHTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SystemNoticeServiceImpl.java
@@ -4,11 +4,13 @@
import com.stylefeng.guns.modular.system.dao.SystemNoticeMapper;
import com.stylefeng.guns.modular.system.dao.TNoticesMapper;
import com.stylefeng.guns.modular.system.model.SystemNotice;
import com.stylefeng.guns.modular.system.model.TNotices;
import com.stylefeng.guns.modular.system.service.ISystemNoticeService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -77,8 +79,33 @@
        }
        return list;
    }
    /**
     * 获取系统消息详情
     * @param type
     * @param id
     * @return
     */
    @Override
    public Map<String, Object> queryNoticesInfo(Integer type, Integer id) {
        Map<String, Object> map = new HashMap<>();
        if(type == 1){//系统公告
            SystemNotice systemNotice = systemNoticeMapper.selectById(id);
            TNotices tNotices = tNoticesMapper.selectById(systemNotice.getNoticesId());
            map.put("id", id);
            map.put("title", tNotices.getTitle());
            map.put("img", tNotices.getImgUrl());
            map.put("content", tNotices.getContent());
        }
        if(type == 2){//系统消息
            SystemNotice systemNotice = systemNoticeMapper.selectById(id);
            map.put("id", id);
            map.put("content", systemNotice.getContent());
        }
        return map;
    }
    /**
     * 阅读操作
     * @param id