feat: support article demo videos and category counts

This commit is contained in:
王鹏
2026-08-17 15:50:17 +08:00
parent 2bf0a6db59
commit a1a806f266
8 changed files with 101 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.app;
import com.ruoyi.app.domain.AppBlogArticle;
import com.ruoyi.app.mapper.AppBlogArticleMapper;
import com.ruoyi.app.mapper.AppResourceMapper;
import com.ruoyi.app.service.ImageUrlService;
import com.ruoyi.app.service.IAppBlogArticleService;
import com.ruoyi.common.annotation.Log;
@@ -19,7 +20,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* 文章Controller
@@ -39,6 +42,9 @@ public class AppBlogArticleController extends BaseController {
@Resource
private AppBlogArticleMapper appBlogArticleMapper;
@Resource
private AppResourceMapper appResourceMapper;
@Resource
private ITtFileService fileService;
@@ -87,6 +93,19 @@ public class AppBlogArticleController extends BaseController {
return success(appBlogArticle);
}
/**
* 获取首页四个分类的可见内容数量
*/
@GetMapping(value = "/app/homeCategoryCounts")
public AjaxResult homeCategoryCounts() {
Map<String, Long> counts = new LinkedHashMap<>();
counts.put("highQuality", appBlogArticleMapper.countByArticleType(7L, 1L));
counts.put("resource", appResourceMapper.countByIsShow(1L));
counts.put("integral", appBlogArticleMapper.countByArticleType(4L, 1L));
counts.put("free", appBlogArticleMapper.countByArticleType(8L, 1L));
return success(counts);
}
/**
* 新增文章
*/