|
|
@@ -43,4 +43,49 @@ public class PearlController {
|
|
|
? Long.valueOf(params.get("itemId").toString()) : null;
|
|
|
return resourceService.deleteResourceItem(userId, itemId);
|
|
|
}
|
|
|
+
|
|
|
+ /** 获取 25 类连接类型列表 */
|
|
|
+ @PostMapping("/connection-types")
|
|
|
+ public Result<List<Map<String, Object>>> connectionTypes() {
|
|
|
+ return Result.success(resourceService.getConnectionTypes());
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 记录互动 */
|
|
|
+ @PostMapping("/interaction/add")
|
|
|
+ public Result<Void> addInteraction(@RequestBody Map<String, Object> params,
|
|
|
+ @RequestAttribute("userId") Long userId) {
|
|
|
+ Long itemId = params.get("itemId") != null
|
|
|
+ ? Long.valueOf(params.get("itemId").toString()) : null;
|
|
|
+ String interactionType = (String) params.get("interactionType");
|
|
|
+ String content = (String) params.get("content");
|
|
|
+ return resourceService.addInteraction(userId, itemId, interactionType, content);
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 互动历史 */
|
|
|
+ @PostMapping("/interaction/list")
|
|
|
+ public Result<List<Map<String, Object>>> interactionList(@RequestBody Map<String, Object> params,
|
|
|
+ @RequestAttribute("userId") Long userId) {
|
|
|
+ Long itemId = params.get("itemId") != null
|
|
|
+ ? Long.valueOf(params.get("itemId").toString()) : null;
|
|
|
+ int page = params.get("page") != null ? Integer.parseInt(params.get("page").toString()) : 1;
|
|
|
+ int size = params.get("size") != null ? Integer.parseInt(params.get("size").toString()) : 5;
|
|
|
+ return resourceService.getInteractionList(userId, itemId, page, size);
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 待办提醒列表 */
|
|
|
+ @PostMapping("/reminder/list")
|
|
|
+ public Result<List<Map<String, Object>>> reminders(@RequestAttribute("userId") Long userId) {
|
|
|
+ return resourceService.getReminders(userId);
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 手动覆盖优先级 */
|
|
|
+ @PostMapping("/item/update-priority")
|
|
|
+ public Result<Void> updatePriority(@RequestBody Map<String, Object> params,
|
|
|
+ @RequestAttribute("userId") Long userId) {
|
|
|
+ Long itemId = params.get("itemId") != null
|
|
|
+ ? Long.valueOf(params.get("itemId").toString()) : null;
|
|
|
+ Integer priority = params.get("priority") != null
|
|
|
+ ? Integer.valueOf(params.get("priority").toString()) : null;
|
|
|
+ return resourceService.updatePriority(userId, itemId, priority);
|
|
|
+ }
|
|
|
}
|