From 2f68e5600f0b60d6f8d170f4536e1fc410662ea7 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 01 七月 2025 11:14:39 +0800
Subject: [PATCH] 视频es处理通过mq异步执行
---
framework/src/main/java/cn/lili/modules/lmk/service/EsService.java | 4
framework/src/main/resources/mapper/lmk/VideoMapper.xml | 4
framework/src/main/java/cn/lili/rocketmq/tags/VideoTagsEnum.java | 4
manager-api/src/main/java/cn/lili/controller/lmk/VideoController.java | 15 --
buyer-api/src/main/java/cn/lili/controller/lmk/VideoController.java | 2
framework/src/main/java/cn/lili/modules/lmk/domain/dto/VideoEsUpdateDTO.java | 24 ++++
framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java | 21 +--
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 104 ++++++++++++--------
consumer/src/main/java/cn/lili/listener/VideoMessageListener.java | 62 +++++++++++
framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java | 4
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java | 21 ++--
11 files changed, 173 insertions(+), 92 deletions(-)
diff --git a/buyer-api/src/main/java/cn/lili/controller/lmk/VideoController.java b/buyer-api/src/main/java/cn/lili/controller/lmk/VideoController.java
index 19e4379..450d331 100644
--- a/buyer-api/src/main/java/cn/lili/controller/lmk/VideoController.java
+++ b/buyer-api/src/main/java/cn/lili/controller/lmk/VideoController.java
@@ -38,7 +38,7 @@
}
@PutMapping
- @ApiOperation(value = "淇敼", notes = "淇敼")
+ @ApiOperation(value = "淇敼瑙嗛", notes = "淇敼瑙嗛")
public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) {
return videoService.updatePublish(form);
}
diff --git a/consumer/src/main/java/cn/lili/listener/VideoMessageListener.java b/consumer/src/main/java/cn/lili/listener/VideoMessageListener.java
index 613f9af..1bedb96 100644
--- a/consumer/src/main/java/cn/lili/listener/VideoMessageListener.java
+++ b/consumer/src/main/java/cn/lili/listener/VideoMessageListener.java
@@ -1,9 +1,13 @@
package cn.lili.listener;
import cn.lili.cache.Cache;
+import cn.lili.elasticsearch.EsSuffix;
+import cn.lili.modules.lmk.domain.dto.VideoEsUpdateDTO;
import cn.lili.modules.lmk.domain.entity.MyCollect;
import cn.lili.modules.lmk.domain.entity.ThumbsUpRecord;
+import cn.lili.modules.lmk.domain.es.VideoIndex;
import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm;
+import cn.lili.modules.lmk.service.EsService;
import cn.lili.modules.lmk.service.ThumbsUpRecordService;
import cn.lili.modules.lmk.service.VideoCommentService;
import cn.lili.modules.lmk.service.VideoService;
@@ -16,6 +20,7 @@
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
/**
@@ -33,20 +38,32 @@
private VideoService videoService;
@Autowired
+ @Qualifier("videoEsServiceImpl")
+ private EsService esService;
+
+ @Autowired
private Cache<Object> cache;
@Override
public void onMessage(MessageExt messageExt) {
try {
String msg = new String(messageExt.getBody());
- if (StringUtils.isBlank(msg)) {
- log.error("video msg is null, cant not consumer");
- return;
- }
+
switch (VideoTagsEnum.valueOf(messageExt.getTags())) {
case COLLECT:
this.collect(msg);
break;
+ case ES_RECREATE:
+ this.recreateVideoIndex();
+ break;
+ case ES_DOC_ADD_OR_UPDATE:
+ this.addOrUpdateEsVideo(msg);
+ break;
+ case ES_DOC_UPDATE_SOME_FIELD:
+ this.updateEsVideoSomeField(msg);
+ break;
+ case ES_DOC_DEL:
+ this.delEsVideo(msg);
default:
log.error("video msg not match correct tag, consumer err");
break;
@@ -66,4 +83,41 @@
videoService.mqCollectChange(collect);
}
+ /**
+ * 閲嶅缓瑙嗛绱㈠紩
+ *
+ */
+ public void recreateVideoIndex() {
+ esService.recreateIndex(EsSuffix.VIDEO_INDEX_NAME, "/es/video.json");
+ }
+
+ /**
+ * 鏂板es瑙嗛鏁版嵁/鏇存柊
+ *
+ * @param msg
+ */
+ public void addOrUpdateEsVideo(String msg) {
+ VideoIndex videoIndex = JSON.parseObject(msg, VideoIndex.class);
+ esService.addOrUpdateDocument(videoIndex);
+ }
+
+ /**
+ * 鏇存柊es瑙嗛鐨勬煇浜涘瓧娈�
+ *
+ * @param msg
+ */
+ public void updateEsVideoSomeField(String msg) {
+ VideoEsUpdateDTO dto = JSON.parseObject(msg, VideoEsUpdateDTO.class);
+ esService.updateSomeField(EsSuffix.VIDEO_INDEX_NAME, dto.getId(), dto.getFields());
+ }
+
+ /**
+ * 鏍规嵁id鍒犻櫎es涓殑瑙嗛
+ *
+ * @param id
+ */
+ public void delEsVideo(String id) {
+ esService.deleteDocument(EsSuffix.VIDEO_INDEX_NAME, id);
+ }
+
}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/domain/dto/VideoEsUpdateDTO.java b/framework/src/main/java/cn/lili/modules/lmk/domain/dto/VideoEsUpdateDTO.java
new file mode 100644
index 0000000..ea3ee6d
--- /dev/null
+++ b/framework/src/main/java/cn/lili/modules/lmk/domain/dto/VideoEsUpdateDTO.java
@@ -0,0 +1,24 @@
+package cn.lili.modules.lmk.domain.dto;
+
+import lombok.Data;
+
+import java.util.Map;
+
+/**
+ * @author锛歺p
+ * @date锛�2025/7/1 10:01
+ */
+@Data
+public class VideoEsUpdateDTO {
+
+ /**
+ * 瑙嗛id
+ */
+ private String id;
+
+ /**
+ * 淇敼鍝簺瀛楁
+ */
+ private Map<String, Object> fields;
+
+}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java b/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java
index 380e9e5..560e878 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/mapper/VideoMapper.java
@@ -136,8 +136,8 @@
* es鍚屾鏌ヨ瑙嗛鏁版嵁
*
* @param start 寮�濮嬩綅缃�
- * @param end 缁撴潫浣嶇疆
+ * @param pageSize 姣忛〉鏉℃暟
* @return
*/
- List<VideoIndex> getEsPage(@Param("start") int start, @Param("end") int end);
+ List<VideoIndex> getEsPage(@Param("start") int start, @Param("pageSize") int pageSize);
}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/EsService.java b/framework/src/main/java/cn/lili/modules/lmk/service/EsService.java
index ea42513..1054162 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/EsService.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/EsService.java
@@ -37,11 +37,9 @@
/**
* 娣诲姞/淇敼 鏂囨。锛屽鏋滄槸淇敼锛屽垯鏄暣鏉℃暟鎹洿鏂�
*
- * @param indexName 绱㈠紩鍚嶇О
- * @param id es涓婚敭锛屽彲浼犱笟鍔′富閿�
* @param data 鏁版嵁瀵硅薄
*/
- void addOrUpdateDocument(String indexName, String id, Object data);
+ void addOrUpdateDocument(Object data);
/**
* 鏇存柊鏌愪簺瀛楁鐨勫��
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java b/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java
index 0671480..16f3932 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/VideoService.java
@@ -22,20 +22,6 @@
public interface VideoService extends IService<Video> {
/**
- * 娣诲姞
- * @param form
- * @return
- */
- Result add(WxVideoForm form);
-
- /**
- * 淇敼
- * @param form
- * @return
- */
- Result update(WxVideoForm form);
-
- /**
* 鎵归噺鍒犻櫎
* @param ids
* @return
@@ -265,4 +251,11 @@
* @param collect
*/
void mqCollectChange(MyCollect collect);
+
+ /**
+ * 閲嶅缓瑙嗛es绱㈠紩
+ *
+ * @return
+ */
+ Result recreateEsIndex();
}
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java
index 7d9a4d8..3823ce3 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoEsServiceImpl.java
@@ -108,7 +108,6 @@
}
// 2. 澶氱嚎绋嬫煡璇㈣棰戞暟鎹紝鏋勫缓鏂囨。瀵硅薄
Long totalVideo = new LambdaQueryChainWrapper<>(videoMapper)
- .eq(Video::getStatus, VideoStatusEnum.PUBLISHED.getValue())
.count();
int totalThreads = (int) Math.ceil((double) totalVideo / 200); // 璁$畻闇�瑕佸灏戜釜绾跨▼
CountDownLatch latch = new CountDownLatch(totalThreads);
@@ -155,15 +154,17 @@
}
@Override
- public void addOrUpdateDocument(String indexName, String id, Object data) {
- indexName = this.getIndexFullName(indexName);
- IndexRequest request = new IndexRequest(indexName);
- request.id(id).source(data);
- try {
- client.index(request, RequestOptions.DEFAULT);
- } catch (IOException e) {
- throw new RuntimeException("es鏂囨。娣诲姞/淇敼澶辫触", e);
- }
+ public void addOrUpdateDocument(Object data) {
+ VideoIndex videoIndex = (VideoIndex) data;
+ esVideoIndexRepository.save(videoIndex);
+// indexName = this.getIndexFullName(indexName);
+// IndexRequest request = new IndexRequest(indexName);
+// request.id(id).source(data);
+// try {
+// client.index(request, RequestOptions.DEFAULT);
+// } catch (IOException e) {
+// throw new RuntimeException("es鏂囨。娣诲姞/淇敼澶辫触", e);
+// }
}
@Override
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
index 980f329..3deed2b 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -2,9 +2,11 @@
import cn.lili.cache.Cache;
import cn.lili.cache.CachePrefix;
+import cn.lili.common.properties.RocketmqCustomProperties;
import cn.lili.common.security.context.UserContext;
import cn.lili.elasticsearch.EsSuffix;
import cn.lili.modules.lmk.constant.RedisKeyExpireConstant;
+import cn.lili.modules.lmk.domain.dto.VideoEsUpdateDTO;
import cn.lili.modules.lmk.domain.entity.*;
import cn.lili.modules.lmk.domain.es.VideoIndex;
import cn.lili.modules.lmk.domain.form.*;
@@ -16,6 +18,9 @@
import cn.lili.modules.member.entity.dos.Member;
import cn.lili.modules.member.service.FootprintService;
import cn.lili.modules.member.service.MemberService;
+import cn.lili.rocketmq.RocketmqSendCallbackBuilder;
+import cn.lili.rocketmq.tags.CommentTagsEnum;
+import cn.lili.rocketmq.tags.VideoTagsEnum;
import cn.lili.utils.COSUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -28,6 +33,7 @@
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.ListUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;
@@ -65,37 +71,9 @@
private final KitchenTypeService kitchenTypeService;
private final Cache cache;
- @Qualifier("videoEsServiceImpl")
- private final EsService videoEsService;
+ private final RocketmqCustomProperties rocketmqCustomProperties;
+ private final RocketMQTemplate rocketMQTemplate;
-
- /**
- * 娣诲姞
- * @param form
- * @return
- */
- @Override
- public Result add(WxVideoForm form) {
- Video entity = WxVideoForm.getEntityByForm(form, null);
- baseMapper.insert(entity);
- return Result.ok("娣诲姞鎴愬姛");
- }
-
- /**
- * 淇敼
- * @param form
- * @return
- */
- @Override
- public Result update(WxVideoForm form) {
- Video entity = baseMapper.selectById(form.getId());
-
- // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
- Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
- BeanUtils.copyProperties(form, entity);
- baseMapper.updateById(entity);
- return Result.ok("淇敼鎴愬姛");
- }
/**
* 鎵归噺鍒犻櫎
@@ -123,7 +101,9 @@
new LambdaUpdateChainWrapper<>(videoTagRefService.getBaseMapper())
.eq(VideoTagRef::getVideoId, id)
.remove();
- videoEsService.deleteDocument(EsSuffix.VIDEO_INDEX_NAME, id);
+ // mq寮傛鍒犻櫎es鏁版嵁
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_DEL.name();
+ rocketMQTemplate.asyncSend(destination, id, RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("鍒犻櫎鎴愬姛");
}
@@ -185,6 +165,7 @@
video.setStatus(VideoStatusEnum.AUDITING.getValue());
video.setCoverUrl(form.getCover());
video.setVideoType(VideoTypeEnum.VIDEO.getValue());
+ video.setRecommend(Boolean.FALSE);
if (VideoContentTypeEnum.IMG.getValue().equals(form.getVideoContentType())) {
video.setVideoImgs(JSON.toJSONString(form.getVideoImgs()));
}
@@ -234,7 +215,7 @@
}
videoGoodsService.saveBatch(videoGoods);
}
- // 5. 鏋勫缓es涓暟鎹�
+ // 5. 鏋勫缓es涓暟鎹紝mq寮傛澶勭悊
VideoIndex videoIndex = new VideoIndex();
BeanUtils.copyProperties(video, videoIndex);
videoIndex.setCoverFileKey(video.getCoverUrl());
@@ -245,7 +226,8 @@
}).collect(Collectors.toList());
videoIndex.setGoodsList(esGoodsList);
videoIndex.setTagList(esTagList);
- videoEsService.addOrUpdateDocument(EsSuffix.VIDEO_INDEX_NAME, video.getId(), videoIndex);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_ADD_OR_UPDATE.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(videoIndex), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("鍙戝竷鎴愬姛锛岃棰戝鏍镐腑~");
}
@@ -316,7 +298,7 @@
}
videoGoodsService.saveBatch(videoGoods);
}
- // 5. 鏇存柊es涓殑鏁版嵁
+ // 5. 鏇存柊es涓殑鏁版嵁锛宮q寮傛澶勭悊
VideoIndex videoIndex = new VideoIndex();
BeanUtils.copyProperties(video, videoIndex);
videoIndex.setCoverFileKey(video.getCoverUrl());
@@ -327,7 +309,8 @@
}).collect(Collectors.toList());
videoIndex.setGoodsList(esGoodsList);
videoIndex.setTagList(esTagList);
- videoEsService.addOrUpdateDocument(EsSuffix.VIDEO_INDEX_NAME, video.getId(), videoIndex);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_ADD_OR_UPDATE.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(videoIndex), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("鍙戝竷鎴愬姛锛岃棰戝鏍镐腑~");
}
@@ -356,9 +339,15 @@
.eq(Video::getId, form.getId())
.set(Video::getRecommend, form.getRecommend())
.update();
+
+ // mq寮傛鏇存柊es
Map<String, Object> fields = new HashMap<>(2);
fields.put("recommend", form.getRecommend());
- videoEsService.updateSomeField(EsSuffix.VIDEO_INDEX_NAME, form.getId(), fields);
+ VideoEsUpdateDTO dto = new VideoEsUpdateDTO();
+ dto.setId(form.getId());
+ dto.setFields(fields);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_UPDATE_SOME_FIELD.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(dto), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("璁剧疆鎴愬姛");
}
@@ -378,17 +367,24 @@
}
videoAuditRecordService.save(auditRecord);
// 2. 淇敼瑙嗛鐘舵��
+ Map<String, Object> fields = new HashMap<>(2);
if (form.getResult()) {
video.setStatus(VideoStatusEnum.PUBLISHED.getValue());
video.setAuditPassTime(new Date());
- Map<String, Object> fields = new HashMap<>(2);
fields.put("status", VideoStatusEnum.PUBLISHED.getValue());
- videoEsService.updateSomeField(EsSuffix.VIDEO_INDEX_NAME, video.getId(), fields);
} else {
video.setStatus(VideoStatusEnum.REJECT.getValue());
+ fields.put("status", VideoStatusEnum.REJECT.getValue());
}
baseMapper.updateById(video);
+
+ // 3. mq寮傛鏇存柊es
+ VideoEsUpdateDTO dto = new VideoEsUpdateDTO();
+ dto.setId(video.getId());
+ dto.setFields(fields);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_UPDATE_SOME_FIELD.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(dto), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok();
}
@@ -400,10 +396,14 @@
.eq(Video::getId, id)
.set(Video::getStatus, VideoStatusEnum.PUBLISHED.getValue())
.update();
- // 2. 鏇存柊es
+ // 2. mq寮傛鏇存柊es
Map<String, Object> fields = new HashMap<>(2);
fields.put("status", VideoStatusEnum.PUBLISHED.getValue());
- videoEsService.updateSomeField(EsSuffix.VIDEO_INDEX_NAME, id, fields);
+ VideoEsUpdateDTO dto = new VideoEsUpdateDTO();
+ dto.setId(id);
+ dto.setFields(fields);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_UPDATE_SOME_FIELD.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(dto), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("涓婃灦鎴愬姛");
}
@@ -415,10 +415,14 @@
.eq(Video::getId, form.getId())
.set(Video::getStatus, VideoStatusEnum.DISABLE.getValue())
.update();
- // 2. 鏇存柊es
+ // 2. mq寮傛鏇存柊es
Map<String, Object> fields = new HashMap<>(2);
fields.put("status", VideoStatusEnum.DISABLE.getValue());
- videoEsService.updateSomeField(EsSuffix.VIDEO_INDEX_NAME, form.getId(), fields);
+ VideoEsUpdateDTO dto = new VideoEsUpdateDTO();
+ dto.setId(form.getId());
+ dto.setFields(fields);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_UPDATE_SOME_FIELD.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(dto), RocketmqSendCallbackBuilder.commonCallback());
// TODO 灏嗕笅鏋跺師鍥犱互閫氱煡鐨勬柟寮忓憡鐭ョ敤鎴�
return Result.ok("涓嬫灦鎴愬姛");
@@ -430,6 +434,14 @@
.eq(Video::getId, id)
.set(Video::getStatus, VideoStatusEnum.DISABLE.getValue())
.update();
+ // 2. mq寮傛鏇存柊es
+ Map<String, Object> fields = new HashMap<>(2);
+ fields.put("status", VideoStatusEnum.DISABLE.getValue());
+ VideoEsUpdateDTO dto = new VideoEsUpdateDTO();
+ dto.setId(id);
+ dto.setFields(fields);
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_DOC_UPDATE_SOME_FIELD.name();
+ rocketMQTemplate.asyncSend(destination, JSON.toJSONString(dto), RocketmqSendCallbackBuilder.commonCallback());
return Result.ok("涓嬫灦鎴愬姛");
}
@@ -883,4 +895,12 @@
.update();
}
}
+
+ @Override
+ public Result recreateEsIndex() {
+ String destination = rocketmqCustomProperties.getVideoTopic() + ":" + VideoTagsEnum.ES_RECREATE.name();
+ // 娑堟伅浣撲笉鑳戒负绌猴紝闅忎究浼犱竴涓�1
+ rocketMQTemplate.asyncSend(destination, "1", RocketmqSendCallbackBuilder.commonCallback());
+ return Result.ok("宸叉垚鍔熷彂璧锋瀯寤鸿姹傦紝绋嶄綔绛夊緟鍚庝究浼氳嚜鍔ㄥ畬鎴�");
+ }
}
diff --git a/framework/src/main/java/cn/lili/rocketmq/tags/VideoTagsEnum.java b/framework/src/main/java/cn/lili/rocketmq/tags/VideoTagsEnum.java
index 03b5ea1..01738ca 100644
--- a/framework/src/main/java/cn/lili/rocketmq/tags/VideoTagsEnum.java
+++ b/framework/src/main/java/cn/lili/rocketmq/tags/VideoTagsEnum.java
@@ -12,6 +12,10 @@
* 鏀惰棌
*/
COLLECT("鏀惰棌"),
+ ES_RECREATE("閲嶅缓瑙嗛绱㈠紩"),
+ ES_DOC_ADD_OR_UPDATE("鏂板鎴栧叏閲忎慨鏀硅棰�"),
+ ES_DOC_UPDATE_SOME_FIELD("淇敼瑙嗛鏌愪簺瀛楁"),
+ ES_DOC_DEL("鍒犻櫎瑙嗛"),
;
diff --git a/framework/src/main/resources/mapper/lmk/VideoMapper.xml b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
index c6e1579..b220b13 100644
--- a/framework/src/main/resources/mapper/lmk/VideoMapper.xml
+++ b/framework/src/main/resources/mapper/lmk/VideoMapper.xml
@@ -605,8 +605,8 @@
lmk_video LV
LEFT JOIN li_member LM ON LV.author_id = LM.id
WHERE
- LV.delete_flag = 0 AND LV.status = '1'
- LIMIT #{start}, #{end}
+ LV.delete_flag = 0
+ LIMIT #{start}, #{pageSize}
</select>
</mapper>
diff --git a/manager-api/src/main/java/cn/lili/controller/lmk/VideoController.java b/manager-api/src/main/java/cn/lili/controller/lmk/VideoController.java
index 1202217..364f2cd 100644
--- a/manager-api/src/main/java/cn/lili/controller/lmk/VideoController.java
+++ b/manager-api/src/main/java/cn/lili/controller/lmk/VideoController.java
@@ -38,18 +38,6 @@
@Qualifier("videoEsServiceImpl")
private final EsService esService;
- @PostMapping
- @ApiOperation(value = "娣诲姞", notes = "娣诲姞")
- public Result add(@RequestBody @Validated(Add.class) WxVideoForm form) {
- return videoService.add(form);
- }
-
- @PutMapping
- @ApiOperation(value = "淇敼", notes = "淇敼")
- public Result update(@RequestBody @Validated(Update.class) WxVideoForm form) {
- return videoService.update(form);
- }
-
@DeleteMapping("/{id}")
@ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎")
public Result removeById(@PathVariable("id") String id) {
@@ -107,7 +95,6 @@
@PostMapping("/recreate/es/index")
@ApiOperation(value = "閲嶅缓es绱㈠紩", notes = "閲嶅缓es绱㈠紩")
public Result recreateEsIndex() {
- esService.recreateIndex(EsSuffix.VIDEO_INDEX_NAME, "/es/video.json");
- return Result.ok();
+ return videoService.recreateEsIndex();
}
}
--
Gitblit v1.8.0