|
@@ -0,0 +1,115 @@
|
|
|
+package com.chelvc.cloud.maintain.controller;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.chelvc.cloud.vehicle.api.dto.DynamicContentDTO;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.AddDynamicContentParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.param.QueryDynamicContentParam;
|
|
|
+import com.chelvc.cloud.vehicle.api.service.DynamicContentService;
|
|
|
+import com.chelvc.framework.base.context.SessionContextHolder;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 动态信息
|
|
|
+ *
|
|
|
+ * @author igl
|
|
|
+ * @date 2023-02-25
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/client/content")
|
|
|
+public class DynamicContentController {
|
|
|
+
|
|
|
+ private final DynamicContentService iDynamicContentService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询列表
|
|
|
+ * @param param
|
|
|
+ * @param pageNum 主键
|
|
|
+ * @param pageSize 主键
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ public IPage<DynamicContentDTO> list(@Validated QueryDynamicContentParam param, Integer pageNum, Integer pageSize) {
|
|
|
+ if (pageNum == null) {
|
|
|
+ pageNum = 1;
|
|
|
+ }
|
|
|
+ if (pageSize == null) {
|
|
|
+ pageSize = 20;
|
|
|
+ }
|
|
|
+ param.setUserId(SessionContextHolder.getId());
|
|
|
+ return iDynamicContentService.queryPageList(param, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据用户id查询动态列表
|
|
|
+ * @param userId 主键
|
|
|
+ * @param pageNum 主键
|
|
|
+ * @param pageSize 主键
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/query-user")
|
|
|
+ public IPage<DynamicContentDTO> queryUserById(@NotNull(message = "用户标识不能为空") Long userId, Integer pageNum, Integer pageSize) {
|
|
|
+ if (pageNum == null) {
|
|
|
+ pageNum = 1;
|
|
|
+ }
|
|
|
+ if (pageSize == null) {
|
|
|
+ pageSize = 20;
|
|
|
+ }
|
|
|
+ return iDynamicContentService.queryUserById(SessionContextHolder.getId(), userId, pageNum, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取动态详情
|
|
|
+ * @param id 主键
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @GetMapping("/query")
|
|
|
+ public DynamicContentDTO getInfo(@NotNull(message = "主键不能为空") Long id) {
|
|
|
+ return iDynamicContentService.queryById(id, SessionContextHolder.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增
|
|
|
+ * @param param
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @PostMapping("/add")
|
|
|
+ public void add(@Validated @RequestBody AddDynamicContentParam param) {
|
|
|
+ param.setUserId(SessionContextHolder.getId());
|
|
|
+ iDynamicContentService.insertByBo(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除
|
|
|
+ * @param id 主键
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/8/9 17:25
|
|
|
+ */
|
|
|
+ @DeleteMapping("/del")
|
|
|
+ public void remove(@NotNull(message = "主键不能为空") Long id) {
|
|
|
+ iDynamicContentService.deleteByIds(id, SessionContextHolder.getId());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 视频审核回调
|
|
|
+ *
|
|
|
+ * @param param
|
|
|
+ * @author igl
|
|
|
+ * @date 2023/9/12 16:55
|
|
|
+ */
|
|
|
+ @PostMapping("/tencent/video/audit/call")
|
|
|
+ //@SkipRespBodyFormatHandler
|
|
|
+ public void videoAuditCallback(@RequestBody Map<String, Object> param) {
|
|
|
+ iDynamicContentService.videoAuditCallback(param);
|
|
|
+ }
|
|
|
+}
|