|
@@ -0,0 +1,87 @@
|
|
|
+package com.chelvc.cloud.admin.controller;
|
|
|
+
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.DynamicContentDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.EditShieldDynamicParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.ExamineDynamicParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.QueryAdminDynamicParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.DynamicContentService;
|
|
|
+import com.chelvc.framework.common.model.PagedDTO;
|
|
|
+import com.chelvc.framework.common.model.PagedVO;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 动态信息
|
|
|
+ *
|
|
|
+ * @author igl
|
|
|
+ * @date 2023-02-25
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/admin/content")
|
|
|
+public class DynamicContentController {
|
|
|
+
|
|
|
+ private final DynamicContentService iDynamicContentService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询列表
|
|
|
+ * @param param
|
|
|
+ * @param page
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/list")
|
|
|
+ public PagedVO<DynamicContentDTO> list(QueryAdminDynamicParam param, PagedDTO page) {
|
|
|
+ return iDynamicContentService.queryAdminPageList(param, page.getPageCode(), page.getPageSize());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 屏蔽某条动态
|
|
|
+ * @param param
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @PutMapping("/shield/update")
|
|
|
+ public void shieldById(@Validated @RequestBody EditShieldDynamicParam param) {
|
|
|
+ iDynamicContentService.shieldById(param.getId(), param.getPlatformStatus());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 屏蔽某个用户所有动态
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @PutMapping("/shield/update-all")
|
|
|
+ public void shieldByUserId(@Validated @RequestBody EditShieldDynamicParam param) {
|
|
|
+ iDynamicContentService.shieldByUserId(param.getId(), param.getPlatformStatus());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 动态手动审核
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/17 17:25
|
|
|
+ */
|
|
|
+ @PutMapping("/examine")
|
|
|
+ public void examine(@Validated @RequestBody ExamineDynamicParam param) {
|
|
|
+ iDynamicContentService.examine(param.getId(), param.getExamine());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取动态详情
|
|
|
+ * @param id 主键
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ public DynamicContentDTO getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
|
|
+ return iDynamicContentService.queryById(id, null);
|
|
|
+ }
|
|
|
+}
|