serv-控制器
This commit is contained in:
@@ -99,12 +99,17 @@ CREATE TABLE `tb_sys_permission` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
INSERT INTO `tb_sys_permission` (id,permission_id, name, code, description, creator, create_time) VALUES
|
||||
('0','perm_default', '默认权限', 'default', '默认权限', '1', now()),
|
||||
('1','perm_system_manage', '系统管理', 'system:manage', '系统管理权限', '1', now()),
|
||||
('2','perm_system_dept_manage', '系统部门查看', 'system:dept:manage', '系统部门查看权限', '1', now()),
|
||||
('3','perm_system_menu_manage', '系统菜单查看', 'system:menu:manage', '系统菜单查看权限', '1', now()),
|
||||
('4','perm_system_permission_manage', '系统权限查看', 'system:permission:manage', '系统权限查看权限', '1', now()),
|
||||
('5','perm_system_role_manage', '系统角色查看', 'system:role:manage', '系统角色查看权限', '1', now()),
|
||||
('6','perm_system_user_manage', '系统用户查看', 'system:user:manage', '系统用户查看权限', '1', now());
|
||||
('6','perm_system_user_manage', '系统用户查看', 'system:user:manage', '系统用户查看权限', '1', now()),
|
||||
('7','perm_news_manage', '新闻管理', 'news:manage', '新闻管理权限', '1', now()),
|
||||
('8','perm_study_manage', '学习管理', 'study:manage', '学习管理权限', '1', now()),
|
||||
('9','perm_ai_manage', 'AI管理', 'ai:manage', 'AI管理权限', '1', now()),
|
||||
('10','perm_usercenter_manage', '用户中心管理', 'usercenter:manage', '用户中心管理权限', '1', now());
|
||||
|
||||
-- 角色-权限关联
|
||||
DROP TABLE IF EXISTS `tb_sys_role_permission`;
|
||||
@@ -123,12 +128,18 @@ CREATE TABLE `tb_sys_role_permission` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
INSERT INTO `tb_sys_role_permission` (id, role_id, permission_id, creator, create_time) VALUES
|
||||
('0', 'admin', 'perm_default', '1', now()),
|
||||
('1', 'admin', 'perm_system_manage', '1', now()),
|
||||
('2', 'admin', 'perm_system_dept_manage', '1', now()),
|
||||
('3', 'admin', 'perm_system_menu_manage', '1', now()),
|
||||
('4', 'admin', 'perm_system_permission_manage', '1', now()),
|
||||
('5', 'admin', 'perm_system_role_manage', '1', now()),
|
||||
('6', 'admin', 'perm_system_user_manage', '1', now());
|
||||
('6', 'admin', 'perm_system_user_manage', '1', now()),
|
||||
('7', 'admin', 'perm_news_manage', '1', now()),
|
||||
('8', 'admin', 'perm_study_manage', '1', now()),
|
||||
('9', 'admin', 'perm_ai_manage', '1', now()),
|
||||
('10', 'admin', 'perm_usercenter_manage', '1', now()),
|
||||
('11', 'freedom', 'perm_default', '1', now());
|
||||
|
||||
-- 菜单表
|
||||
DROP TABLE IF EXISTS `tb_sys_menu`;
|
||||
@@ -142,6 +153,7 @@ CREATE TABLE `tb_sys_menu` (
|
||||
`icon` VARCHAR(100) DEFAULT NULL COMMENT '菜单图标',
|
||||
`order_num` INT(4) DEFAULT 0 COMMENT '菜单排序号',
|
||||
`type` INT(4) DEFAULT 0 COMMENT '菜单类型(0目录 1菜单 2按钮)',
|
||||
`layout` VARCHAR(100) DEFAULT 'BasicLayout' COMMENT '布局组件路径名称(如:BasicLayout、BlankLayout、NavigationLayout、PageLayout)',
|
||||
`creator` VARCHAR(50) DEFAULT NULL COMMENT '创建者',
|
||||
`updater` VARCHAR(50) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
@@ -154,13 +166,31 @@ CREATE TABLE `tb_sys_menu` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
|
||||
|
||||
-- Insert default menus
|
||||
INSERT INTO `tb_sys_menu` (id,menu_id, name, parent_id, url, component, icon, order_num, type, creator, create_time) VALUES
|
||||
('1','menu_system_manage', '系统管理', NULL, '', '', 'el-icon-setting', 1, 1, '1', now()),
|
||||
('2','menu_system_dept', '部门管理', 'menu_system_manage', '/manage/system/dept', 'manage/system/DeptManageView', 'el-icon-office-building', 2, 1, '1', now()),
|
||||
('3','menu_system_menu', '菜单管理', 'menu_system_manage', '/manage/system/menu', 'manage/system/MenuManageView', 'el-icon-menu', 2, 1, '1', now()),
|
||||
('4','menu_system_permission', '权限管理', 'menu_system_manage', '/manage/system/permission', 'manage/system/PermissionManageView', 'el-icon-key', 3, 1, '1', now()),
|
||||
('5','menu_system_role', '角色管理', 'menu_system_manage', '/manage/system/role', 'manage/system/RoleManageView', 'el-icon-user', 4, 1, '1', now()),
|
||||
('6','menu_system_user', '用户管理', 'menu_system_manage', '/manage/system/user', 'manage/system/UserManageView', 'el-icon-user', 5, 1, '1', now());
|
||||
INSERT INTO `tb_sys_menu` (id,menu_id, name, parent_id, url, component, icon, order_num, type, layout, creator, create_time) VALUES
|
||||
('1','menu_system_manage', '系统管理', NULL, '', '', 'el-icon-setting', 1, 1, '', '1', now()),
|
||||
('2','menu_system_dept', '部门管理', 'menu_system_manage', '/manage/system/dept', 'manage/system/DeptManageView', 'el-icon-office-building', 2, 1, 'NavigationLayout', '1', now()),
|
||||
('3','menu_system_menu', '菜单管理', 'menu_system_manage', '/manage/system/menu', 'manage/system/MenuManageView', 'el-icon-menu', 2, 1, 'NavigationLayout', '1', now()),
|
||||
('4','menu_system_permission', '权限管理', 'menu_system_manage', '/manage/system/permission', 'manage/system/PermissionManageView', 'el-icon-key', 3, 1, 'NavigationLayout', '1', now()),
|
||||
('5','menu_system_role', '角色管理', 'menu_system_manage', '/manage/system/role', 'manage/system/RoleManageView', 'el-icon-user', 4, 1, 'NavigationLayout', '1', now()),
|
||||
('6','menu_system_user', '用户管理', 'menu_system_manage', '/manage/system/user', 'manage/system/UserManageView', 'el-icon-user', 5, 1, 'NavigationLayout', '1', now());
|
||||
-- ('7','menu_news_manage', '新闻管理', NULL, '', '', 'el-icon-document', 2, 1, '', '1', now()),
|
||||
-- ('8','menu_news_resource', '资源管理', 'menu_news_manage', '/manage/news/resource', 'manage/news/ResourceManageView', 'el-icon-folder', 1, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('9','menu_news_category', '分类管理', 'menu_news_manage', '/manage/news/category', 'manage/news/CategoryManageView', 'el-icon-menu', 2, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('10','menu_news_tag', '标签管理', 'menu_news_manage', '/manage/news/tag', 'manage/news/TagManageView', 'el-icon-price-tag', 3, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('11','menu_news_banner', '横幅管理', 'menu_news_manage', '/manage/news/banner', 'manage/news/BannerManageView', 'el-icon-picture', 4, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('12','menu_study_manage', '学习管理', NULL, '', '', 'el-icon-reading', 3, 1, '', '1', now()),
|
||||
-- ('13','menu_study_course', '课程管理', 'menu_study_manage', '/manage/study/course', 'manage/study/CourseManageView', 'el-icon-video-play', 1, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('14','menu_study_task', '任务管理', 'menu_study_manage', '/manage/study/task', 'manage/study/TaskManageView', 'el-icon-s-order', 2, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('15','menu_study_record', '学习记录', 'menu_study_manage', '/manage/study/record', 'manage/study/RecordManageView', 'el-icon-document', 3, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('16','menu_ai_manage', 'AI管理', NULL, '', '', 'el-icon-cpu', 4, 1, '', '1', now()),
|
||||
-- ('17','menu_ai_agent', 'AI代理', 'menu_ai_manage', '/manage/ai/agent', 'manage/ai/AgentManageView', 'el-icon-robot', 1, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('18','menu_ai_conversation', '对话管理', 'menu_ai_manage', '/manage/ai/conversation', 'manage/ai/ConversationManageView', 'el-icon-chat-line-round', 2, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('19','menu_ai_knowledge', '知识库', 'menu_ai_manage', '/manage/ai/knowledge', 'manage/ai/KnowledgeManageView', 'el-icon-collection', 3, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('20','menu_usercenter_manage', '用户中心', NULL, '', '', 'el-icon-user', 5, 1, '', '1', now()),
|
||||
-- ('21','menu_usercenter_points', '积分管理', 'menu_usercenter_manage', '/manage/usercenter/points', 'manage/usercenter/PointsManageView', 'el-icon-coin', 1, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('22','menu_usercenter_achievement', '成就管理', 'menu_usercenter_manage', '/manage/usercenter/achievement', 'manage/usercenter/AchievementManageView', 'el-icon-trophy', 2, 1, 'NavigationLayout', '1', now()),
|
||||
-- ('23','menu_usercenter_collection', '收藏管理', 'menu_usercenter_manage', '/manage/usercenter/collection', 'manage/usercenter/CollectionManageView', 'el-icon-star-on', 3, 1, 'NavigationLayout', '1', now());
|
||||
|
||||
DROP TABLE IF EXISTS `tb_sys_menu_permission`;
|
||||
CREATE TABLE `tb_sys_menu_permission` (
|
||||
`id` VARCHAR(50) NOT NULL COMMENT '菜单权限ID',
|
||||
|
||||
@@ -3,8 +3,6 @@ package org.xyzh.api.usercenter.collection;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserCollection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 用户收藏服务接口
|
||||
* @filename UserCollectionService.java
|
||||
@@ -65,4 +63,16 @@ public interface UserCollectionService {
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<TbUserCollection> getCollectionDetail(String userID, Integer collectionType, String collectionID);
|
||||
|
||||
/**
|
||||
* @description 获取收藏数量
|
||||
* @param userID 用户ID
|
||||
* @param collectionType 收藏类型
|
||||
* @param collectionID 收藏对象ID
|
||||
* @param resourceID 资源ID
|
||||
* @return ResultDomain<Integer> 收藏数量
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
ResultDomain<Integer> getCollectionCount(String userID, Integer collectionType, String collectionID);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,13 @@ public class TbSysMenu extends BaseDTO {
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* @description 布局组件路径名称(如:BasicLayout、BlankLayout、NavigationLayout、PageLayout)
|
||||
* @author yslg
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
private String layout;
|
||||
|
||||
/**
|
||||
* @description 创建人
|
||||
* @author yslg
|
||||
@@ -159,6 +166,14 @@ public class TbSysMenu extends BaseDTO {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getLayout() {
|
||||
return layout;
|
||||
}
|
||||
|
||||
public void setLayout(String layout) {
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator;
|
||||
}
|
||||
@@ -188,6 +203,7 @@ public class TbSysMenu extends BaseDTO {
|
||||
", icon='" + icon + '\'' +
|
||||
", orderNum=" + orderNum +
|
||||
", type=" + type +
|
||||
", layout='" + layout + '\'' +
|
||||
", creator='" + creator + '\'' +
|
||||
", updater='" + updater + '\'' +
|
||||
", createTime=" + getCreateTime() +
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.banner.BannerService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbBanner;
|
||||
|
||||
/**
|
||||
* @description 横幅控制器
|
||||
* @filename BannerController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/banner")
|
||||
public class BannerController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(BannerController.class);
|
||||
|
||||
@Autowired
|
||||
private BannerService bannerService;
|
||||
|
||||
/**
|
||||
* 获取横幅列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbBanner> getBannerList(TbBanner filter) {
|
||||
return null;
|
||||
// return bannerService.getBannerList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取横幅详情
|
||||
*/
|
||||
@GetMapping("/{bannerID}")
|
||||
public ResultDomain<TbBanner> getBannerById(@PathVariable String bannerID) {
|
||||
return bannerService.getBannerById(bannerID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建横幅
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbBanner> createBanner(@RequestBody TbBanner banner) {
|
||||
return bannerService.createBanner(banner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新横幅
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbBanner> updateBanner(@RequestBody TbBanner banner) {
|
||||
return bannerService.updateBanner(banner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除横幅
|
||||
*/
|
||||
@DeleteMapping("/{bannerID}")
|
||||
public ResultDomain<Boolean> deleteBanner(@PathVariable String bannerID) {
|
||||
return bannerService.deleteBanner(bannerID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新横幅状态
|
||||
*/
|
||||
@PutMapping("/{bannerID}/status")
|
||||
public ResultDomain<TbBanner> updateBannerStatus(
|
||||
@PathVariable String bannerID,
|
||||
@RequestParam Integer status) {
|
||||
return bannerService.updateBannerStatus(bannerID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新横幅排序
|
||||
*/
|
||||
@PutMapping("/{bannerID}/order")
|
||||
public ResultDomain<TbBanner> updateBannerOrder(
|
||||
@PathVariable String bannerID,
|
||||
@RequestParam Integer orderNum) {
|
||||
return bannerService.updateBannerOrder(bannerID, orderNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃横幅
|
||||
*/
|
||||
@GetMapping("/active")
|
||||
public ResultDomain<TbBanner> getActiveBanners(@RequestParam(required = false) Integer limit) {
|
||||
return bannerService.getActiveBanners(limit);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.collection.DataCollectionService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbDataCollectionConfig;
|
||||
import org.xyzh.common.dto.resource.TbDataCollectionLog;
|
||||
|
||||
/**
|
||||
* @description 数据采集控制器
|
||||
* @filename DataCollectionController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/collection")
|
||||
public class DataCollectionController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DataCollectionController.class);
|
||||
|
||||
@Autowired
|
||||
private DataCollectionService dataCollectionService;
|
||||
|
||||
/**
|
||||
* 获取配置列表
|
||||
*/
|
||||
@GetMapping("/config/list")
|
||||
public ResultDomain<TbDataCollectionConfig> getConfigList(TbDataCollectionConfig filter) {
|
||||
return null;
|
||||
// return dataCollectionService.getConfigList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取配置详情
|
||||
*/
|
||||
@GetMapping("/config/{configID}")
|
||||
public ResultDomain<TbDataCollectionConfig> getConfigById(@PathVariable String configID) {
|
||||
return dataCollectionService.getConfigById(configID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建配置
|
||||
*/
|
||||
@PostMapping("/config/create")
|
||||
public ResultDomain<TbDataCollectionConfig> createConfig(@RequestBody TbDataCollectionConfig config) {
|
||||
return dataCollectionService.createConfig(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新配置
|
||||
*/
|
||||
@PutMapping("/config/update")
|
||||
public ResultDomain<TbDataCollectionConfig> updateConfig(@RequestBody TbDataCollectionConfig config) {
|
||||
return dataCollectionService.updateConfig(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除配置
|
||||
*/
|
||||
@DeleteMapping("/config/{configID}")
|
||||
public ResultDomain<Boolean> deleteConfig(@PathVariable String configID) {
|
||||
return dataCollectionService.deleteConfig(configID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新配置状态
|
||||
*/
|
||||
@PutMapping("/config/{configID}/status")
|
||||
public ResultDomain<TbDataCollectionConfig> updateConfigStatus(
|
||||
@PathVariable String configID,
|
||||
@RequestParam Integer status) {
|
||||
return dataCollectionService.updateConfigStatus(configID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日志列表
|
||||
*/
|
||||
@GetMapping("/log/list")
|
||||
public ResultDomain<TbDataCollectionLog> getLogList(TbDataCollectionLog filter) {
|
||||
return null;
|
||||
// return dataCollectionService.getLogList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取日志详情
|
||||
*/
|
||||
@GetMapping("/log/{logID}")
|
||||
public ResultDomain<TbDataCollectionLog> getLogById(@PathVariable String logID) {
|
||||
return dataCollectionService.getLogById(logID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建日志
|
||||
*/
|
||||
@PostMapping("/log/create")
|
||||
public ResultDomain<TbDataCollectionLog> createLog(@RequestBody TbDataCollectionLog log) {
|
||||
return dataCollectionService.createLog(log);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
*/
|
||||
@DeleteMapping("/log/{logID}")
|
||||
public ResultDomain<Boolean> deleteLog(@PathVariable String logID) {
|
||||
return null;
|
||||
// return dataCollectionService.deleteLog(logID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃配置
|
||||
*/
|
||||
@GetMapping("/active")
|
||||
public ResultDomain<TbDataCollectionLog> getActiveConfigs() {
|
||||
return null;
|
||||
// return dataCollectionService.getActiveConfigs();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResource;
|
||||
import org.xyzh.common.dto.resource.TbBanner;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 首页控制器
|
||||
* @filename HomePageController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/homepage")
|
||||
public class HomePageController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(HomePageController.class);
|
||||
|
||||
// ==================== 轮播组件管理 ====================
|
||||
|
||||
/**
|
||||
* 获取轮播组件数据
|
||||
*/
|
||||
@GetMapping("/banner/list")
|
||||
public ResultDomain<TbBanner> getBannerList() {
|
||||
// TODO: 实现获取轮播组件数据(自动轮播核心新闻,支持手动切换)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击轮播跳转新闻详情
|
||||
*/
|
||||
@GetMapping("/banner/click/{bannerID}")
|
||||
public ResultDomain<TbResource> getBannerNewsDetail(@PathVariable String bannerID) {
|
||||
// TODO: 实现点击跳转新闻详情
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃轮播列表
|
||||
*/
|
||||
@GetMapping("/banner/active")
|
||||
public ResultDomain<TbBanner> getActiveBanners() {
|
||||
// TODO: 实现获取活跃轮播列表
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== TOP资源推荐 ====================
|
||||
|
||||
/**
|
||||
* 获取TOP资源推荐列表
|
||||
*/
|
||||
@GetMapping("/recommend/top-list")
|
||||
public ResultDomain<TbResource> getTopRecommendList() {
|
||||
// TODO: 实现获取TOP资源推荐列表(按浏览数据展示高热度新闻)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台调控展示顺序
|
||||
*/
|
||||
@PutMapping("/recommend/order")
|
||||
public ResultDomain<Boolean> updateRecommendOrder(@RequestBody Map<String, Object> orderData) {
|
||||
// TODO: 实现后台调控展示顺序与内容
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取高热度新闻
|
||||
*/
|
||||
@GetMapping("/recommend/hot-news")
|
||||
public ResultDomain<TbResource> getHotNews(@RequestParam(required = false) Integer limit) {
|
||||
// TODO: 实现获取高热度新闻
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 思政新闻概览 ====================
|
||||
|
||||
/**
|
||||
* 获取思政新闻概览
|
||||
*/
|
||||
@GetMapping("/news/overview")
|
||||
public ResultDomain<TbResource> getNewsOverview(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取思政新闻概览(以卡片形式展示新闻标题、发布时间、简介)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击跳转二级详情页
|
||||
*/
|
||||
@GetMapping("/news/detail/{newsID}")
|
||||
public ResultDomain<TbResource> getNewsDetail(@PathVariable String newsID) {
|
||||
// TODO: 实现点击跳转二级详情页
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最新思政新闻
|
||||
*/
|
||||
@GetMapping("/news/latest")
|
||||
public ResultDomain<TbResource> getLatestNews(@RequestParam(required = false) Integer limit) {
|
||||
// TODO: 实现获取最新思政新闻
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 顶部菜单栏 ====================
|
||||
|
||||
/**
|
||||
* 获取顶部菜单栏配置
|
||||
*/
|
||||
@GetMapping("/menu/top-menu")
|
||||
public ResultDomain<Map<String, Object>> getTopMenuConfig() {
|
||||
// TODO: 实现获取顶部菜单栏(包含首页、资源中心、学习计划、专题活动、红色常信)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 后台修改菜单名称
|
||||
*/
|
||||
@PutMapping("/menu/update-name")
|
||||
public ResultDomain<Boolean> updateMenuName(@RequestBody Map<String, Object> menuData) {
|
||||
// TODO: 实现支持后台修改菜单名称
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单项列表
|
||||
*/
|
||||
@GetMapping("/menu/list")
|
||||
public ResultDomain<Map<String, Object>> getMenuList() {
|
||||
// TODO: 实现获取菜单项列表
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 模糊检索 ====================
|
||||
|
||||
/**
|
||||
* 模糊检索资源
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public ResultDomain<TbResource> searchResources(@RequestParam String keyword) {
|
||||
// TODO: 实现模糊检索(输入关键词实时匹配资源(新闻、课程))
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时搜索建议
|
||||
*/
|
||||
@GetMapping("/search/suggestions")
|
||||
public ResultDomain<Map<String, Object>> getSearchSuggestions(@RequestParam String keyword) {
|
||||
// TODO: 实现实时搜索建议
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门搜索词
|
||||
*/
|
||||
@GetMapping("/search/hot-keywords")
|
||||
public ResultDomain<Map<String, Object>> getHotKeywords() {
|
||||
// TODO: 实现获取热门搜索词
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索新闻
|
||||
*/
|
||||
@GetMapping("/search/news")
|
||||
public ResultDomain<TbResource> searchNews(@RequestParam String keyword) {
|
||||
// TODO: 实现搜索新闻
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索课程
|
||||
*/
|
||||
@GetMapping("/search/courses")
|
||||
public ResultDomain<Map<String, Object>> searchCourses(@RequestParam String keyword) {
|
||||
// TODO: 实现搜索课程
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 首页统计数据 ====================
|
||||
|
||||
/**
|
||||
* 获取首页统计数据
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public ResultDomain<Map<String, Object>> getHomePageStatistics() {
|
||||
// TODO: 实现获取首页统计数据
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日访问量
|
||||
*/
|
||||
@GetMapping("/statistics/today-visits")
|
||||
public ResultDomain<Map<String, Object>> getTodayVisits() {
|
||||
// TODO: 实现获取今日访问量
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源总数
|
||||
*/
|
||||
@GetMapping("/statistics/total-resources")
|
||||
public ResultDomain<Map<String, Object>> getTotalResources() {
|
||||
// TODO: 实现获取资源总数
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.category.ResourceCategoryService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResourceCategory;
|
||||
|
||||
/**
|
||||
* @description 资源分类控制器
|
||||
* @filename ResourceCategoryController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/category")
|
||||
public class ResourceCategoryController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceCategoryController.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceCategoryService resourceCategoryService;
|
||||
|
||||
/**
|
||||
* 获取分类列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbResourceCategory> getCategoryList(TbResourceCategory filter) {
|
||||
return null;
|
||||
// return resourceCategoryService.getCategoryList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取分类详情
|
||||
*/
|
||||
@GetMapping("/{categoryID}")
|
||||
public ResultDomain<TbResourceCategory> getCategoryById(@PathVariable String categoryID) {
|
||||
return resourceCategoryService.getCategoryById(categoryID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建分类
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbResourceCategory> createCategory(@RequestBody TbResourceCategory category) {
|
||||
return resourceCategoryService.createCategory(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分类
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbResourceCategory> updateCategory(@RequestBody TbResourceCategory category) {
|
||||
return resourceCategoryService.updateCategory(category);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分类
|
||||
*/
|
||||
@DeleteMapping("/{categoryID}")
|
||||
public ResultDomain<Boolean> deleteCategory(@PathVariable String categoryID) {
|
||||
return resourceCategoryService.deleteCategory(categoryID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新分类状态
|
||||
*/
|
||||
@PutMapping("/{categoryID}/status")
|
||||
public ResultDomain<TbResourceCategory> updateCategoryStatus(@PathVariable String categoryID, @RequestParam Integer status) {
|
||||
return null;
|
||||
// return resourceCategoryService.updateCategoryStatus(categoryID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类树
|
||||
*/
|
||||
@GetMapping("/tree")
|
||||
public ResultDomain<TbResourceCategory> getCategoryTree() {
|
||||
return resourceCategoryService.getCategoryTree();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子分类
|
||||
*/
|
||||
@GetMapping("/{parentID}/children")
|
||||
public ResultDomain<TbResourceCategory> getChildCategories(@PathVariable String parentID) {
|
||||
return null;
|
||||
// return resourceCategoryService.getChildCategories(parentID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResource;
|
||||
import org.xyzh.common.dto.resource.TbResourceCategory;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 资源中心控制器
|
||||
* @filename ResourceCenterController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/resource-center")
|
||||
public class ResourceCenterController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceCenterController.class);
|
||||
|
||||
// ==================== 专项分栏管理 ====================
|
||||
|
||||
/**
|
||||
* 获取专项分栏列表
|
||||
*/
|
||||
@GetMapping("/categories")
|
||||
public ResultDomain<TbResourceCategory> getSpecialCategories() {
|
||||
// TODO: 实现获取专项分栏(包含党史学习、领导讲话、政策解读、红色经典、专题报告、思政案例6个分栏)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取党史学习资源
|
||||
*/
|
||||
@GetMapping("/category/party-history")
|
||||
public ResultDomain<TbResource> getPartyHistoryResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取党史学习资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取领导讲话资源
|
||||
*/
|
||||
@GetMapping("/category/leadership-speech")
|
||||
public ResultDomain<TbResource> getLeadershipSpeechResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取领导讲话资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取政策解读资源
|
||||
*/
|
||||
@GetMapping("/category/policy-interpretation")
|
||||
public ResultDomain<TbResource> getPolicyInterpretationResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取政策解读资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取红色经典资源
|
||||
*/
|
||||
@GetMapping("/category/red-classics")
|
||||
public ResultDomain<TbResource> getRedClassicsResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取红色经典资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取专题报告资源
|
||||
*/
|
||||
@GetMapping("/category/special-reports")
|
||||
public ResultDomain<TbResource> getSpecialReportsResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取专题报告资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取思政案例资源
|
||||
*/
|
||||
@GetMapping("/category/ideological-cases")
|
||||
public ResultDomain<TbResource> getIdeologicalCasesResources(
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取思政案例资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类ID获取资源
|
||||
*/
|
||||
@GetMapping("/category/{categoryID}/resources")
|
||||
public ResultDomain<TbResource> getResourcesByCategory(
|
||||
@PathVariable String categoryID,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现根据分类ID获取资源
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 资源检索管理 ====================
|
||||
|
||||
/**
|
||||
* 资源模糊关键词检索
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public ResultDomain<TbResource> searchResources(
|
||||
@RequestParam String keyword,
|
||||
@RequestParam(required = false) String categoryID,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现支持模糊关键词检索,快速定位资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 高级搜索
|
||||
*/
|
||||
@PostMapping("/search/advanced")
|
||||
public ResultDomain<TbResource> advancedSearch(@RequestBody Map<String, Object> searchParams) {
|
||||
// TODO: 实现高级搜索功能
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索建议
|
||||
*/
|
||||
@GetMapping("/search/suggestions")
|
||||
public ResultDomain<Map<String, Object>> getSearchSuggestions(@RequestParam String keyword) {
|
||||
// TODO: 实现搜索建议
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索历史
|
||||
*/
|
||||
@GetMapping("/search/history")
|
||||
public ResultDomain<Map<String, Object>> getSearchHistory(@RequestParam String userID) {
|
||||
// TODO: 实现搜索历史
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除搜索历史
|
||||
*/
|
||||
@DeleteMapping("/search/history/clear")
|
||||
public ResultDomain<Boolean> clearSearchHistory(@RequestParam String userID) {
|
||||
// TODO: 实现清除搜索历史
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 资源详情管理 ====================
|
||||
|
||||
/**
|
||||
* 获取资源详情
|
||||
*/
|
||||
@GetMapping("/resource/{resourceID}")
|
||||
public ResultDomain<TbResource> getResourceDetail(@PathVariable String resourceID) {
|
||||
// TODO: 实现展示资源完整内容(文字、图片)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收藏资源
|
||||
*/
|
||||
@PostMapping("/resource/{resourceID}/collect")
|
||||
public ResultDomain<Boolean> collectResource(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam String userID) {
|
||||
// TODO: 实现支持收藏
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏资源
|
||||
*/
|
||||
@DeleteMapping("/resource/{resourceID}/collect")
|
||||
public ResultDomain<Boolean> uncollectResource(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam String userID) {
|
||||
// TODO: 实现取消收藏
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查资源收藏状态
|
||||
*/
|
||||
@GetMapping("/resource/{resourceID}/collect-status")
|
||||
public ResultDomain<Boolean> getCollectStatus(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam String userID) {
|
||||
// TODO: 实现检查资源收藏状态
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户收藏的资源列表
|
||||
*/
|
||||
@GetMapping("/user/{userID}/collections")
|
||||
public ResultDomain<TbResource> getUserCollections(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现获取用户收藏的资源列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加资源浏览次数
|
||||
*/
|
||||
@PostMapping("/resource/{resourceID}/view")
|
||||
public ResultDomain<Boolean> incrementResourceView(@PathVariable String resourceID) {
|
||||
// TODO: 实现增加资源浏览次数
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源统计信息
|
||||
*/
|
||||
@GetMapping("/resource/{resourceID}/statistics")
|
||||
public ResultDomain<Map<String, Object>> getResourceStatistics(@PathVariable String resourceID) {
|
||||
// TODO: 实现获取资源统计信息
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 资源分类管理 ====================
|
||||
|
||||
/**
|
||||
* 获取所有资源分类
|
||||
*/
|
||||
@GetMapping("/categories/all")
|
||||
public ResultDomain<TbResourceCategory> getAllCategories() {
|
||||
// TODO: 实现获取所有资源分类
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类树形结构
|
||||
*/
|
||||
@GetMapping("/categories/tree")
|
||||
public ResultDomain<Map<String, Object>> getCategoryTree() {
|
||||
// TODO: 实现获取分类树形结构
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分类统计信息
|
||||
*/
|
||||
@GetMapping("/categories/statistics")
|
||||
public ResultDomain<Map<String, Object>> getCategoryStatistics() {
|
||||
// TODO: 实现获取分类统计信息
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.resource.ResourceService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResource;
|
||||
|
||||
/**
|
||||
* @description 资源控制器
|
||||
* @filename ResourceController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/resource")
|
||||
public class ResourceController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceController.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
|
||||
/**
|
||||
* 获取资源列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbResource> getResourceList(TbResource filter) {
|
||||
return resourceService.getResourceList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取资源详情
|
||||
*/
|
||||
@GetMapping("/{resourceID}")
|
||||
public ResultDomain<TbResource> getResourceById(@PathVariable String resourceID) {
|
||||
return resourceService.getResourceById(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建资源
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbResource> createResource(@RequestBody TbResource resource) {
|
||||
return resourceService.createResource(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资源
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbResource> updateResource(@RequestBody TbResource resource) {
|
||||
return resourceService.updateResource(resource);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资源
|
||||
*/
|
||||
@DeleteMapping("/{resourceID}")
|
||||
public ResultDomain<Boolean> deleteResource(@PathVariable String resourceID) {
|
||||
return resourceService.deleteResource(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资源状态
|
||||
*/
|
||||
@PutMapping("/{resourceID}/status")
|
||||
public ResultDomain<TbResource> updateResourceStatus(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam Integer status) {
|
||||
return resourceService.updateResourceStatus(resourceID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布资源
|
||||
*/
|
||||
@PostMapping("/{resourceID}/publish")
|
||||
public ResultDomain<TbResource> publishResource(@PathVariable String resourceID) {
|
||||
return resourceService.publishResource(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下架资源
|
||||
*/
|
||||
@PostMapping("/{resourceID}/unpublish")
|
||||
public ResultDomain<TbResource> unpublishResource(@PathVariable String resourceID) {
|
||||
return resourceService.unpublishResource(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加浏览次数
|
||||
*/
|
||||
@PostMapping("/{resourceID}/view")
|
||||
public ResultDomain<TbResource> incrementViewCount(@PathVariable String resourceID) {
|
||||
return resourceService.incrementViewCount(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加点赞次数
|
||||
*/
|
||||
@PostMapping("/{resourceID}/like")
|
||||
public ResultDomain<TbResource> incrementLikeCount(@PathVariable String resourceID) {
|
||||
return resourceService.incrementLikeCount(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加收藏次数
|
||||
*/
|
||||
@PostMapping("/{resourceID}/collect")
|
||||
public ResultDomain<TbResource> incrementCollectCount(@PathVariable String resourceID) {
|
||||
return resourceService.incrementCollectCount(resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置资源推荐
|
||||
*/
|
||||
@PutMapping("/{resourceID}/recommend")
|
||||
public ResultDomain<TbResource> setResourceRecommend(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam Boolean isRecommend) {
|
||||
return resourceService.setResourceRecommend(resourceID, isRecommend);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置资源轮播
|
||||
*/
|
||||
@PutMapping("/{resourceID}/banner")
|
||||
public ResultDomain<TbResource> setResourceBanner(
|
||||
@PathVariable String resourceID,
|
||||
@RequestParam Boolean isBanner) {
|
||||
return resourceService.setResourceBanner(resourceID, isBanner);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取推荐资源列表
|
||||
*/
|
||||
@GetMapping("/recommend")
|
||||
public ResultDomain<TbResource> getRecommendResources(@RequestParam(required = false) Integer limit) {
|
||||
return resourceService.getRecommendResources(limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播资源列表
|
||||
*/
|
||||
@GetMapping("/banner")
|
||||
public ResultDomain<TbResource> getBannerResources(@RequestParam(required = false) Integer limit) {
|
||||
return resourceService.getBannerResources(limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索资源
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public ResultDomain<TbResource> searchResources(
|
||||
@RequestParam String keyword,
|
||||
@RequestParam(required = false) String categoryID,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
return resourceService.searchResources(keyword, categoryID, status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResource;
|
||||
import org.xyzh.common.dto.resource.TbDataCollectionConfig;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 资源管理控制器
|
||||
* @filename ResourceManagementController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/management")
|
||||
public class ResourceManagementController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceManagementController.class);
|
||||
|
||||
// ==================== 数据采集管理 ====================
|
||||
|
||||
/**
|
||||
* 配置采集来源
|
||||
*/
|
||||
@PostMapping("/collection/config-source")
|
||||
public ResultDomain<TbDataCollectionConfig> configCollectionSource(@RequestBody Map<String, Object> configData) {
|
||||
// TODO: 实现配置采集来源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置采集频率
|
||||
*/
|
||||
@PutMapping("/collection/frequency")
|
||||
public ResultDomain<Boolean> setCollectionFrequency(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现设置采集频率(天/周)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动触发采集
|
||||
*/
|
||||
@PostMapping("/collection/manual-trigger")
|
||||
public ResultDomain<Boolean> manualTriggerCollection(@RequestParam String configID) {
|
||||
// TODO: 实现手动触发采集
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采集配置列表
|
||||
*/
|
||||
@GetMapping("/collection/config-list")
|
||||
public ResultDomain<TbDataCollectionConfig> getCollectionConfigList() {
|
||||
// TODO: 实现获取采集配置列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新采集配置
|
||||
*/
|
||||
@PutMapping("/collection/config-update")
|
||||
public ResultDomain<TbDataCollectionConfig> updateCollectionConfig(@RequestBody TbDataCollectionConfig config) {
|
||||
// TODO: 实现更新采集配置
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除采集配置
|
||||
*/
|
||||
@DeleteMapping("/collection/config/{configID}")
|
||||
public ResultDomain<Boolean> deleteCollectionConfig(@PathVariable String configID) {
|
||||
// TODO: 实现删除采集配置
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 文章编辑管理 ====================
|
||||
|
||||
/**
|
||||
* 手动新建文章
|
||||
*/
|
||||
@PostMapping("/article/create")
|
||||
public ResultDomain<TbResource> createArticle(@RequestBody Map<String, Object> articleData) {
|
||||
// TODO: 实现手动新建文章(富文本编辑器,插入图片/链接)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑文章内容
|
||||
*/
|
||||
@PutMapping("/article/edit")
|
||||
public ResultDomain<TbResource> editArticle(@RequestBody TbResource article) {
|
||||
// TODO: 实现编辑文章内容
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文章
|
||||
*/
|
||||
@DeleteMapping("/article/{articleID}")
|
||||
public ResultDomain<Boolean> deleteArticle(@PathVariable String articleID) {
|
||||
// TODO: 实现删除文章
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文章状态
|
||||
*/
|
||||
@PutMapping("/article/status")
|
||||
public ResultDomain<Boolean> setArticleStatus(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现设置文章状态(草稿/已发布)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文章图片
|
||||
*/
|
||||
@PostMapping("/article/upload-image")
|
||||
public ResultDomain<String> uploadArticleImage(@RequestParam("file") String file) {
|
||||
// TODO: 实现上传文章图片
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入文章链接
|
||||
*/
|
||||
@PutMapping("/article/insert-link")
|
||||
public ResultDomain<Boolean> insertArticleLink(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现插入文章链接
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章编辑历史
|
||||
*/
|
||||
@GetMapping("/article/edit-history/{articleID}")
|
||||
public ResultDomain<Map<String, Object>> getArticleEditHistory(@PathVariable String articleID) {
|
||||
// TODO: 实现获取文章编辑历史
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 数据记录管理 ====================
|
||||
|
||||
/**
|
||||
* 记录数据采集信息
|
||||
*/
|
||||
@PostMapping("/record/collection")
|
||||
public ResultDomain<Boolean> recordCollectionData(@RequestBody Map<String, Object> recordData) {
|
||||
// TODO: 实现记录数据采集时间、采集数量、采集状态
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 记录文章发布信息
|
||||
*/
|
||||
@PostMapping("/record/publish")
|
||||
public ResultDomain<Boolean> recordPublishData(@RequestBody Map<String, Object> publishData) {
|
||||
// TODO: 实现记录文章发布时间、发布人、修改记录
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取采集记录列表
|
||||
*/
|
||||
@GetMapping("/record/collection-list")
|
||||
public ResultDomain<Map<String, Object>> getCollectionRecordList(
|
||||
@RequestParam(required = false) Date startDate,
|
||||
@RequestParam(required = false) Date endDate) {
|
||||
// TODO: 实现获取采集记录列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布记录列表
|
||||
*/
|
||||
@GetMapping("/record/publish-list")
|
||||
public ResultDomain<Map<String, Object>> getPublishRecordList(
|
||||
@RequestParam(required = false) String publisher,
|
||||
@RequestParam(required = false) Date startDate,
|
||||
@RequestParam(required = false) Date endDate) {
|
||||
// TODO: 实现获取发布记录列表
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 自动发布管理 ====================
|
||||
|
||||
/**
|
||||
* 配置文章自动发布时间
|
||||
*/
|
||||
@PutMapping("/auto-publish/schedule")
|
||||
public ResultDomain<Boolean> scheduleAutoPublish(@RequestBody Map<String, Object> scheduleData) {
|
||||
// TODO: 实现配置文章自动发布时间
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置发布前核验规则
|
||||
*/
|
||||
@PutMapping("/auto-publish/verification")
|
||||
public ResultDomain<Boolean> setVerificationRules(@RequestBody Map<String, Object> rules) {
|
||||
// TODO: 实现设置发布前核验规则(如内容审核)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置通知方式
|
||||
*/
|
||||
@PutMapping("/auto-publish/notification")
|
||||
public ResultDomain<Boolean> configNotification(@RequestBody Map<String, Object> notificationConfig) {
|
||||
// TODO: 实现设置通知方式(邮件/站内信)、提醒格式
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启/关闭自动发布
|
||||
*/
|
||||
@PutMapping("/auto-publish/toggle")
|
||||
public ResultDomain<Boolean> toggleAutoPublish(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现支持关闭自动发布
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自动发布配置
|
||||
*/
|
||||
@GetMapping("/auto-publish/config")
|
||||
public ResultDomain<Map<String, Object>> getAutoPublishConfig() {
|
||||
// TODO: 实现获取自动发布配置
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取自动发布任务列表
|
||||
*/
|
||||
@GetMapping("/auto-publish/task-list")
|
||||
public ResultDomain<Map<String, Object>> getAutoPublishTaskList() {
|
||||
// TODO: 实现获取自动发布任务列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动执行自动发布任务
|
||||
*/
|
||||
@PostMapping("/auto-publish/execute")
|
||||
public ResultDomain<Boolean> executeAutoPublishTask(@RequestParam String taskID) {
|
||||
// TODO: 实现手动执行自动发布任务
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.recommend.ResourceRecommendService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResourceRecommend;
|
||||
|
||||
/**
|
||||
* @description 资源推荐控制器
|
||||
* @filename ResourceRecommendController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/recommend")
|
||||
public class ResourceRecommendController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceRecommendController.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceRecommendService resourceRecommendService;
|
||||
|
||||
/**
|
||||
* 获取推荐列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbResourceRecommend> getRecommendList(TbResourceRecommend filter) {
|
||||
return null;
|
||||
// return resourceRecommendService.getRecommendList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取推荐详情
|
||||
*/
|
||||
@GetMapping("/{recommendID}")
|
||||
public ResultDomain<TbResourceRecommend> getRecommendById(@PathVariable String recommendID) {
|
||||
return null;
|
||||
// return resourceRecommendService.getRecommendById(recommendID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建推荐
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbResourceRecommend> createRecommend(@RequestBody TbResourceRecommend recommend) {
|
||||
return null;
|
||||
// return resourceRecommendService.createRecommend(recommend);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推荐
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbResourceRecommend> updateRecommend(@RequestBody TbResourceRecommend recommend) {
|
||||
return null;
|
||||
// return resourceRecommendService.updateRecommend(recommend);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除推荐
|
||||
*/
|
||||
@DeleteMapping("/{recommendID}")
|
||||
public ResultDomain<Boolean> deleteRecommend(@PathVariable String recommendID) {
|
||||
return null;
|
||||
// return resourceRecommendService.deleteRecommend(recommendID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推荐状态
|
||||
*/
|
||||
@PutMapping("/{recommendID}/status")
|
||||
public ResultDomain<TbResourceRecommend> updateRecommendStatus(@PathVariable String recommendID, @RequestParam Integer status) {
|
||||
return null;
|
||||
// return resourceRecommendService.updateRecommendStatus(recommendID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新推荐排序
|
||||
*/
|
||||
@PutMapping("/{recommendID}/order")
|
||||
public ResultDomain<TbResourceRecommend> updateRecommendOrder(@PathVariable String recommendID, @RequestParam Integer orderNum) {
|
||||
return resourceRecommendService.updateRecommendOrder(recommendID, orderNum);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃推荐
|
||||
*/
|
||||
@GetMapping("/active")
|
||||
public ResultDomain<TbResourceRecommend> getActiveRecommends(@RequestParam(required = false) Integer limit) {
|
||||
return null;
|
||||
// return resourceRecommendService.getActiveRecommends(limit);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.xyzh.news.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.news.tag.TagService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbTag;
|
||||
|
||||
/**
|
||||
* @description 标签控制器
|
||||
* @filename TagController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/news/tag")
|
||||
public class TagController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(TagController.class);
|
||||
|
||||
@Autowired
|
||||
private TagService tagService;
|
||||
|
||||
/**
|
||||
* 获取标签列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbTag> getTagList(TbTag filter) {
|
||||
return null;
|
||||
// return tagService.getTagList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取标签详情
|
||||
*/
|
||||
@GetMapping("/{tagID}")
|
||||
public ResultDomain<TbTag> getTagById(@PathVariable String tagID) {
|
||||
return tagService.getTagById(tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建标签
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbTag> createTag(@RequestBody TbTag tag) {
|
||||
return tagService.createTag(tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新标签
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbTag> updateTag(@RequestBody TbTag tag) {
|
||||
return tagService.updateTag(tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签
|
||||
*/
|
||||
@DeleteMapping("/{tagID}")
|
||||
public ResultDomain<Boolean> deleteTag(@PathVariable String tagID) {
|
||||
return tagService.deleteTag(tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新标签状态
|
||||
*/
|
||||
@PutMapping("/{tagID}/status")
|
||||
public ResultDomain<TbTag> updateTagStatus(@PathVariable String tagID, @RequestParam Integer status) {
|
||||
return null;
|
||||
// return tagService.updateTagStatus(tagID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取热门标签
|
||||
*/
|
||||
@GetMapping("/hot")
|
||||
public ResultDomain<TbTag> getHotTags(@RequestParam(required = false) Integer limit) {
|
||||
return null;
|
||||
// return tagService.getHotTags(limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索标签
|
||||
*/
|
||||
@GetMapping("/search")
|
||||
public ResultDomain<TbTag> searchTags(@RequestParam String keyword) {
|
||||
return null;
|
||||
// return tagService.searchTags(keyword);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.banner.BannerService;
|
||||
|
||||
/**
|
||||
* @description 横幅服务接口
|
||||
* @filename NCBannerService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCBannerService extends BannerService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.collection.DataCollectionService;
|
||||
|
||||
/**
|
||||
* @description 数据采集服务接口
|
||||
* @filename NCDataCollectionService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCDataCollectionService extends DataCollectionService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.category.ResourceCategoryService;
|
||||
|
||||
/**
|
||||
* @description 资源分类服务接口
|
||||
* @filename NCResourceCategoryService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCResourceCategoryService extends ResourceCategoryService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.recommend.ResourceRecommendService;
|
||||
|
||||
/**
|
||||
* @description 资源推荐服务接口
|
||||
* @filename NCResourceRecommendService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCResourceRecommendService extends ResourceRecommendService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.resource.ResourceService;
|
||||
|
||||
/**
|
||||
* @description 资源服务接口
|
||||
* @filename NCResourceService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCResourceService extends ResourceService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.news.service;
|
||||
|
||||
import org.xyzh.api.news.tag.TagService;
|
||||
|
||||
/**
|
||||
* @description 标签服务接口
|
||||
* @filename NCTagService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface NCTagService extends TagService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbBanner;
|
||||
import org.xyzh.news.mapper.BannerMapper;
|
||||
import org.xyzh.api.news.banner.BannerService;
|
||||
|
||||
/**
|
||||
* @description 横幅服务实现类
|
||||
* @filename NCBannerServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCBannerServiceImpl implements BannerService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCBannerServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private BannerMapper bannerMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> batchUpdateBannerOrder(Map<String, Integer> bannerOrders) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> createBanner(TbBanner banner) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteBanner(String bannerID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> getActiveBanners(Integer limit) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> getBannerById(String bannerID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> getBannerList(Integer status) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> updateBanner(TbBanner banner) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> updateBannerOrder(String bannerID, Integer orderNum) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbBanner> updateBannerStatus(String bannerID, Integer status) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbDataCollectionConfig;
|
||||
import org.xyzh.common.dto.resource.TbDataCollectionLog;
|
||||
import org.xyzh.news.mapper.DataCollectionConfigMapper;
|
||||
import org.xyzh.news.mapper.DataCollectionLogMapper;
|
||||
import org.xyzh.api.news.collection.DataCollectionService;
|
||||
|
||||
/**
|
||||
* @description 数据采集服务实现类
|
||||
* @filename NCDataCollectionServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCDataCollectionServiceImpl implements DataCollectionService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCDataCollectionServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private DataCollectionConfigMapper dataCollectionConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private DataCollectionLogMapper dataCollectionLogMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> batchExecuteCollection(List<String> configIDs) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> createConfig(TbDataCollectionConfig config) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> createLog(TbDataCollectionLog log) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteConfig(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> executeCollection(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<String> getCollectionStatus(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> getConfigById(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> getConfigList(Integer status) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> getConfigStatistics(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> getLogById(String logID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionLog> getLogList(String configID, Date startDate, Date endDate) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> stopCollection(String configID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> updateConfig(TbDataCollectionConfig config) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> updateConfigStatus(String configID, Integer status) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbDataCollectionConfig> updateLastCollectTime(String configID, Date lastCollectTime) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResourceCategory;
|
||||
import org.xyzh.news.mapper.ResourceCategoryMapper;
|
||||
import org.xyzh.api.news.category.ResourceCategoryService;
|
||||
|
||||
/**
|
||||
* @description 资源分类服务实现类
|
||||
* @filename NCResourceCategoryServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCResourceCategoryServiceImpl implements ResourceCategoryService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCResourceCategoryServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceCategoryMapper resourceCategoryMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> createCategory(TbResourceCategory category) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteCategory(String categoryID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> getAllCategories() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> getCategoriesByParent(String parentID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> getCategoryById(String categoryID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> getCategoryTree() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> hasChildCategories(String categoryID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> hasResources(String categoryID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> updateCategory(TbResourceCategory category) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceCategory> updateCategoryOrder(String categoryID, Integer orderNum) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResourceRecommend;
|
||||
import org.xyzh.news.mapper.ResourceRecommendMapper;
|
||||
import org.xyzh.api.news.recommend.ResourceRecommendService;
|
||||
|
||||
/**
|
||||
* @description 资源推荐服务实现类
|
||||
* @filename NCResourceRecommendServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCResourceRecommendServiceImpl implements ResourceRecommendService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCResourceRecommendServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceRecommendMapper resourceRecommendMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> addRecommend(TbResourceRecommend recommend) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> batchAddRecommends(List<String> resourceIDs, String reason) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> batchRemoveRecommends(List<String> resourceIDs) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> getRecommendDetail(String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> getRecommendList() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> isResourceRecommended(String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeRecommend(String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> updateRecommendOrder(String resourceID, Integer orderNum) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceRecommend> updateRecommendReason(String resourceID, String reason) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResource;
|
||||
import org.xyzh.news.mapper.ResourceMapper;
|
||||
import org.xyzh.api.news.resource.ResourceService;
|
||||
|
||||
/**
|
||||
* @description 资源服务实现类
|
||||
* @filename NCResourceServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCResourceServiceImpl implements ResourceService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCResourceServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private ResourceMapper resourceMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> getResourceList(TbResource filter) {
|
||||
// TODO: 实现获取资源列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> getResourceById(String resourceID) {
|
||||
// TODO: 实现根据ID获取资源详情
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> createResource(TbResource resource) {
|
||||
// TODO: 实现创建资源
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> updateResource(TbResource resource) {
|
||||
// TODO: 实现更新资源
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteResource(String resourceID) {
|
||||
// TODO: 实现删除资源
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> updateResourceStatus(String resourceID, Integer status) {
|
||||
// TODO: 实现更新资源状态
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> publishResource(String resourceID) {
|
||||
// TODO: 实现发布资源
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> unpublishResource(String resourceID) {
|
||||
// TODO: 实现下架资源
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> incrementViewCount(String resourceID) {
|
||||
// TODO: 实现增加浏览次数
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> incrementLikeCount(String resourceID) {
|
||||
// TODO: 实现增加点赞次数
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> incrementCollectCount(String resourceID) {
|
||||
// TODO: 实现增加收藏次数
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> setResourceRecommend(String resourceID, Boolean isRecommend) {
|
||||
// TODO: 实现设置资源推荐
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> setResourceBanner(String resourceID, Boolean isBanner) {
|
||||
// TODO: 实现设置资源轮播
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> getRecommendResources(Integer limit) {
|
||||
// TODO: 实现获取推荐资源列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> getBannerResources(Integer limit) {
|
||||
// TODO: 实现获取轮播资源列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResource> searchResources(String keyword, String categoryID, Integer status) {
|
||||
// TODO: 实现搜索资源
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package org.xyzh.news.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbResourceTag;
|
||||
import org.xyzh.common.dto.resource.TbTag;
|
||||
import org.xyzh.news.mapper.TagMapper;
|
||||
import org.xyzh.api.news.tag.TagService;
|
||||
|
||||
/**
|
||||
* @description 标签服务实现类
|
||||
* @filename NCTagServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class NCTagServiceImpl implements TagService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(NCTagServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private TagMapper tagMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceTag> addResourceTag(String resourceID, String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbResourceTag> batchAddResourceTags(String resourceID, List<String> tagIDs) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> clearResourceTags(String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> createTag(TbTag tag) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteTag(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> getAllTags() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> getResourceTags(String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<String> getResourcesByTag(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> getTagById(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeResourceTag(String resourceID, String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> searchTagsByName(String name) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTag> updateTag(TbTag tag) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.study.course.CourseService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
import org.xyzh.common.dto.study.TbCourseChapter;
|
||||
|
||||
/**
|
||||
* @description 课程控制器
|
||||
* @filename CourseController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/course")
|
||||
public class CourseController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CourseController.class);
|
||||
|
||||
@Autowired
|
||||
private CourseService courseService;
|
||||
|
||||
/**
|
||||
* 获取课程列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbCourse> getCourseList(TbCourse filter) {
|
||||
return courseService.getCourseList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取课程详情
|
||||
*/
|
||||
@GetMapping("/{courseID}")
|
||||
public ResultDomain<TbCourse> getCourseById(@PathVariable String courseID) {
|
||||
return courseService.getCourseById(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建课程
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbCourse> createCourse(@RequestBody TbCourse course) {
|
||||
return courseService.createCourse(course);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新课程
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbCourse> updateCourse(@RequestBody TbCourse course) {
|
||||
return courseService.updateCourse(course);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程
|
||||
*/
|
||||
@DeleteMapping("/{courseID}")
|
||||
public ResultDomain<Boolean> deleteCourse(@PathVariable String courseID) {
|
||||
return courseService.deleteCourse(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新课程状态
|
||||
*/
|
||||
@PutMapping("/{courseID}/status")
|
||||
public ResultDomain<TbCourse> updateCourseStatus(
|
||||
@PathVariable String courseID,
|
||||
@RequestParam Integer status) {
|
||||
return courseService.updateCourseStatus(courseID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加课程浏览次数
|
||||
*/
|
||||
@PostMapping("/{courseID}/view")
|
||||
public ResultDomain<TbCourse> incrementViewCount(@PathVariable String courseID) {
|
||||
return courseService.incrementViewCount(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加课程学习人数
|
||||
*/
|
||||
@PostMapping("/{courseID}/learn")
|
||||
public ResultDomain<TbCourse> incrementLearnCount(@PathVariable String courseID) {
|
||||
return courseService.incrementLearnCount(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程章节列表
|
||||
*/
|
||||
@GetMapping("/{courseID}/chapters")
|
||||
public ResultDomain<TbCourseChapter> getCourseChapters(@PathVariable String courseID) {
|
||||
return courseService.getCourseChapters(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取章节详情
|
||||
*/
|
||||
@GetMapping("/chapter/{chapterID}")
|
||||
public ResultDomain<TbCourseChapter> getChapterById(@PathVariable String chapterID) {
|
||||
return courseService.getChapterById(chapterID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建课程章节
|
||||
*/
|
||||
@PostMapping("/chapter/create")
|
||||
public ResultDomain<TbCourseChapter> createChapter(@RequestBody TbCourseChapter chapter) {
|
||||
return courseService.createChapter(chapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新课程章节
|
||||
*/
|
||||
@PutMapping("/chapter/update")
|
||||
public ResultDomain<TbCourseChapter> updateChapter(@RequestBody TbCourseChapter chapter) {
|
||||
return courseService.updateChapter(chapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程章节
|
||||
*/
|
||||
@DeleteMapping("/chapter/{chapterID}")
|
||||
public ResultDomain<Boolean> deleteChapter(@PathVariable String chapterID) {
|
||||
return courseService.deleteChapter(chapterID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新章节排序
|
||||
*/
|
||||
@PutMapping("/chapter/{chapterID}/order")
|
||||
public ResultDomain<TbCourseChapter> updateChapterOrder(
|
||||
@PathVariable String chapterID,
|
||||
@RequestParam Integer orderNum) {
|
||||
return courseService.updateChapterOrder(chapterID, orderNum);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 课程管理控制器
|
||||
* @filename CourseManagementController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/course-management")
|
||||
public class CourseManagementController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CourseManagementController.class);
|
||||
|
||||
// ==================== 课程列表管理 ====================
|
||||
|
||||
/**
|
||||
* 分页展示所有课程
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbCourse> getCourseList(
|
||||
@RequestParam(required = false) String courseName,
|
||||
@RequestParam(required = false) String tag,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现分页展示所有课程(支持按课程名称/标签筛选)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看课程详情
|
||||
*/
|
||||
@GetMapping("/detail/{courseID}")
|
||||
public ResultDomain<TbCourse> getCourseDetail(@PathVariable String courseID) {
|
||||
// TODO: 实现查看课程详情
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按课程名称筛选
|
||||
*/
|
||||
@GetMapping("/filter/name")
|
||||
public ResultDomain<TbCourse> filterByCourseName(@RequestParam String courseName) {
|
||||
// TODO: 实现按课程名称筛选
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按标签筛选课程
|
||||
*/
|
||||
@GetMapping("/filter/tag")
|
||||
public ResultDomain<TbCourse> filterByTag(@RequestParam String tag) {
|
||||
// TODO: 实现按标签筛选课程
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 课程添加管理 ====================
|
||||
|
||||
/**
|
||||
* 添加课程
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResultDomain<TbCourse> addCourse(@RequestBody Map<String, Object> courseData) {
|
||||
// TODO: 实现添加课程(录入课程名称、上传课程图片、填写课程描述、选择课程标签、设置课程权限、设置课程状态)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传课程图片
|
||||
*/
|
||||
@PostMapping("/upload-image")
|
||||
public ResultDomain<String> uploadCourseImage(@RequestParam("file") String file) {
|
||||
// TODO: 实现上传课程图片
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置课程权限
|
||||
*/
|
||||
@PutMapping("/permission/set")
|
||||
public ResultDomain<Boolean> setCoursePermission(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现设置课程权限(公开/指定部门)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置课程状态
|
||||
*/
|
||||
@PutMapping("/status/set")
|
||||
public ResultDomain<Boolean> setCourseStatus(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现设置课程状态(未上线/已上线)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择课程标签
|
||||
*/
|
||||
@PutMapping("/tag/select")
|
||||
public ResultDomain<Boolean> selectCourseTags(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现选择课程标签
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 课程维护管理 ====================
|
||||
|
||||
/**
|
||||
* 编辑课程信息
|
||||
*/
|
||||
@PutMapping("/edit")
|
||||
public ResultDomain<TbCourse> editCourseInfo(@RequestBody TbCourse course) {
|
||||
// TODO: 实现编辑课程信息
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新课程内容
|
||||
*/
|
||||
@PutMapping("/content/update")
|
||||
public ResultDomain<Boolean> updateCourseContent(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现更新课程内容
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改课程状态
|
||||
*/
|
||||
@PutMapping("/status/change")
|
||||
public ResultDomain<Boolean> changeCourseStatus(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现修改课程状态
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除课程
|
||||
*/
|
||||
@DeleteMapping("/{courseID}")
|
||||
public ResultDomain<Boolean> deleteCourse(@PathVariable String courseID) {
|
||||
// TODO: 实现删除课程
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新课程状态
|
||||
*/
|
||||
@PutMapping("/batch-status-update")
|
||||
public ResultDomain<Boolean> batchUpdateCourseStatus(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现批量更新课程状态
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程统计信息
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public ResultDomain<Map<String, Object>> getCourseStatistics(@RequestParam String courseID) {
|
||||
// TODO: 实现获取课程统计信息
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程学习情况
|
||||
*/
|
||||
@GetMapping("/learning-status")
|
||||
public ResultDomain<Map<String, Object>> getCourseLearningStatus(@RequestParam String courseID) {
|
||||
// TODO: 实现获取课程学习情况
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.study.tag.CourseTagService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbCourseTag;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
|
||||
/**
|
||||
* @description 课程标签控制器
|
||||
* @filename CourseTagController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/tag")
|
||||
public class CourseTagController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CourseTagController.class);
|
||||
|
||||
@Autowired
|
||||
private CourseTagService courseTagService;
|
||||
|
||||
/**
|
||||
* 获取标签列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbCourseTag> getTagList(TbCourseTag filter) {
|
||||
return null;
|
||||
// return courseTagService.getTagList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取标签详情
|
||||
*/
|
||||
@GetMapping("/{tagID}")
|
||||
public ResultDomain<TbCourseTag> getTagById(@PathVariable String tagID) {
|
||||
return courseTagService.getTagById(tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据标签获取课程列表
|
||||
*/
|
||||
@GetMapping("/{tagID}/courses")
|
||||
public ResultDomain<TbCourse> getCoursesByTag(@PathVariable String tagID) {
|
||||
return null;
|
||||
// return courseTagService.getCoursesByTag(tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加标签到课程
|
||||
*/
|
||||
@PostMapping("/course/{courseID}/tag")
|
||||
public ResultDomain<TbCourseTag> addTagToCourse(
|
||||
@PathVariable String courseID,
|
||||
@RequestParam String tagID) {
|
||||
return null;
|
||||
// return courseTagService.addTagToCourse(courseID, tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从课程移除标签
|
||||
*/
|
||||
@DeleteMapping("/course/{courseID}/tag/{tagID}")
|
||||
public ResultDomain<Boolean> removeTagFromCourse(
|
||||
@PathVariable String courseID,
|
||||
@PathVariable String tagID) {
|
||||
return null;
|
||||
// return courseTagService.removeTagFromCourse(courseID, tagID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程标签列表
|
||||
*/
|
||||
@GetMapping("/course/{courseID}/tags")
|
||||
public ResultDomain<TbCourseTag> getCourseTags(@PathVariable String courseID) {
|
||||
return courseTagService.getCourseTags(courseID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 学习管理控制器
|
||||
* @filename LearningManagementController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/management")
|
||||
public class LearningManagementController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LearningManagementController.class);
|
||||
|
||||
// ==================== 任务发布管理 ====================
|
||||
|
||||
/**
|
||||
* 发布学习任务
|
||||
*/
|
||||
@PostMapping("/task/publish")
|
||||
public ResultDomain<TbLearningTask> publishLearningTask(@RequestBody Map<String, Object> taskData) {
|
||||
// TODO: 实现发布学习任务(编辑任务名称、任务描述、任务周期、关联资源/课程)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑学习任务
|
||||
*/
|
||||
@PutMapping("/task/edit")
|
||||
public ResultDomain<TbLearningTask> editLearningTask(@RequestBody TbLearningTask task) {
|
||||
// TODO: 实现编辑学习任务
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务发布列表
|
||||
*/
|
||||
@GetMapping("/task/published-list")
|
||||
public ResultDomain<TbLearningTask> getPublishedTaskList(
|
||||
@RequestParam(required = false) String taskName,
|
||||
@RequestParam(required = false) Integer status) {
|
||||
// TODO: 实现获取任务发布列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联资源到任务
|
||||
*/
|
||||
@PostMapping("/task/link-resource")
|
||||
public ResultDomain<Boolean> linkResourceToTask(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现关联资源/课程到任务
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联课程到任务
|
||||
*/
|
||||
@PostMapping("/task/link-course")
|
||||
public ResultDomain<Boolean> linkCourseToTask(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现关联课程到任务
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 人员选定管理 ====================
|
||||
|
||||
/**
|
||||
* 按部门筛选人员
|
||||
*/
|
||||
@GetMapping("/personnel/dept-filter")
|
||||
public ResultDomain<Map<String, Object>> filterPersonnelByDept(@RequestParam String deptID) {
|
||||
// TODO: 实现按部门层级筛选人员
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动勾选人员
|
||||
*/
|
||||
@PostMapping("/personnel/select")
|
||||
public ResultDomain<List<Map<String, Object>>> selectPersonnel(@RequestBody List<String> userIDs) {
|
||||
// TODO: 实现手动勾选人员
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成任务接收名单
|
||||
*/
|
||||
@PostMapping("/personnel/generate-list")
|
||||
public ResultDomain<List<TbTaskUser>> generateTaskReceiverList(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现生成任务接收名单
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量分配任务给用户
|
||||
*/
|
||||
@PostMapping("/personnel/batch-assign")
|
||||
public ResultDomain<Boolean> batchAssignTaskToUsers(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现批量分配任务给用户
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门人员树形结构
|
||||
*/
|
||||
@GetMapping("/personnel/dept-tree")
|
||||
public ResultDomain<Map<String, Object>> getDeptPersonnelTree() {
|
||||
// TODO: 实现获取部门人员树形结构
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 学习记录统计 ====================
|
||||
|
||||
/**
|
||||
* 获取学习记录统计
|
||||
*/
|
||||
@GetMapping("/record/statistics")
|
||||
public ResultDomain<Map<String, Object>> getLearningRecordStatistics(
|
||||
@RequestParam(required = false) String deptID,
|
||||
@RequestParam(required = false) String userID,
|
||||
@RequestParam(required = false) String startDate,
|
||||
@RequestParam(required = false) String endDate) {
|
||||
// TODO: 实现获取学习记录统计(支持按部门/个人/时间筛选查询)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户学习时长统计
|
||||
*/
|
||||
@GetMapping("/record/learning-duration")
|
||||
public ResultDomain<Map<String, Object>> getLearningDurationStatistics(@RequestParam String userID) {
|
||||
// TODO: 实现统计用户学习时长
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学习资源数量统计
|
||||
*/
|
||||
@GetMapping("/record/resource-count")
|
||||
public ResultDomain<Map<String, Object>> getResourceCountStatistics(@RequestParam String userID) {
|
||||
// TODO: 实现统计学习资源数量
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务完成情况统计
|
||||
*/
|
||||
@GetMapping("/record/task-completion")
|
||||
public ResultDomain<Map<String, Object>> getTaskCompletionStatistics(@RequestParam String userID) {
|
||||
// TODO: 实现统计任务完成情况
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成可视化数据图表
|
||||
*/
|
||||
@GetMapping("/record/chart-data")
|
||||
public ResultDomain<Map<String, Object>> getChartData(
|
||||
@RequestParam String chartType,
|
||||
@RequestParam(required = false) String userID,
|
||||
@RequestParam(required = false) String deptID) {
|
||||
// TODO: 实现生成可视化数据(图表接口)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取部门学习统计
|
||||
*/
|
||||
@GetMapping("/record/dept-statistics")
|
||||
public ResultDomain<Map<String, Object>> getDeptLearningStatistics(@RequestParam String deptID) {
|
||||
// TODO: 实现获取部门学习统计
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学习记录报告
|
||||
*/
|
||||
@PostMapping("/record/export-report")
|
||||
public ResultDomain<String> exportLearningReport(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现导出学习记录报告
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 学习计划控制器
|
||||
* @filename LearningPlanController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/plan")
|
||||
public class LearningPlanController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LearningPlanController.class);
|
||||
|
||||
// ==================== 计划列表管理 ====================
|
||||
|
||||
/**
|
||||
* 获取学习计划列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbLearningTask> getLearningPlanList(
|
||||
@RequestParam(required = false) String planName,
|
||||
@RequestParam(required = false) Integer status,
|
||||
@RequestParam(required = false) Integer pageNum,
|
||||
@RequestParam(required = false) Integer pageSize) {
|
||||
// TODO: 实现展示校方统一发布的学习计划(名称、起止时间、任务描述)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划详情
|
||||
*/
|
||||
@GetMapping("/{planID}")
|
||||
public ResultDomain<TbLearningTask> getPlanDetail(@PathVariable String planID) {
|
||||
// TODO: 实现获取计划详情
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进行中的计划
|
||||
*/
|
||||
@GetMapping("/active")
|
||||
public ResultDomain<TbLearningTask> getActivePlans() {
|
||||
// TODO: 实现获取进行中的计划
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已完成的计划
|
||||
*/
|
||||
@GetMapping("/completed")
|
||||
public ResultDomain<TbLearningTask> getCompletedPlans() {
|
||||
// TODO: 实现获取已完成的计划
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取即将开始的计划
|
||||
*/
|
||||
@GetMapping("/upcoming")
|
||||
public ResultDomain<TbLearningTask> getUpcomingPlans() {
|
||||
// TODO: 实现获取即将开始的计划
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按时间范围筛选计划
|
||||
*/
|
||||
@GetMapping("/filter/date-range")
|
||||
public ResultDomain<TbLearningTask> filterPlansByDateRange(
|
||||
@RequestParam String startDate,
|
||||
@RequestParam String endDate) {
|
||||
// TODO: 实现按时间范围筛选计划
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 任务进度管理 ====================
|
||||
|
||||
/**
|
||||
* 获取当前用户的学习任务
|
||||
*/
|
||||
@GetMapping("/user/{userID}/tasks")
|
||||
public ResultDomain<TbTaskUser> getUserLearningTasks(@PathVariable String userID) {
|
||||
// TODO: 实现展示当前用户的学习任务(已完成/未完成)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务进度详情
|
||||
*/
|
||||
@GetMapping("/task/{taskID}/progress")
|
||||
public ResultDomain<Map<String, Object>> getTaskProgress(@PathVariable String taskID) {
|
||||
// TODO: 实现获取任务进度详情
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户任务进度
|
||||
*/
|
||||
@GetMapping("/user/{userID}/task/{taskID}/progress")
|
||||
public ResultDomain<Map<String, Object>> getUserTaskProgress(
|
||||
@PathVariable String userID,
|
||||
@PathVariable String taskID) {
|
||||
// TODO: 实现获取用户任务进度
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务进度
|
||||
*/
|
||||
@PutMapping("/task/{taskID}/progress")
|
||||
public ResultDomain<Boolean> updateTaskProgress(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam String userID,
|
||||
@RequestParam Integer progress) {
|
||||
// TODO: 实现更新任务进度
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成任务
|
||||
*/
|
||||
@PostMapping("/task/{taskID}/complete")
|
||||
public ResultDomain<Boolean> completeTask(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam String userID) {
|
||||
// TODO: 实现完成任务
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取进度条数据
|
||||
*/
|
||||
@GetMapping("/user/{userID}/progress-bar")
|
||||
public ResultDomain<Map<String, Object>> getProgressBarData(@PathVariable String userID) {
|
||||
// TODO: 实现用进度条显示完成百分比
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已完成任务列表
|
||||
*/
|
||||
@GetMapping("/user/{userID}/completed-tasks")
|
||||
public ResultDomain<TbTaskUser> getCompletedTasks(@PathVariable String userID) {
|
||||
// TODO: 实现获取已完成任务列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未完成任务列表
|
||||
*/
|
||||
@GetMapping("/user/{userID}/pending-tasks")
|
||||
public ResultDomain<TbTaskUser> getPendingTasks(@PathVariable String userID) {
|
||||
// TODO: 实现获取未完成任务列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务统计信息
|
||||
*/
|
||||
@GetMapping("/user/{userID}/task-statistics")
|
||||
public ResultDomain<Map<String, Object>> getTaskStatistics(@PathVariable String userID) {
|
||||
// TODO: 实现获取任务统计信息
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学习计划统计
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public ResultDomain<Map<String, Object>> getLearningPlanStatistics() {
|
||||
// TODO: 实现获取学习计划统计
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户学习计划参与情况
|
||||
*/
|
||||
@GetMapping("/user/{userID}/participation")
|
||||
public ResultDomain<Map<String, Object>> getUserParticipation(@PathVariable String userID) {
|
||||
// TODO: 实现获取用户学习计划参与情况
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计划排行榜
|
||||
*/
|
||||
@GetMapping("/ranking")
|
||||
public ResultDomain<Map<String, Object>> getPlanRanking(
|
||||
@RequestParam(required = false) String planID,
|
||||
@RequestParam(required = false) Integer limit) {
|
||||
// TODO: 实现获取计划排行榜
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.study.record.LearningRecordService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningRecord;
|
||||
|
||||
/**
|
||||
* @description 学习记录控制器
|
||||
* @filename LearningRecordController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/record")
|
||||
public class LearningRecordController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LearningRecordController.class);
|
||||
|
||||
@Autowired
|
||||
private LearningRecordService learningRecordService;
|
||||
|
||||
/**
|
||||
* 获取学习记录
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbLearningRecord> getLearningRecords(
|
||||
@RequestParam(required = false) String userID,
|
||||
@RequestParam(required = false) String courseID,
|
||||
@RequestParam(required = false) String taskID) {
|
||||
return null;
|
||||
// return learningRecordService.getLearningRecords(userID, courseID, taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建学习记录
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbLearningRecord> createLearningRecord(@RequestBody TbLearningRecord record) {
|
||||
return null;
|
||||
// return learningRecordService.createLearningRecord(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新学习记录
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbLearningRecord> updateLearningRecord(@RequestBody TbLearningRecord record) {
|
||||
return null;
|
||||
// return learningRecordService.updateLearningRecord(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学习记录
|
||||
*/
|
||||
@DeleteMapping("/{recordID}")
|
||||
public ResultDomain<Boolean> deleteLearningRecord(@PathVariable String recordID) {
|
||||
return null;
|
||||
// return learningRecordService.deleteLearningRecord(recordID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取学习记录
|
||||
*/
|
||||
@GetMapping("/{recordID}")
|
||||
public ResultDomain<TbLearningRecord> getRecordById(@PathVariable String recordID) {
|
||||
return null;
|
||||
// return learningRecordService.getRecordById(recordID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新学习进度
|
||||
*/
|
||||
@PutMapping("/{recordID}/progress")
|
||||
public ResultDomain<TbLearningRecord> updateLearningProgress(
|
||||
@PathVariable String recordID,
|
||||
@RequestParam Integer progress) {
|
||||
return null;
|
||||
// return learningRecordService.updateLearningProgress(recordID, progress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成学习
|
||||
*/
|
||||
@PostMapping("/{recordID}/complete")
|
||||
public ResultDomain<TbLearningRecord> completeLearning(@PathVariable String recordID) {
|
||||
return null;
|
||||
// return learningRecordService.completeLearning(recordID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.study.statistics.LearningStatisticsService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningStatistics;
|
||||
|
||||
/**
|
||||
* @description 学习统计控制器
|
||||
* @filename LearningStatisticsController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/statistics")
|
||||
public class LearningStatisticsController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LearningStatisticsController.class);
|
||||
|
||||
@Autowired
|
||||
private LearningStatisticsService learningStatisticsService;
|
||||
|
||||
/**
|
||||
* 获取用户学习统计
|
||||
*/
|
||||
@GetMapping("/user/{userID}")
|
||||
public ResultDomain<TbLearningStatistics> getUserStatistics(@PathVariable String userID) {
|
||||
return null;
|
||||
// return learningStatisticsService.getUserStatistics(userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取课程学习统计
|
||||
*/
|
||||
@GetMapping("/course/{courseID}")
|
||||
public ResultDomain<TbLearningStatistics> getCourseStatistics(@PathVariable String courseID) {
|
||||
return null;
|
||||
// return learningStatisticsService.getCourseStatistics(courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务学习统计
|
||||
*/
|
||||
@GetMapping("/task/{taskID}")
|
||||
public ResultDomain<TbLearningStatistics> getTaskStatistics(@PathVariable String taskID) {
|
||||
return null;
|
||||
// return learningStatisticsService.getTaskStatistics(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建学习统计
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbLearningStatistics> createStatistics(@RequestBody TbLearningStatistics statistics) {
|
||||
return null;
|
||||
// return learningStatisticsService.createStatistics(statistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新学习统计
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbLearningStatistics> updateStatistics(@RequestBody TbLearningStatistics statistics) {
|
||||
return null;
|
||||
// return learningStatisticsService.updateStatistics(statistics);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加学习时长
|
||||
*/
|
||||
@PostMapping("/{userID}/study-time")
|
||||
public ResultDomain<TbLearningStatistics> incrementStudyTime(
|
||||
@PathVariable String userID,
|
||||
@RequestParam String courseID,
|
||||
@RequestParam Integer minutes) {
|
||||
return null;
|
||||
// return learningStatisticsService.incrementStudyTime(userID, courseID, minutes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加完成课程数
|
||||
*/
|
||||
@PostMapping("/{userID}/completed-courses")
|
||||
public ResultDomain<TbLearningStatistics> incrementCompletedCourses(@PathVariable String userID) {
|
||||
return null;
|
||||
// return learningStatisticsService.incrementCompletedCourses(userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加完成任务数
|
||||
*/
|
||||
@PostMapping("/{userID}/completed-tasks")
|
||||
public ResultDomain<TbLearningStatistics> incrementCompletedTasks(@PathVariable String userID) {
|
||||
return null;
|
||||
// return learningStatisticsService.incrementCompletedTasks(userID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package org.xyzh.study.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.study.task.LearningTaskService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
import org.xyzh.common.dto.study.TbTaskCourse;
|
||||
import org.xyzh.common.dto.study.TbTaskResource;
|
||||
|
||||
/**
|
||||
* @description 学习任务控制器
|
||||
* @filename LearningTaskController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/study/task")
|
||||
public class LearningTaskController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LearningTaskController.class);
|
||||
|
||||
@Autowired
|
||||
private LearningTaskService learningTaskService;
|
||||
|
||||
/**
|
||||
* 获取任务列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbLearningTask> getTaskList(TbLearningTask filter) {
|
||||
return learningTaskService.getTaskList(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID获取任务详情
|
||||
*/
|
||||
@GetMapping("/{taskID}")
|
||||
public ResultDomain<TbLearningTask> getTaskById(@PathVariable String taskID) {
|
||||
return learningTaskService.getTaskById(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建任务
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public ResultDomain<TbLearningTask> createTask(@RequestBody TbLearningTask task) {
|
||||
return learningTaskService.createTask(task);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbLearningTask> updateTask(@RequestBody TbLearningTask task) {
|
||||
return learningTaskService.updateTask(task);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除任务
|
||||
*/
|
||||
@DeleteMapping("/{taskID}")
|
||||
public ResultDomain<Boolean> deleteTask(@PathVariable String taskID) {
|
||||
return learningTaskService.deleteTask(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新任务状态
|
||||
*/
|
||||
@PutMapping("/{taskID}/status")
|
||||
public ResultDomain<TbLearningTask> updateTaskStatus(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam Integer status) {
|
||||
return learningTaskService.updateTaskStatus(taskID, status);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务用户列表
|
||||
*/
|
||||
@GetMapping("/{taskID}/users")
|
||||
public ResultDomain<TbTaskUser> getTaskUsers(@PathVariable String taskID) {
|
||||
return learningTaskService.getTaskUsers(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配任务给用户
|
||||
*/
|
||||
@PostMapping("/{taskID}/assign")
|
||||
public ResultDomain<TbTaskUser> assignTaskToUser(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam String userID) {
|
||||
return null;
|
||||
// return learningTaskService.assignTaskToUser(taskID, userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从用户移除任务
|
||||
*/
|
||||
@DeleteMapping("/{taskID}/user/{userID}")
|
||||
public ResultDomain<Boolean> removeTaskFromUser(
|
||||
@PathVariable String taskID,
|
||||
@PathVariable String userID) {
|
||||
return null;
|
||||
// return learningTaskService.removeTaskFromUser(taskID, userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务课程列表
|
||||
*/
|
||||
@GetMapping("/{taskID}/courses")
|
||||
public ResultDomain<TbTaskCourse> getTaskCourses(@PathVariable String taskID) {
|
||||
return learningTaskService.getTaskCourses(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加课程到任务
|
||||
*/
|
||||
@PostMapping("/{taskID}/course")
|
||||
public ResultDomain<TbTaskCourse> addCourseToTask(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam String courseID) {
|
||||
return null;
|
||||
// return learningTaskService.addCourseToTask(taskID, courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从任务移除课程
|
||||
*/
|
||||
@DeleteMapping("/{taskID}/course/{courseID}")
|
||||
public ResultDomain<Boolean> removeCourseFromTask(
|
||||
@PathVariable String taskID,
|
||||
@PathVariable String courseID) {
|
||||
return null;
|
||||
// return learningTaskService.removeCourseFromTask(taskID, courseID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务资源列表
|
||||
*/
|
||||
@GetMapping("/{taskID}/resources")
|
||||
public ResultDomain<TbTaskResource> getTaskResources(@PathVariable String taskID) {
|
||||
return learningTaskService.getTaskResources(taskID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加资源到任务
|
||||
*/
|
||||
@PostMapping("/{taskID}/resource")
|
||||
public ResultDomain<TbTaskResource> addResourceToTask(
|
||||
@PathVariable String taskID,
|
||||
@RequestParam String resourceID) {
|
||||
return null;
|
||||
// return learningTaskService.addResourceToTask(taskID, resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从任务移除资源
|
||||
*/
|
||||
@DeleteMapping("/{taskID}/resource/{resourceID}")
|
||||
public ResultDomain<Boolean> removeResourceFromTask(
|
||||
@PathVariable String taskID,
|
||||
@PathVariable String resourceID) {
|
||||
return null;
|
||||
// return learningTaskService.removeResourceFromTask(taskID, resourceID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.study.service;
|
||||
|
||||
import org.xyzh.api.study.course.CourseService;
|
||||
|
||||
/**
|
||||
* @description 课程服务接口
|
||||
* @filename SCCourseService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface SCCourseService extends CourseService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.study.service;
|
||||
|
||||
import org.xyzh.api.study.tag.CourseTagService;
|
||||
|
||||
/**
|
||||
* @description 课程标签服务接口
|
||||
* @filename SCCourseTagService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface SCCourseTagService extends CourseTagService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.study.service;
|
||||
|
||||
import org.xyzh.api.study.record.LearningRecordService;
|
||||
|
||||
/**
|
||||
* @description 学习记录服务接口
|
||||
* @filename SCLearningRecordService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface SCLearningRecordService extends LearningRecordService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.study.service;
|
||||
|
||||
import org.xyzh.api.study.statistics.LearningStatisticsService;
|
||||
|
||||
/**
|
||||
* @description 学习统计服务接口
|
||||
* @filename SCLearningStatisticsService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface SCLearningStatisticsService extends LearningStatisticsService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.study.service;
|
||||
|
||||
import org.xyzh.api.study.task.LearningTaskService;
|
||||
|
||||
/**
|
||||
* @description 学习任务服务接口
|
||||
* @filename SCLearningTaskService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface SCLearningTaskService extends LearningTaskService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package org.xyzh.study.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbCourse;
|
||||
import org.xyzh.common.dto.study.TbCourseChapter;
|
||||
import org.xyzh.study.mapper.CourseMapper;
|
||||
import org.xyzh.study.mapper.CourseChapterMapper;
|
||||
import org.xyzh.study.service.SCCourseService;
|
||||
|
||||
/**
|
||||
* @description 课程服务实现类
|
||||
* @filename SCCourseServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SCCourseServiceImpl implements SCCourseService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SCCourseServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private CourseMapper courseMapper;
|
||||
|
||||
@Autowired
|
||||
private CourseChapterMapper courseChapterMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> getCourseList(TbCourse filter) {
|
||||
// TODO: 实现获取课程列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> getCourseById(String courseID) {
|
||||
// TODO: 实现根据ID获取课程详情
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> createCourse(TbCourse course) {
|
||||
// TODO: 实现创建课程
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> updateCourse(TbCourse course) {
|
||||
// TODO: 实现更新课程
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteCourse(String courseID) {
|
||||
// TODO: 实现删除课程
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> updateCourseStatus(String courseID, Integer status) {
|
||||
// TODO: 实现更新课程状态
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> incrementViewCount(String courseID) {
|
||||
// TODO: 实现增加课程浏览次数
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourse> incrementLearnCount(String courseID) {
|
||||
// TODO: 实现增加课程学习人数
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseChapter> getCourseChapters(String courseID) {
|
||||
// TODO: 实现获取课程章节列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseChapter> getChapterById(String chapterID) {
|
||||
// TODO: 实现根据ID获取章节详情
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseChapter> createChapter(TbCourseChapter chapter) {
|
||||
// TODO: 实现创建课程章节
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseChapter> updateChapter(TbCourseChapter chapter) {
|
||||
// TODO: 实现更新课程章节
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteChapter(String chapterID) {
|
||||
// TODO: 实现删除课程章节
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseChapter> updateChapterOrder(String chapterID, Integer orderNum) {
|
||||
// TODO: 实现更新章节排序
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package org.xyzh.study.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbCourseTag;
|
||||
import org.xyzh.api.study.tag.CourseTagService;
|
||||
import org.xyzh.study.mapper.CourseTagMapper;
|
||||
|
||||
/**
|
||||
* @description 课程标签服务实现类
|
||||
* @filename SCCourseTagServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SCCourseTagServiceImpl implements CourseTagService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SCCourseTagServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private CourseTagMapper courseTagMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> addCourseTag(String courseID, String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseTag> createCourseTag(TbCourseTag courseTag) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteCourseTag(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseTag> getAllCourseTags() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseTag> getCourseTags(String courseID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<String> getCoursesByTag(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseTag> getTagById(String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeCourseTag(String courseID, String tagID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbCourseTag> updateCourseTag(TbCourseTag courseTag) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.xyzh.study.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningRecord;
|
||||
import org.xyzh.api.study.record.LearningRecordService;
|
||||
import org.xyzh.study.mapper.LearningRecordMapper;
|
||||
|
||||
/**
|
||||
* @description 学习记录服务实现类
|
||||
* @filename SCLearningRecordServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SCLearningRecordServiceImpl implements LearningRecordService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SCLearningRecordServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private LearningRecordMapper learningRecordMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteLearningRecord(String recordID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> getResourceLearningRecords(Integer resourceType, String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> getTaskLearningStatistics(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> getUserLearningProgress(String userID, Integer resourceType,
|
||||
String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> getUserLearningRecords(String userID, Integer resourceType, String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> getUserLearningStatistics(String userID, Integer resourceType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> markLearningComplete(String userID, Integer resourceType, String resourceID,
|
||||
String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> saveLearningRecord(TbLearningRecord learningRecord) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningRecord> updateLearningProgress(String userID, Integer resourceType, String resourceID,
|
||||
BigDecimal progress, Integer duration) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.xyzh.study.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningStatistics;
|
||||
import org.xyzh.study.mapper.LearningStatisticsMapper;
|
||||
import org.xyzh.api.study.statistics.LearningStatisticsService;
|
||||
|
||||
/**
|
||||
* @description 学习统计服务实现类
|
||||
* @filename SCLearningStatisticsServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SCLearningStatisticsServiceImpl implements LearningStatisticsService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SCLearningStatisticsServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private LearningStatisticsMapper learningStatisticsMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteLearningStatistics(String statisticsID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> getDailyLearningStatistics(String userID, Date statDate) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> getDeptLearningStatistics(String deptID, Date startDate, Date endDate) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> getLearningRanking(Date statDate, Integer limit) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> getOverallLearningStatistics(Date startDate, Date endDate) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> getUserLearningStatistics(String userID, Date startDate, Date endDate) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> saveLearningStatistics(TbLearningStatistics statistics) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningStatistics> updateLearningStatistics(String userID, Date statDate,
|
||||
Integer totalDuration, Integer resourceCount, Integer courseCount, Integer completeCount) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package org.xyzh.study.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.study.TbLearningTask;
|
||||
import org.xyzh.common.dto.study.TbTaskUser;
|
||||
import org.xyzh.common.dto.study.TbTaskCourse;
|
||||
import org.xyzh.common.dto.study.TbTaskResource;
|
||||
import org.xyzh.study.mapper.LearningTaskMapper;
|
||||
import org.xyzh.study.mapper.TaskUserMapper;
|
||||
import org.xyzh.study.mapper.TaskCourseMapper;
|
||||
import org.xyzh.study.mapper.TaskResourceMapper;
|
||||
import org.xyzh.api.study.task.LearningTaskService;
|
||||
|
||||
/**
|
||||
* @description 学习任务服务实现类
|
||||
* @filename SCLearningTaskServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class SCLearningTaskServiceImpl implements LearningTaskService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SCLearningTaskServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private LearningTaskMapper learningTaskMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskUserMapper taskUserMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskCourseMapper taskCourseMapper;
|
||||
|
||||
@Autowired
|
||||
private TaskResourceMapper taskResourceMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskCourse> addTaskCourse(TbTaskCourse taskCourse) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskResource> addTaskResource(TbTaskResource taskResource) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskUser> addTaskUser(TbTaskUser taskUser) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskUser> batchAddTaskUsers(String taskID, List<String> userIDs, String deptID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningTask> createTask(TbLearningTask task) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteTask(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningTask> getTaskById(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskCourse> getTaskCourses(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningTask> getTaskList(TbLearningTask filter) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskResource> getTaskResources(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskUser> getTaskUsers(String taskID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeTaskCourse(String taskID, String courseID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeTaskResource(String taskID, String resourceID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeTaskUser(String taskID, String userID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningTask> updateTask(TbLearningTask task) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbLearningTask> updateTaskStatus(String taskID, Integer status) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbTaskUser> updateTaskUserStatus(String taskID, String userID, Integer status,
|
||||
BigDecimal progress) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
package org.xyzh.system.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.resource.TbBanner;
|
||||
import org.xyzh.common.dto.resource.TbResourceRecommend;
|
||||
import org.xyzh.common.dto.resource.TbTag;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 运营管理控制器
|
||||
* @filename OperationController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/operation")
|
||||
public class OperationController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(OperationController.class);
|
||||
|
||||
// ==================== Banner管理 ====================
|
||||
|
||||
/**
|
||||
* 获取Banner列表
|
||||
*/
|
||||
@GetMapping("/banner/list")
|
||||
public ResultDomain<TbBanner> getBannerList() {
|
||||
// TODO: 实现获取Banner列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加Banner
|
||||
*/
|
||||
@PostMapping("/banner/add")
|
||||
public ResultDomain<TbBanner> addBanner(@RequestBody TbBanner banner) {
|
||||
// TODO: 实现添加Banner(上传图片、设置链接)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新Banner
|
||||
*/
|
||||
@PutMapping("/banner/update")
|
||||
public ResultDomain<TbBanner> updateBanner(@RequestBody TbBanner banner) {
|
||||
// TODO: 实现更新Banner
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Banner
|
||||
*/
|
||||
@DeleteMapping("/banner/{bannerID}")
|
||||
public ResultDomain<Boolean> deleteBanner(@PathVariable String bannerID) {
|
||||
// TODO: 实现删除Banner
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整Banner排序
|
||||
*/
|
||||
@PutMapping("/banner/sort")
|
||||
public ResultDomain<Boolean> sortBanners(@RequestBody List<Map<String, Object>> bannerOrders) {
|
||||
// TODO: 实现调整Banner排序
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传Banner图片
|
||||
*/
|
||||
@PostMapping("/banner/upload-image")
|
||||
public ResultDomain<String> uploadBannerImage(@RequestParam("file") String file) {
|
||||
// TODO: 实现上传Banner图片
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 资源推荐管理 ====================
|
||||
|
||||
/**
|
||||
* 获取TOP资源推荐列表
|
||||
*/
|
||||
@GetMapping("/recommend/top-list")
|
||||
public ResultDomain<TbResourceRecommend> getTopRecommendList() {
|
||||
// TODO: 实现获取TOP资源推荐列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动调整推荐排序
|
||||
*/
|
||||
@PutMapping("/recommend/sort")
|
||||
public ResultDomain<Boolean> sortRecommendations(@RequestBody List<Map<String, Object>> recommendOrders) {
|
||||
// TODO: 实现手动调整TOP资源推荐列表(上下移动排序)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加推荐资源
|
||||
*/
|
||||
@PostMapping("/recommend/add")
|
||||
public ResultDomain<TbResourceRecommend> addRecommendResource(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现添加推荐资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除推荐资源
|
||||
*/
|
||||
@DeleteMapping("/recommend/remove/{resourceID}")
|
||||
public ResultDomain<Boolean> removeRecommendResource(@PathVariable String resourceID) {
|
||||
// TODO: 实现移除推荐资源
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新推荐状态
|
||||
*/
|
||||
@PutMapping("/recommend/batch-update")
|
||||
public ResultDomain<Boolean> batchUpdateRecommendStatus(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现批量更新推荐状态
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 标签管理 ====================
|
||||
|
||||
/**
|
||||
* 获取标签列表
|
||||
*/
|
||||
@GetMapping("/tag/list")
|
||||
public ResultDomain<TbTag> getTagList() {
|
||||
// TODO: 实现获取标签列表
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建自定义标签
|
||||
*/
|
||||
@PostMapping("/tag/create")
|
||||
public ResultDomain<TbTag> createTag(@RequestBody TbTag tag) {
|
||||
// TODO: 实现创建自定义数据标签
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新标签
|
||||
*/
|
||||
@PutMapping("/tag/update")
|
||||
public ResultDomain<TbTag> updateTag(@RequestBody TbTag tag) {
|
||||
// TODO: 实现更新标签
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除标签
|
||||
*/
|
||||
@DeleteMapping("/tag/{tagID}")
|
||||
public ResultDomain<Boolean> deleteTag(@PathVariable String tagID) {
|
||||
// TODO: 实现删除标签
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联标签到资源
|
||||
*/
|
||||
@PostMapping("/tag/link-resource")
|
||||
public ResultDomain<Boolean> linkTagToResource(@RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现标签关联资源/课程
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按标签筛选数据
|
||||
*/
|
||||
@GetMapping("/tag/filter")
|
||||
public ResultDomain<Map<String, Object>> filterByTag(@RequestParam String tagID) {
|
||||
// TODO: 实现按标签筛选数据
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标签使用统计
|
||||
*/
|
||||
@GetMapping("/tag/statistics")
|
||||
public ResultDomain<Map<String, Object>> getTagStatistics() {
|
||||
// TODO: 实现获取标签使用统计
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.xyzh.system.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 系统总览控制器
|
||||
* @filename SystemOverviewController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/overview")
|
||||
public class SystemOverviewController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SystemOverviewController.class);
|
||||
|
||||
/**
|
||||
* 获取系统总览数据统计
|
||||
*/
|
||||
@GetMapping("/statistics")
|
||||
public ResultDomain<Map<String, Object>> getSystemStatistics() {
|
||||
// TODO: 实现获取系统总览数据统计
|
||||
// 统计系统总用户数、资源总数、今日访问量
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活跃用户图表数据
|
||||
*/
|
||||
@GetMapping("/active-users")
|
||||
public ResultDomain<Map<String, Object>> getActiveUsersChart(
|
||||
@RequestParam(required = false) Integer days) {
|
||||
// TODO: 实现获取活跃用户图表数据(折线图,展示7/30天活跃用户数)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源分类统计图表
|
||||
*/
|
||||
@GetMapping("/resource-category-stats")
|
||||
public ResultDomain<Map<String, Object>> getResourceCategoryStats() {
|
||||
// TODO: 实现获取资源分类统计(饼图,展示各类型资源占比)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户活跃度数据
|
||||
*/
|
||||
@GetMapping("/user-activity")
|
||||
public ResultDomain<Map<String, Object>> getUserActivityData() {
|
||||
// TODO: 实现获取用户活跃度数据
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今日访问量统计
|
||||
*/
|
||||
@GetMapping("/today-visits")
|
||||
public ResultDomain<Map<String, Object>> getTodayVisits() {
|
||||
// TODO: 实现获取今日访问量统计
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统运行状态
|
||||
*/
|
||||
@GetMapping("/system-status")
|
||||
public ResultDomain<Map<String, Object>> getSystemStatus() {
|
||||
// TODO: 实现获取系统运行状态
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import org.xyzh.common.dto.user.TbSysUserInfo;
|
||||
import org.xyzh.common.vo.UserDeptRoleVO;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
|
||||
/**
|
||||
@@ -133,37 +134,29 @@ public class UserController {
|
||||
|
||||
|
||||
|
||||
// ---------------- 用户信息 ----------------
|
||||
// ---------------- 系统级用户信息管理 ----------------
|
||||
|
||||
/**
|
||||
* @description 获取用户信息
|
||||
* @param loginDomain
|
||||
* @description 管理员获取用户信息
|
||||
* @param userID 用户ID
|
||||
* @author yslg
|
||||
* @ since 2025-10-06
|
||||
*/
|
||||
@GetMapping("/userinfo")
|
||||
public ResultDomain<TbSysUserInfo> getUserInfo(@HttpLogin LoginDomain loginDomain){
|
||||
ResultDomain<TbSysUserInfo> result = new ResultDomain<>();
|
||||
|
||||
logger.info("loginDomain: {}", loginDomain);
|
||||
String userID = loginDomain.getUser().getID();
|
||||
ResultDomain<TbSysUserInfo> userInfo = userService.getUserInfoById(userID);
|
||||
result.setData(userInfo.getData());
|
||||
return result;
|
||||
@GetMapping("/admin/userinfo/{userID}")
|
||||
public ResultDomain<TbSysUserInfo> getAdminUserInfo(@PathVariable String userID){
|
||||
return userService.getUserInfoById(userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 更新用户信息
|
||||
* @description 管理员更新用户信息
|
||||
* @param userInfo
|
||||
* @author yslg
|
||||
* @ since 2025-10-06
|
||||
*/
|
||||
@PutMapping("/userinfo")
|
||||
public ResultDomain<TbSysUserInfo> updateUserInfo(@HttpLogin LoginDomain loginDomain, @RequestBody TbSysUserInfo userInfo) {
|
||||
userInfo.setUserID(loginDomain.getUser().getID());
|
||||
@PutMapping("/admin/userinfo")
|
||||
public ResultDomain<TbSysUserInfo> updateAdminUserInfo(@RequestBody TbSysUserInfo userInfo) {
|
||||
return userService.updateUserInfo(userInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<result column="parent_id" property="parentID" jdbcType="VARCHAR"/>
|
||||
<result column="url" property="url" jdbcType="VARCHAR"/>
|
||||
<result column="component" property="component" jdbcType="VARCHAR"/>
|
||||
<result column="layout" property="layout" jdbcType="VARCHAR"/>
|
||||
<result column="icon" property="icon" jdbcType="VARCHAR"/>
|
||||
<result column="order_num" property="orderNum" jdbcType="INTEGER"/>
|
||||
<result column="type" property="type" jdbcType="INTEGER"/>
|
||||
@@ -23,7 +24,7 @@
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
m.id, m.menu_id, m.name, m.parent_id, m.url, m.component, m.icon, m.order_num, m.type,
|
||||
m.id, m.menu_id, m.name, m.parent_id, m.url, m.component, m.layout, m.icon, m.order_num, m.type,
|
||||
m.creator, m.updater, m.create_time, m.update_time, m.delete_time, m.deleted
|
||||
</sql>
|
||||
|
||||
@@ -169,6 +170,8 @@
|
||||
<if test="url != null">url,</if>
|
||||
<if test="component != null">component,</if>
|
||||
<if test="icon != null">icon,</if>
|
||||
<if test="layout != null">layout,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
<if test="creator != null">creator,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
deleted
|
||||
@@ -182,6 +185,8 @@
|
||||
<if test="url != null">#{url},</if>
|
||||
<if test="component != null">#{component},</if>
|
||||
<if test="icon != null">#{icon},</if>
|
||||
<if test="layout != null">#{layout},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
<if test="creator != null">#{creator},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
0
|
||||
@@ -199,6 +204,8 @@
|
||||
<if test="url != null">url = #{url},</if>
|
||||
<if test="component != null">component = #{component},</if>
|
||||
<if test="icon != null">icon = #{icon},</if>
|
||||
<if test="layout != null">layout = #{layout},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
<if test="updater != null">updater = #{updater},</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.xyzh.usercenter.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.usercenter.achievement.UserAchievementService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbAchievement;
|
||||
import org.xyzh.common.dto.usercenter.TbUserAchievement;
|
||||
|
||||
/**
|
||||
* @description 用户成就控制器
|
||||
* @filename UserAchievementController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usercenter/achievement")
|
||||
public class UserAchievementController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserAchievementController.class);
|
||||
|
||||
@Autowired
|
||||
private UserAchievementService userAchievementService;
|
||||
|
||||
/**
|
||||
* 获取所有成就列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ResultDomain<TbAchievement> getAllAchievements(
|
||||
@RequestParam(required = false) Integer type,
|
||||
@RequestParam(required = false) Integer level) {
|
||||
return userAchievementService.getAllAchievements(type, level);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户已获得的成就
|
||||
*/
|
||||
@GetMapping("/user/{userID}")
|
||||
public ResultDomain<TbUserAchievement> getUserAchievements(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer type) {
|
||||
return userAchievementService.getUserAchievements(userID, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否已获得成就
|
||||
*/
|
||||
@GetMapping("/check/{userID}/{achievementID}")
|
||||
public ResultDomain<Boolean> hasAchievement(
|
||||
@PathVariable String userID,
|
||||
@PathVariable String achievementID) {
|
||||
return userAchievementService.hasAchievement(userID, achievementID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 授予用户成就
|
||||
*/
|
||||
@PostMapping("/grant")
|
||||
public ResultDomain<TbUserAchievement> grantAchievement(
|
||||
@RequestParam String userID,
|
||||
@RequestParam String achievementID) {
|
||||
return userAchievementService.grantAchievement(userID, achievementID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取成就详情
|
||||
*/
|
||||
@GetMapping("/detail/{achievementID}")
|
||||
public ResultDomain<TbAchievement> getAchievementDetail(@PathVariable String achievementID) {
|
||||
return userAchievementService.getAchievementDetail(achievementID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否满足成就条件
|
||||
*/
|
||||
@GetMapping("/condition/{userID}/{achievementID}")
|
||||
public ResultDomain<Boolean> checkAchievementCondition(
|
||||
@PathVariable String userID,
|
||||
@PathVariable String achievementID) {
|
||||
return userAchievementService.checkAchievementCondition(userID, achievementID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.xyzh.usercenter.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.usercenter.browse.UserBrowseRecordService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserBrowseRecord;
|
||||
|
||||
/**
|
||||
* @description 用户浏览记录控制器
|
||||
* @filename UserBrowseRecordController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usercenter/browse")
|
||||
public class UserBrowseRecordController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserBrowseRecordController.class);
|
||||
|
||||
@Autowired
|
||||
private UserBrowseRecordService userBrowseRecordService;
|
||||
|
||||
/**
|
||||
* 获取用户浏览记录
|
||||
*/
|
||||
@GetMapping("/user/{userID}")
|
||||
public ResultDomain<TbUserBrowseRecord> getUserBrowseRecords(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer resourceType,
|
||||
@RequestParam(required = false) Integer limit) {
|
||||
return userBrowseRecordService.getUserBrowseRecords(userID, resourceType, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加浏览记录
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResultDomain<TbUserBrowseRecord> addBrowseRecord(@RequestBody TbUserBrowseRecord browseRecord) {
|
||||
return userBrowseRecordService.addBrowseRecord(browseRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空浏览记录
|
||||
*/
|
||||
@DeleteMapping("/clear/{userID}")
|
||||
public ResultDomain<Boolean> clearBrowseRecords(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer resourceType) {
|
||||
return userBrowseRecordService.clearUserBrowseRecords(userID, resourceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取浏览数量
|
||||
*/
|
||||
@GetMapping("/count/{userID}")
|
||||
public ResultDomain<Integer> getBrowseCount(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer resourceType) {
|
||||
return userBrowseRecordService.getBrowseCount(userID, resourceType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package org.xyzh.usercenter.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.api.usercenter.collection.UserCollectionService;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserCollection;
|
||||
|
||||
/**
|
||||
* @description 用户收藏控制器
|
||||
* @filename UserCollectionController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usercenter/collection")
|
||||
public class UserCollectionController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserCollectionController.class);
|
||||
|
||||
@Autowired
|
||||
private UserCollectionService userCollectionService;
|
||||
|
||||
/**
|
||||
* 获取用户收藏列表
|
||||
*/
|
||||
@GetMapping("/user/{userID}")
|
||||
public ResultDomain<TbUserCollection> getUserCollections(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer resourceType,
|
||||
@RequestParam(required = false) String resourceID) {
|
||||
return userCollectionService.getUserCollections(userID, resourceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加收藏
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResultDomain<TbUserCollection> addCollection(@RequestBody TbUserCollection userCollection) {
|
||||
return userCollectionService.addCollection(userCollection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
*/
|
||||
@DeleteMapping("/remove")
|
||||
public ResultDomain<Boolean> removeCollection(
|
||||
@RequestParam String userID,
|
||||
@RequestParam String resourceID,
|
||||
@RequestParam Integer resourceType) {
|
||||
return userCollectionService.removeCollection(userID, resourceType, resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否已收藏
|
||||
*/
|
||||
@GetMapping("/check")
|
||||
public ResultDomain<Boolean> isCollected(
|
||||
@RequestParam String userID,
|
||||
@RequestParam String resourceID,
|
||||
@RequestParam Integer resourceType) {
|
||||
return userCollectionService.isCollected(userID, resourceType, resourceID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏数量
|
||||
*/
|
||||
@GetMapping("/count/{userID}")
|
||||
public ResultDomain<Integer> getCollectionCount(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer resourceType,
|
||||
@RequestParam(required = false) String resourceID) {
|
||||
return userCollectionService.getCollectionCount(userID, resourceType, resourceID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package org.xyzh.usercenter.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserPoints;
|
||||
import org.xyzh.common.dto.usercenter.TbPointsRecord;
|
||||
import org.xyzh.usercenter.service.UCUserPointsService;
|
||||
|
||||
/**
|
||||
* @description 用户积分控制器
|
||||
* @filename UserPointsController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usercenter/points")
|
||||
public class UserPointsController {
|
||||
|
||||
@Autowired
|
||||
private UCUserPointsService userPointsService;
|
||||
|
||||
/**
|
||||
* 获取用户积分信息
|
||||
*/
|
||||
@GetMapping("/user/{userID}")
|
||||
public ResultDomain<TbUserPoints> getUserPoints(@PathVariable String userID) {
|
||||
return userPointsService.getUserPoints(userID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户积分
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public ResultDomain<TbUserPoints> updateUserPoints(@RequestBody TbUserPoints userPoints) {
|
||||
return userPointsService.updateUserPoints(userPoints);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加用户积分
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public ResultDomain<TbUserPoints> addUserPoints(
|
||||
@RequestParam String userID,
|
||||
@RequestParam Integer points,
|
||||
@RequestParam Integer sourceType,
|
||||
@RequestParam String sourceID,
|
||||
@RequestParam(required = false) String description) {
|
||||
return userPointsService.addUserPoints(userID, points, sourceType, sourceID, description);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消费用户积分
|
||||
*/
|
||||
@PostMapping("/consume")
|
||||
public ResultDomain<TbUserPoints> consumeUserPoints(
|
||||
@RequestParam String userID,
|
||||
@RequestParam Integer points,
|
||||
@RequestParam Integer sourceType,
|
||||
@RequestParam String sourceID,
|
||||
@RequestParam(required = false) String description) {
|
||||
return userPointsService.consumeUserPoints(userID, points, sourceType, sourceID, description);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户积分记录
|
||||
*/
|
||||
@GetMapping("/records/{userID}")
|
||||
public ResultDomain<TbPointsRecord> getPointsRecords(
|
||||
@PathVariable String userID,
|
||||
@RequestParam(required = false) Integer type,
|
||||
@RequestParam(required = false) Integer sourceType) {
|
||||
return userPointsService.getPointsRecords(userID, type, sourceType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加积分记录
|
||||
*/
|
||||
@PostMapping("/record")
|
||||
public ResultDomain<TbPointsRecord> addPointsRecord(@RequestBody TbPointsRecord pointsRecord) {
|
||||
return userPointsService.addPointsRecord(pointsRecord);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
package org.xyzh.usercenter.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.user.TbSysUserInfo;
|
||||
import org.xyzh.common.annotation.HttpLogin;
|
||||
import org.xyzh.common.core.domain.LoginDomain;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @description 个人中心控制器
|
||||
* @filename UserProfileController.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usercenter/profile")
|
||||
public class UserProfileController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UserProfileController.class);
|
||||
|
||||
// ==================== 个人信息管理 ====================
|
||||
|
||||
/**
|
||||
* 获取个人信息
|
||||
*/
|
||||
@GetMapping("/info")
|
||||
public ResultDomain<TbSysUserInfo> getUserProfile(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现获取个人信息
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新个人信息
|
||||
*/
|
||||
@PutMapping("/info/update")
|
||||
public ResultDomain<TbSysUserInfo> updateUserProfile(@HttpLogin LoginDomain loginDomain, @RequestBody TbSysUserInfo userInfo) {
|
||||
// TODO: 实现更新个人信息(姓名、部门、联系方式等)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传用户头像
|
||||
*/
|
||||
@PostMapping("/avatar/upload")
|
||||
public ResultDomain<String> uploadAvatar(@RequestParam("file") String file) {
|
||||
// TODO: 实现上传用户头像
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户头像
|
||||
*/
|
||||
@PutMapping("/avatar/update")
|
||||
public ResultDomain<String> updateAvatar(@HttpLogin LoginDomain loginDomain, @RequestParam String avatarUrl) {
|
||||
// TODO: 实现更新用户头像
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 账号设置 ====================
|
||||
|
||||
/**
|
||||
* 修改密码
|
||||
*/
|
||||
@PutMapping("/password/change")
|
||||
public ResultDomain<Boolean> changePassword(@HttpLogin LoginDomain loginDomain, @RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现修改密码
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
*/
|
||||
@PutMapping("/phone/bind")
|
||||
public ResultDomain<Boolean> bindPhone(@HttpLogin LoginDomain loginDomain, @RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现绑定手机号
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定邮箱
|
||||
*/
|
||||
@PutMapping("/email/bind")
|
||||
public ResultDomain<Boolean> bindEmail(@HttpLogin LoginDomain loginDomain, @RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现绑定邮箱
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑手机号
|
||||
*/
|
||||
@PutMapping("/phone/unbind")
|
||||
public ResultDomain<Boolean> unbindPhone(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现解绑手机号
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解绑邮箱
|
||||
*/
|
||||
@PutMapping("/email/unbind")
|
||||
public ResultDomain<Boolean> unbindEmail(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现解绑邮箱
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请账号注销
|
||||
*/
|
||||
@PostMapping("/account/delete-request")
|
||||
public ResultDomain<Boolean> requestAccountDeletion(@HttpLogin LoginDomain loginDomain, @RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现申请账号注销
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号安全信息
|
||||
*/
|
||||
@GetMapping("/security/info")
|
||||
public ResultDomain<Map<String, Object>> getSecurityInfo(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现获取账号安全信息
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证身份信息
|
||||
*/
|
||||
@PostMapping("/security/verify")
|
||||
public ResultDomain<Boolean> verifyIdentity(@HttpLogin LoginDomain loginDomain, @RequestBody Map<String, Object> params) {
|
||||
// TODO: 实现验证身份信息
|
||||
return null;
|
||||
}
|
||||
|
||||
// ==================== 学习记录统计 ====================
|
||||
|
||||
/**
|
||||
* 获取学习记录统计
|
||||
*/
|
||||
@GetMapping("/learning/statistics")
|
||||
public ResultDomain<Map<String, Object>> getLearningStatistics(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现获取学习记录统计(折线图展示每日学习时长,柱状图展示各资源学习次数)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按时间筛选学习记录
|
||||
*/
|
||||
@GetMapping("/learning/filter")
|
||||
public ResultDomain<Map<String, Object>> filterLearningRecords(
|
||||
@HttpLogin LoginDomain loginDomain,
|
||||
@RequestParam(required = false) String timeRange) {
|
||||
// TODO: 实现按时间筛选学习记录(周/月)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学习时长图表数据
|
||||
*/
|
||||
@GetMapping("/learning/duration-chart")
|
||||
public ResultDomain<Map<String, Object>> getLearningDurationChart(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现获取学习时长图表数据(折线图)
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取资源学习次数图表数据
|
||||
*/
|
||||
@GetMapping("/learning/resource-chart")
|
||||
public ResultDomain<Map<String, Object>> getResourceLearningChart(@HttpLogin LoginDomain loginDomain) {
|
||||
// TODO: 实现获取资源学习次数图表数据(柱状图)
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.usercenter.service;
|
||||
|
||||
import org.xyzh.api.usercenter.achievement.UserAchievementService;
|
||||
|
||||
/**
|
||||
* @description 用户成就服务接口
|
||||
* @filename UCUserAchievementService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UCUserAchievementService extends UserAchievementService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.usercenter.service;
|
||||
|
||||
import org.xyzh.api.usercenter.browse.UserBrowseRecordService;
|
||||
|
||||
/**
|
||||
* @description 用户浏览记录服务接口
|
||||
* @filename UCUserBrowseRecordService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UCUserBrowseRecordService extends UserBrowseRecordService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.usercenter.service;
|
||||
|
||||
import org.xyzh.api.usercenter.collection.UserCollectionService;
|
||||
|
||||
/**
|
||||
* @description 用户收藏服务接口
|
||||
* @filename UCUserCollectionService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UCUserCollectionService extends UserCollectionService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.xyzh.usercenter.service;
|
||||
|
||||
import org.xyzh.api.usercenter.points.UserPointsService;
|
||||
|
||||
/**
|
||||
* @description 用户积分服务接口
|
||||
* @filename UCUserPointsService.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
public interface UCUserPointsService extends UserPointsService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.xyzh.usercenter.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbAchievement;
|
||||
import org.xyzh.common.dto.usercenter.TbUserAchievement;
|
||||
import org.xyzh.usercenter.mapper.AchievementMapper;
|
||||
import org.xyzh.usercenter.mapper.UserAchievementMapper;
|
||||
import org.xyzh.usercenter.service.UCUserAchievementService;
|
||||
|
||||
/**
|
||||
* @description 用户成就服务实现类
|
||||
* @filename UCUserAchievementServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class UCUserAchievementServiceImpl implements UCUserAchievementService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UCUserAchievementServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private AchievementMapper achievementMapper;
|
||||
|
||||
@Autowired
|
||||
private UserAchievementMapper userAchievementMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbAchievement> getAllAchievements(Integer type, Integer level) {
|
||||
// TODO: 实现获取所有成就列表
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserAchievement> getUserAchievements(String userID, Integer type) {
|
||||
// TODO: 实现获取用户已获得的成就
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> hasAchievement(String userID, String achievementID) {
|
||||
// TODO: 实现检查用户是否已获得成就
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserAchievement> grantAchievement(String userID, String achievementID) {
|
||||
// TODO: 实现授予用户成就
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbAchievement> getAchievementDetail(String achievementID) {
|
||||
// TODO: 实现获取成就详情
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> checkAchievementCondition(String userID, String achievementID) {
|
||||
// TODO: 实现检查用户是否满足成就条件
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package org.xyzh.usercenter.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserBrowseRecord;
|
||||
import org.xyzh.usercenter.mapper.UserBrowseRecordMapper;
|
||||
import org.xyzh.usercenter.service.UCUserBrowseRecordService;
|
||||
|
||||
/**
|
||||
* @description 用户浏览记录服务实现类
|
||||
* @filename UCUserBrowseRecordServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class UCUserBrowseRecordServiceImpl implements UCUserBrowseRecordService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UCUserBrowseRecordServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private UserBrowseRecordMapper userBrowseRecordMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserBrowseRecord> addBrowseRecord(TbUserBrowseRecord browseRecord) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> clearUserBrowseRecords(String userID, Integer browseType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> deleteBrowseRecord(String recordID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Integer> getBrowseCount(String userID, Integer browseType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserBrowseRecord> getUserBrowseRecords(String userID, Integer browseType, Integer limit) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package org.xyzh.usercenter.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserCollection;
|
||||
import org.xyzh.usercenter.mapper.UserCollectionMapper;
|
||||
import org.xyzh.usercenter.service.UCUserCollectionService;
|
||||
|
||||
/**
|
||||
* @description 用户收藏服务实现类
|
||||
* @filename UCUserCollectionServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class UCUserCollectionServiceImpl implements UCUserCollectionService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UCUserCollectionServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private UserCollectionMapper userCollectionMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserCollection> addCollection(TbUserCollection userCollection) {
|
||||
// TODO: 实现添加收藏
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserCollection> getCollectionDetail(String userID, Integer collectionType,
|
||||
String collectionID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserCollection> getUserCollections(String userID, Integer collectionType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> isCollected(String userID, Integer collectionType, String collectionID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Boolean> removeCollection(String userID, Integer collectionType, String collectionID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<Integer> getCollectionCount(String userID, Integer collectionType, String collectionID) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.xyzh.usercenter.service.impl;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.usercenter.TbUserPoints;
|
||||
import org.xyzh.common.dto.usercenter.TbPointsRecord;
|
||||
import org.xyzh.usercenter.mapper.UserPointsMapper;
|
||||
import org.xyzh.usercenter.mapper.PointsRecordMapper;
|
||||
import org.xyzh.usercenter.service.UCUserPointsService;
|
||||
|
||||
/**
|
||||
* @description 用户积分服务实现类
|
||||
* @filename UCUserPointsServiceImpl.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Service
|
||||
public class UCUserPointsServiceImpl implements UCUserPointsService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(UCUserPointsServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private UserPointsMapper userPointsMapper;
|
||||
|
||||
@Autowired
|
||||
private PointsRecordMapper pointsRecordMapper;
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserPoints> getUserPoints(String userID) {
|
||||
// TODO: 实现获取用户积分信息
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserPoints> updateUserPoints(TbUserPoints userPoints) {
|
||||
// TODO: 实现更新用户积分
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserPoints> addUserPoints(String userID, Integer points, Integer sourceType, String sourceID, String description) {
|
||||
// TODO: 实现增加用户积分
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbUserPoints> consumeUserPoints(String userID, Integer points, Integer sourceType, String sourceID, String description) {
|
||||
// TODO: 实现消费用户积分
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbPointsRecord> getPointsRecords(String userID, Integer type, Integer sourceType) {
|
||||
// TODO: 实现获取用户积分记录
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultDomain<TbPointsRecord> addPointsRecord(TbPointsRecord pointsRecord) {
|
||||
// TODO: 实现添加积分记录
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user