Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a73f68e
ocean-docs-file-service dependency upgrade
NegaVoayz Mar 12, 2025
8407da3
chore: updated to java23
NegaVoayz Mar 17, 2025
7eb1c57
chore: update all dependencies
NegaVoayz Mar 21, 2025
e9ef6bf
chore: update the project to the new stable dependencies
NegaVoayz Mar 31, 2025
9696067
Revert "chore: update the project to the new stable dependencies"
NegaVoayz Apr 16, 2025
3b641a2
Revert "chore: update all dependencies"
NegaVoayz Apr 16, 2025
0a86e84
Revert "chore: updated to java23"
NegaVoayz Apr 16, 2025
79ceefa
fix(gateway): register note service
cms42 Apr 20, 2025
9202c53
feat: recover notify service
NegaVoayz Apr 20, 2025
aa2e670
Merge branch 'dev' of https://github.com/FDU-CS-Course/OceanLibServer…
NegaVoayz Apr 20, 2025
7b3dd52
fix: null safety check
AInfinity-LilacDream May 6, 2025
0266b27
fix: comment id problem
NegaVoayz May 6, 2025
c9553c0
feat: add create note logic
AInfinity-LilacDream May 8, 2025
5331b82
Merge branch 'dev' of https://github.com/FDU-CS-Course/FDU-SOFT130006…
AInfinity-LilacDream May 8, 2025
18951f4
fix: deprecate the subscription methods and use database instead
NegaVoayz May 13, 2025
9e293a9
Merge branch 'dev' of https://github.com/FDU-CS-Course/OceanLibServer…
NegaVoayz May 13, 2025
ed9c2d4
Revert "fix: deprecate the subscription methods and use database inst…
NegaVoayz May 14, 2025
3403841
fix: remove default null comment in list.
NegaVoayz May 14, 2025
d1d4653
fix: rename 'ID' to '_id'.
NegaVoayz May 14, 2025
35345bc
feat: try apply auto read method when getting notify
NegaVoayz May 14, 2025
714897c
fix: remove query illusions
NegaVoayz May 14, 2025
cb1dc1f
feat: enable notify reading process and update SQL trigger
NegaVoayz May 14, 2025
f98dd3b
fix: you shall have a name
NegaVoayz May 14, 2025
76414eb
feat: add new interface for unread notify check
NegaVoayz May 14, 2025
a89376b
minor: update NoteEntity
AInfinity-LilacDream May 17, 2025
aad5d6e
refactor: standardize project structure, convert NoteService and Note…
SeleiXi May 17, 2025
091f198
feat: add note database logic
NegaVoayz May 17, 2025
74c57cd
fix: specify what frontend should give.
NegaVoayz May 17, 2025
7a07de8
feat: implement getMyFileList API to support "myUpload" page
cms42 May 17, 2025
1c3eb5f
feat: implement updateUserInfo interface to support `edit my profile`…
cms42 May 17, 2025
4a74104
fix: add translation between NoteEntity and note db
AInfinity-LilacDream May 18, 2025
593e838
feat: add search function
NegaVoayz May 20, 2025
67d3d78
feat: impl createNoteComment and getNoteComment
AInfinity-LilacDream May 22, 2025
7bc90f4
feat: impl note comment get/create logic
AInfinity-LilacDream May 22, 2025
5f3c896
feat: change note comment entity class
AInfinity-LilacDream May 23, 2025
56bf5dc
feat: add note deletion & comment deletion
AInfinity-LilacDream May 24, 2025
ed393ab
feat: impl note collection logic
AInfinity-LilacDream May 27, 2025
4316070
feat: impl notify logic to note comment
AInfinity-LilacDream May 28, 2025
0f00615
chore: update requirements
cms42 May 30, 2025
96c1056
fix: recover authentication system
NegaVoayz May 31, 2025
1681a39
fix: remove unused code
NegaVoayz May 31, 2025
b497c4a
fix: register AuthUserMethodArgumentResolver in note microservice
cms42 May 31, 2025
32b7975
feat: implement `like` for note
cms42 May 31, 2025
c70292f
fix: notify logic
AInfinity-LilacDream May 31, 2025
039b554
fix: comment evaluation
AInfinity-LilacDream Jun 11, 2025
b97ea37
feat: implement user info update validation
cms42 Jun 21, 2025
82895bd
feat: unlike will remove the like notification
NegaVoayz Jun 21, 2025
befda77
feat: add readnum support
AInfinity-LilacDream Jun 21, 2025
9661f14
feat: new handler '/getMyNotes' online
NegaVoayz Jun 21, 2025
eae868d
fix: small mapper mistake
NegaVoayz Jun 21, 2025
9b8d038
feat: add comment like and move comment to MySQL
NegaVoayz Jun 21, 2025
578dfb3
feat: add comment like controller
NegaVoayz Jun 21, 2025
6b1c9ab
feat: implement user info update validation
cms42 Jun 21, 2025
3d53393
feat: unlike will remove the like notification
NegaVoayz Jun 21, 2025
b4da2d5
feat: new handler '/getMyNotes' online
NegaVoayz Jun 21, 2025
ed1077a
fix: sql syntax
AInfinity-LilacDream Jun 21, 2025
d4d737a
feat: add comment like and move comment to MySQL
NegaVoayz Jun 21, 2025
14d7c2a
feat: add comment like controller
NegaVoayz Jun 21, 2025
8b9cd1b
fix: update old code to use new note comment implementation
cms42 Jun 22, 2025
9538027
Merge branch 'dev' of https://github.com/FDU-CS-Course/OceanLibServer…
NegaVoayz Jun 22, 2025
d0fa971
fix: note comment db mapping
cms42 Jun 22, 2025
c76d130
refactor: refactor note & notecomment
AInfinity-LilacDream Jun 22, 2025
c0a1a51
fix: notify logic
AInfinity-LilacDream Jun 22, 2025
9dbea40
feat: add document comment reply getter API
NegaVoayz Jun 22, 2025
af2354b
fix: implement user register logic
cms42 Jun 22, 2025
5b76a69
fix: impl comment like button
AInfinity-LilacDream Jun 22, 2025
65cc469
Merge branch 'dev' of https://github.com/FDU-CS-Course/FDU-SOFT130006…
AInfinity-LilacDream Jun 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/libraries/jodconverter_core.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/libraries/jodconverter_local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/libraries/jodconverter_local_oo.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions .idea/libraries/jodconverter_spring.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .idea/libraries/jodconverter_spring_boot_starter.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/validation.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -77,16 +78,20 @@ public MsgEntity<String> deleteCollection(@AuthUser AuthUserEntity authUser,
// 需要一并清空用户的收藏情况记录
for (Integer itemID : collectionEntity.getItems()) { // 遍历被删除的收藏夹中的文件对应用户行为记录
UserBehaviorEntity userBehaviorEntityQuery = new UserBehaviorEntity(itemID, mainType, username, BehaviorType.DO_COLLECTION);
JSONArray collectionList = (JSONArray) userBehaviorService.findBehaviorRecord(userBehaviorEntityQuery).getExtraInfo(IN_COLLECTION);

collectionList.remove(collectionID);
if (collectionList.isEmpty()) {//所有的收藏已经被全部删除了
// 移除收藏量统计
userCollectionService.collectionStatisticsChange(itemID, "-1", mainType);
// 移除用户行为记录
userBehaviorService.deleteBehaviorRecord(userBehaviorEntityQuery);
} else { // 还有收藏记录存在,更新记录
userBehaviorService.updateBehaviorRecordExtraInfo(userBehaviorEntityQuery, IN_COLLECTION, collectionList);
Object extraInfo = userBehaviorService.findBehaviorRecord(userBehaviorEntityQuery).getExtraInfo(IN_COLLECTION);
if (extraInfo instanceof List<?>) {
List<String> collectionList = (List<String>) extraInfo;
collectionList.removeIf(id -> id.equals(collectionID));

if (collectionList.isEmpty()) {//所有的收藏已经被全部删除了
// 移除文件收藏量统计
userCollectionService.collectionStatisticsChange(itemID, "-1", mainType);
// 移除用户行为记录
userBehaviorService.deleteBehaviorRecord(userBehaviorEntityQuery);
} else { // 还有收藏记录存在,更新记录
userBehaviorService.updateBehaviorRecordExtraInfo(userBehaviorEntityQuery, IN_COLLECTION, collectionList);
}
}
}
return new MsgEntity<>(SUCCESS);
Expand Down Expand Up @@ -148,28 +153,31 @@ public MsgEntity<UserCollectionEntity> changeCollectionItem(@AuthUser AuthUserEn

@RequestMapping(value = "/deleteCollectionItem", method = RequestMethod.GET)
public MsgEntity<String> deleteCollectedItem(@AuthUser AuthUserEntity authUser,
@RequestParam(required = false) String username,
@RequestParam String collectionID,
@RequestParam Integer itemID,
@RequestParam MainType mainType) {
username = authUser.getAllowOperationUsername(username);
String username = authUser.getUsername();

Integer removedItemID = userCollectionService.deleteOneCollectionItem(username, collectionID, itemID, mainType);
if (removedItemID == null) {
throw new BusinessException("-2", "未找到指定的收藏夹或没有变更发生");
}
// 进行到了此处说明肯定有删除发生
UserBehaviorEntity userBehaviorEntityQuery = new UserBehaviorEntity(itemID, mainType, username, BehaviorType.DO_COLLECTION);
JSONArray collectionList = (JSONArray) userBehaviorService.findBehaviorRecord(userBehaviorEntityQuery).getExtraInfo(IN_COLLECTION);
collectionList.remove(collectionID);

if (collectionList.isEmpty()) {//所有的收藏已经被全部删除了
// 移除文件收藏量统计
userCollectionService.collectionStatisticsChange(itemID, "-1", mainType);
// 移除用户行为记录
userBehaviorService.deleteBehaviorRecord(userBehaviorEntityQuery);
} else { // 还有收藏记录存在,更新记录
userBehaviorService.updateBehaviorRecordExtraInfo(userBehaviorEntityQuery, IN_COLLECTION, collectionList);
Object extraInfo = userBehaviorService.findBehaviorRecord(userBehaviorEntityQuery).getExtraInfo(IN_COLLECTION);
if (extraInfo instanceof List<?>) {
List<String> collectionList = (List<String>) extraInfo;
collectionList.removeIf(id -> id.equals(collectionID));

if (collectionList.isEmpty()) {//所有的收藏已经被全部删除了
// 移除文件收藏量统计
userCollectionService.collectionStatisticsChange(itemID, "-1", mainType);
// 移除用户行为记录
userBehaviorService.deleteBehaviorRecord(userBehaviorEntityQuery);
} else { // 还有收藏记录存在,更新记录
userBehaviorService.updateBehaviorRecordExtraInfo(userBehaviorEntityQuery, IN_COLLECTION, collectionList);
}
}
return new MsgEntity<>(SUCCESS);
}
Expand All @@ -182,6 +190,7 @@ public MsgEntity<List<Integer>> getCollectionItemList(@AuthUser AuthUserEntity a
username = authUser.getAllowOperationUsername(username);

UserCollectionEntity.CollectionEntity collectionEntity = userCollectionService.getCollectionByUsernameAndCollectionID(username, collectionID, mainType);
if (collectionEntity == null) return new MsgEntity<>("SUCCESS", "2", null);
return new MsgEntity<>("SUCCESS", "1", collectionEntity.getItems());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public UserCollectionEntity.CollectionEntity getCollectionByUsernameAndCollectio

AggregationResults<UserCollectionEntity.CollectionEntity> results = mongoTemplate.aggregate(aggregation,
getCollectionName(mainType), UserCollectionEntity.CollectionEntity.class);

System.out.println(results.getMappedResults());
if (results.getMappedResults().isEmpty()) return null;
return results.getMappedResults().get(0);
}

Expand Down
Loading