|
@@ -1,24 +1,25 @@
|
|
|
package com.fs.admin.controller;
|
|
package com.fs.admin.controller;
|
|
|
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
|
|
|
|
+import com.fs.admin.service.IAdminVideoResourceService;
|
|
|
|
|
+import com.fs.admin.vo.AdminVideoResourceVO;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 总后台视频资源审计控制器
|
|
* 总后台视频资源审计控制器
|
|
|
- * 通过拦截器切库后直接查询当前租户 fs_user_course_video 数据
|
|
|
|
|
|
|
+ * 通过拦截器切库后查询当前租户 fs_user_course_video 数据
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/admin/videoResource")
|
|
@RequestMapping("/admin/videoResource")
|
|
|
public class AdminVideoResourceController extends BaseController {
|
|
public class AdminVideoResourceController extends BaseController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
- private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
|
+ private IAdminVideoResourceService adminVideoResourceService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询指定租户的视频资源列表(由 AdminTenantDataSourceInterceptor 切库)
|
|
* 查询指定租户的视频资源列表(由 AdminTenantDataSourceInterceptor 切库)
|
|
@@ -27,16 +28,7 @@ public class AdminVideoResourceController extends BaseController {
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(@RequestParam(required = false) Long tenantId,
|
|
public TableDataInfo list(@RequestParam(required = false) Long tenantId,
|
|
|
@RequestParam(required = false) String videoName) {
|
|
@RequestParam(required = false) String videoName) {
|
|
|
- String sql = "SELECT id, title as videoName, video_type as videoType, " +
|
|
|
|
|
- "play_url as playUrl, duration, status, create_time as createTime " +
|
|
|
|
|
- "FROM fs_user_course_video WHERE 1=1";
|
|
|
|
|
- StringBuilder sb = new StringBuilder(sql);
|
|
|
|
|
- if (videoName != null && !videoName.isEmpty()) {
|
|
|
|
|
- sb.append(" AND title LIKE '%").append(videoName.replace("'", "''")).append("%'");
|
|
|
|
|
- }
|
|
|
|
|
- sb.append(" ORDER BY create_time DESC");
|
|
|
|
|
-
|
|
|
|
|
- List<Map<String, Object>> list = jdbcTemplate.queryForList(sb.toString());
|
|
|
|
|
|
|
+ List<AdminVideoResourceVO> list = adminVideoResourceService.selectVideoResourceList(videoName);
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|