文档库--订阅
This commit is contained in:
+36
@@ -314,6 +314,42 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
|||||||
return Result.OK("取消收藏成功");
|
return Result.OK("取消收藏成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加订阅
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "添加订阅")
|
||||||
|
@ApiOperation(value="添加订阅", notes="添加订阅")
|
||||||
|
@GetMapping(value = "/addSubscribe")
|
||||||
|
public Result<?> addSubscribe(String id) {
|
||||||
|
try {
|
||||||
|
bussDocumentLibraryEOService.addSubscribe(id);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Result.error("订阅失败");
|
||||||
|
}
|
||||||
|
return Result.OK("订阅成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订阅
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "取消订阅")
|
||||||
|
@ApiOperation(value="取消订阅", notes="取消订阅")
|
||||||
|
@GetMapping(value = "/cancelSubscribe")
|
||||||
|
public Result<?> cancelSubscribe(String id) {
|
||||||
|
try {
|
||||||
|
bussDocumentLibraryEOService.cancelSubscribe(id);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Result.error("取消订阅失败");
|
||||||
|
}
|
||||||
|
return Result.OK("取消订阅成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -119,5 +119,17 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
|||||||
*/
|
*/
|
||||||
void cancelCollect(String id);
|
void cancelCollect(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加订阅
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void addSubscribe(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消订阅
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void cancelSubscribe(String id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+27
@@ -18,6 +18,8 @@ import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
|||||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||||
import com.jero.modules.oss.entity.OSSFile;
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import com.jero.modules.oss.service.IOSSFileService;
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
|
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
|
||||||
|
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||||
@@ -59,6 +61,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IOnlCgformCollectionService iOnlCgformCollectionService;
|
private IOnlCgformCollectionService iOnlCgformCollectionService;
|
||||||
|
@Autowired
|
||||||
|
private IOnlCgformSubscribeService iOnlCgformSubscribeService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -745,6 +749,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
onlCgformCollection.setDocumentId(id);
|
onlCgformCollection.setDocumentId(id);
|
||||||
iOnlCgformCollectionService.add(onlCgformCollection);
|
iOnlCgformCollectionService.add(onlCgformCollection);
|
||||||
//订阅表中添加数据
|
//订阅表中添加数据
|
||||||
|
OnlCgformSubscribe onlCgformSubscribe = new OnlCgformSubscribe();
|
||||||
|
onlCgformSubscribe.setDocumentId(id);
|
||||||
|
iOnlCgformSubscribeService.add(onlCgformSubscribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -754,5 +761,25 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
|||||||
lambdaQueryWrapper.in(OnlCgformCollection::getDocumentId,id);
|
lambdaQueryWrapper.in(OnlCgformCollection::getDocumentId,id);
|
||||||
iOnlCgformCollectionService.remove(lambdaQueryWrapper);
|
iOnlCgformCollectionService.remove(lambdaQueryWrapper);
|
||||||
//订阅表中删除数据
|
//订阅表中删除数据
|
||||||
|
LambdaQueryWrapper<OnlCgformSubscribe> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.in(OnlCgformSubscribe::getDocumentId,id);
|
||||||
|
iOnlCgformSubscribeService.remove(wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addSubscribe(String id) {
|
||||||
|
//订阅表中添加数据
|
||||||
|
OnlCgformSubscribe onlCgformSubscribe = new OnlCgformSubscribe();
|
||||||
|
onlCgformSubscribe.setDocumentId(id);
|
||||||
|
iOnlCgformSubscribeService.add(onlCgformSubscribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancelSubscribe(String id) {
|
||||||
|
//订阅表中删除数据
|
||||||
|
LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.in(OnlCgformSubscribe::getDocumentId,id);
|
||||||
|
iOnlCgformSubscribeService.remove(lambdaQueryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user