예제 #1
0
 @Override
 public boolean delLink(Share_link sl, BaseCustomer share_link_publisher) {
   //
   if (sl.getShare_link_publisher().getId() != share_link_publisher.getId()) return false;
   this.share_linkDao.deleteShare_link(sl);
   return true;
 }
예제 #2
0
 @Override
 public boolean updateLink(
     Share_link sl,
     BaseCustomer share_link_publisher,
     String share_link_name,
     String share_link_content) {
   // 如果当前修改链接者非链接发布者
   if (sl.getShare_link_publisher().getId() != share_link_publisher.getId()) return false;
   sl.setShare_link_name(share_link_name);
   sl.setShare_link_content(share_link_content);
   // 更新链接信息后
   // 链接处于待审核状态
   sl.setShare_link_state(2);
   Message ms = new Message();
   ms.setMessage_title("普通用户更新资源链接审核信息");
   ms.setMessage_content(
       "用户更新链接[id:" + sl.getShare_link_id() + " " + sl.getShare_link_name() + "] ,请审核链接内容;");
   ms.setMessage_publisher(share_link_publisher);
   // 随机由id:1~10中抽取一个管理员接受消息
   ms.setMessage_receiver(this.adminDao.findAdminByAdminId((int) (10 * Math.random())));
   // 设置消息为未读
   ms.setMessage_state(0);
   // 推送消息
   this.messageDao.createMessage(ms);
   // 更新链接
   this.share_linkDao.updateShare_link(sl);
   return true;
 }
예제 #3
0
 @Override
 public Map<String, String> checkUploadLink(BaseCustomer share_link_publisher) {
   Map<String, String> linkMap = new HashMap<String, String>();
   // 由id查询用户所发布的资源链接
   List<Object[]> ls = this.share_linkDao.findByShare_link_publisher(share_link_publisher.getId());
   for (Object[] itr : ls) {
     linkMap.put(
         (String) itr[1], "checkLinkAction?share_link_id=" + ((Integer) itr[0]).toString());
   }
   return linkMap;
 }