|
|
@@ -0,0 +1,173 @@
|
|
|
+package com.zsjz.ai.module.eds.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.zsjz.ai.common.config.Result;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsBlogDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsDateGroupDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsPrivateLetterDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialApplicationAccountDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialApplicationFriendAccountDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialApplicationFriendDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialApplicationFriendStatDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialApplicationGroupStatDTO;
|
|
|
+import com.zsjz.ai.module.eds.dto.EdsSocialSearchRecordDTO;
|
|
|
+import com.zsjz.ai.module.eds.query.EdsChatMessageQuery;
|
|
|
+import com.zsjz.ai.module.eds.query.EdsSocialApplicationQuery;
|
|
|
+import com.zsjz.ai.module.eds.service.EdsSocialApplicationService;
|
|
|
+import jakarta.validation.Valid;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 电子数据-社交应用。
|
|
|
+ *
|
|
|
+ * @author zsjz
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/eds/socialApplication")
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class EdsSocialApplicationController {
|
|
|
+
|
|
|
+ private final EdsSocialApplicationService socialService;
|
|
|
+
|
|
|
+ /** 账号信息。 */
|
|
|
+ @GetMapping("/account/{cid}/{type}/{account}")
|
|
|
+ public Result<EdsSocialApplicationAccountDTO> getAccount(@PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account) {
|
|
|
+ return Result.succeed(socialService.getAccount(query(cid, type, account, 1, -1)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 好友分组统计。 */
|
|
|
+ @GetMapping("/groupStat/{cid}/{type}/{account}")
|
|
|
+ public Result<List<EdsSocialApplicationGroupStatDTO>> groupStat(@PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account) {
|
|
|
+ return Result.succeed(socialService.getFriendGroupStats(query(cid, type, account, 1, -1)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 分组好友列表。 */
|
|
|
+ @GetMapping("/groupFiendList/{cid}/{type}/{account}")
|
|
|
+ public Result<Page<EdsSocialApplicationFriendDTO>> getGroupFriendList(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @RequestParam String groupName,
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit) {
|
|
|
+ EdsSocialApplicationQuery query = query(cid, type, account, page, limit);
|
|
|
+ query.setGroupName(groupName);
|
|
|
+ return Result.succeed(socialService.getGroupFriends(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 好友详情。 */
|
|
|
+ @GetMapping("/friendDetail/{cid}/{type}/{account}/{friendAccount}")
|
|
|
+ public Result<EdsSocialApplicationFriendAccountDTO> getFriendDetail(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @PathVariable String friendAccount) {
|
|
|
+ EdsSocialApplicationQuery query = query(cid, type, account, 1, -1);
|
|
|
+ query.setFriendAccount(friendAccount);
|
|
|
+ return Result.succeed(socialService.getFriendDetail(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 博文分组统计。 */
|
|
|
+ @GetMapping("/blogGroupStat/{cid}/{type}/{account}")
|
|
|
+ public Result<List<EdsSocialApplicationGroupStatDTO>> blogGroupStat(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account) {
|
|
|
+ return Result.succeed(socialService.getBlogGroupStats(query(cid, type, account, 1, -1)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 博文分组好友列表。 */
|
|
|
+ @GetMapping("/blogGroupFiendList/{cid}/{type}/{account}")
|
|
|
+ public Result<Page<EdsSocialApplicationFriendStatDTO>> getBlogGroupFriendList(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @RequestParam String groupName,
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit) {
|
|
|
+ EdsSocialApplicationQuery query = query(cid, type, account, page, limit);
|
|
|
+ query.setGroupName(groupName);
|
|
|
+ return Result.succeed(socialService.getBlogGroupFriends(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 博文列表。 */
|
|
|
+ @GetMapping("/blogList/{cid}/{type}/{account}/{friendAccount}")
|
|
|
+ public Result<Page<EdsDateGroupDTO<EdsBlogDTO>>> getBlogList(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @PathVariable String friendAccount,
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit) {
|
|
|
+ EdsSocialApplicationQuery query = query(cid, type, account, page, limit);
|
|
|
+ query.setFriendAccount(friendAccount);
|
|
|
+ return Result.succeed(socialService.getBlogs(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 私信分组统计。 */
|
|
|
+ @GetMapping("/privateLetterGroupStat/{cid}/{type}/{account}")
|
|
|
+ public Result<List<EdsSocialApplicationGroupStatDTO>> privateLetterGroupStat(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account) {
|
|
|
+ return Result.succeed(socialService.getPrivateLetterGroupStats(query(cid, type, account, 1, -1)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 私信分组好友列表。 */
|
|
|
+ @GetMapping("/privateLetterGroupFiendList/{cid}/{type}/{account}")
|
|
|
+ public Result<Page<EdsSocialApplicationFriendStatDTO>> getPrivateLetterGroupFriendList(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @RequestParam String groupName,
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit) {
|
|
|
+ EdsSocialApplicationQuery query = query(cid, type, account, page, limit);
|
|
|
+ query.setGroupName(groupName);
|
|
|
+ return Result.succeed(socialService.getPrivateLetterGroupFriends(query));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 私信列表。 */
|
|
|
+ @PostMapping("/privateLetterDetail")
|
|
|
+ public Result<Page<EdsDateGroupDTO<EdsPrivateLetterDTO>>> getPrivateLetterList(
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit,
|
|
|
+ @Valid @RequestBody EdsChatMessageQuery query) {
|
|
|
+ return Result.succeed(socialService.getPrivateLetters(query, page, limit));
|
|
|
+ }
|
|
|
+
|
|
|
+ /** 搜索记录。 */
|
|
|
+ @GetMapping("/searchRecord/{cid}/{type}/{account}")
|
|
|
+ public Result<Page<EdsSocialSearchRecordDTO>> getSearchRecord(
|
|
|
+ @PathVariable String cid,
|
|
|
+ @PathVariable String type,
|
|
|
+ @PathVariable String account,
|
|
|
+ @RequestParam(defaultValue = "1") long page,
|
|
|
+ @RequestParam(defaultValue = "10") long limit) {
|
|
|
+ return Result.succeed(socialService.getSearchRecords(query(cid, type, account, page, limit)));
|
|
|
+ }
|
|
|
+
|
|
|
+ private EdsSocialApplicationQuery query(String cid, String type, String account,
|
|
|
+ long page, long limit) {
|
|
|
+ EdsSocialApplicationQuery query = new EdsSocialApplicationQuery();
|
|
|
+ query.setCollectTargetId(cid);
|
|
|
+ query.setType(type);
|
|
|
+ query.setAccount(account);
|
|
|
+ query.setPage(page);
|
|
|
+ query.setLimit(limit);
|
|
|
+ return query;
|
|
|
+ }
|
|
|
+}
|