Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
aca464739b
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 课程分类管理
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -48,7 +48,7 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门
|
* 新增课程分类
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add/{parentId}")
|
@GetMapping("/add/{parentId}")
|
||||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||||
|
|
@ -58,9 +58,9 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门
|
* 新增保存课程分类
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
@Log(title = "课程分类管理", businessType = BusinessType.INSERT)
|
||||||
@RequiresPermissions("train:course:category:add")
|
@RequiresPermissions("train:course:category:add")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -88,7 +88,7 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "课程分类管理", businessType = BusinessType.UPDATE)
|
||||||
@RequiresPermissions("train:course:category:edit")
|
@RequiresPermissions("train:course:category:edit")
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -101,7 +101,7 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "课程分类管理", businessType = BusinessType.DELETE)
|
||||||
@RequiresPermissions("train:course:category:remove")
|
@RequiresPermissions("train:course:category:remove")
|
||||||
@PostMapping("/remove/{deptId}")
|
@PostMapping("/remove/{deptId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -109,17 +109,17 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
{
|
{
|
||||||
if (trainCourseCategoryService.selectDeptCount(deptId) > 0)
|
if (trainCourseCategoryService.selectDeptCount(deptId) > 0)
|
||||||
{
|
{
|
||||||
return error(1, "存在下级部门,不允许删除");
|
return error(1, "存在下级课程分类,不允许删除");
|
||||||
}
|
}
|
||||||
if (trainCourseCategoryService.checkDeptExistUser(deptId))
|
if (trainCourseCategoryService.checkDeptExistUser(deptId))
|
||||||
{
|
{
|
||||||
return error(1, "部门存在用户,不允许删除");
|
return error(1, "课程分类存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(trainCourseCategoryService.deleteDeptById(deptId));
|
return toAjax(trainCourseCategoryService.deleteDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称
|
* 校验课程分类名称
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkDeptNameUnique")
|
@PostMapping("/checkDeptNameUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -129,7 +129,7 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择部门树
|
* 选择课程分类树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/selectDeptTree/{deptId}")
|
@GetMapping("/selectDeptTree/{deptId}")
|
||||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||||
|
|
@ -139,7 +139,7 @@ public class TrainCourseCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载部门列表树
|
* 加载课程分类列表树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData")
|
@GetMapping("/treeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表 sys_dept
|
* 课程分类表 sys_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -19,16 +19,16 @@ public class TrainCourseCategory extends BaseEntity
|
||||||
@Id
|
@Id
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 部门
|
* 课程分类
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
/** 父部门ID */
|
/** 父课程分类ID */
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
/** 祖级列表 */
|
/** 祖级列表 */
|
||||||
private String parentIds;
|
private String parentIds;
|
||||||
|
|
||||||
/** 部门名称 */
|
/** 课程分类名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
|
|
@ -37,7 +37,7 @@ public class TrainCourseCategory extends BaseEntity
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/** 父部门名称 */
|
/** 父课程分类名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
|
|
|
||||||
|
|
@ -7,56 +7,56 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 数据层
|
* 课程分类管理 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface TrainCourseCategoryMapper extends MyMapper<TrainCourseCategory>
|
public interface TrainCourseCategoryMapper extends MyMapper<TrainCourseCategory>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课程分类人数
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int selectDeptCount(TrainCourseCategory dept);
|
public int selectDeptCount(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课程分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int checkDeptExistUser(Long deptId);
|
public int checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课程分类管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 部门信息集合
|
* @return 课程分类信息集合
|
||||||
*/
|
*/
|
||||||
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课程分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门信息
|
* 新增课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(TrainCourseCategory dept);
|
public int insertDept(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改部门信息
|
* 修改课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(TrainCourseCategory dept);
|
public int updateDept(TrainCourseCategory dept);
|
||||||
|
|
@ -70,27 +70,27 @@ public interface TrainCourseCategoryMapper extends MyMapper<TrainCourseCategory>
|
||||||
public int updateDeptChildren(@Param("depts") List<TrainCourseCategory> depts);
|
public int updateDeptChildren(@Param("depts") List<TrainCourseCategory> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课程分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 部门信息
|
* @return 课程分类信息
|
||||||
*/
|
*/
|
||||||
public TrainCourseCategory selectDeptById(Long deptId);
|
public TrainCourseCategory selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课程分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param deptName 部门名称
|
* @param deptName 课程分类名称
|
||||||
* @param parentId 父部门ID
|
* @param parentId 父课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public TrainCourseCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
public TrainCourseCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门
|
* 根据角色ID查询课程分类
|
||||||
*
|
*
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 部门列表
|
* @return 课程分类列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectRoleDeptTree(Long roleId);
|
public List<String> selectRoleDeptTree(Long roleId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,81 +7,81 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 服务层
|
* 课程分类管理 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface ITrainCourseCategoryService extends AbstractBaseService<TrainCourseCategory>
|
public interface ITrainCourseCategoryService extends AbstractBaseService<TrainCourseCategory>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课程分类管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 部门信息集合
|
* @return 课程分类信息集合
|
||||||
*/
|
*/
|
||||||
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
public List<TrainCourseCategory> selectDeptList(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理树
|
* 查询课程分类管理树
|
||||||
*
|
*
|
||||||
* @return 所有部门信息
|
* @return 所有课程分类信息
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> selectDeptTree();
|
public List<Map<String, Object>> selectDeptTree();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课程分类人数
|
||||||
*
|
*
|
||||||
* @param parentId 父部门ID
|
* @param parentId 父课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int selectDeptCount(Long parentId);
|
public int selectDeptCount(Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课程分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
public boolean checkDeptExistUser(Long deptId);
|
public boolean checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课程分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(TrainCourseCategory dept);
|
public int insertDept(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(TrainCourseCategory dept);
|
public int updateDept(TrainCourseCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课程分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 部门信息
|
* @return 课程分类信息
|
||||||
*/
|
*/
|
||||||
public TrainCourseCategory selectDeptById(Long deptId);
|
public TrainCourseCategory selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课程分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDeptNameUnique(TrainCourseCategory dept);
|
public String checkDeptNameUnique(TrainCourseCategory dept);
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,20 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 服务实现
|
* 课程分类管理 服务实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<TrainCourseCategoryMapper, TrainCourseCategory> implements ITrainCourseCategoryService {
|
public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<TrainCourseCategoryMapper, TrainCourseCategory> implements ITrainCourseCategoryService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TrainCourseCategoryMapper trainCourseCategoryMapper;
|
private TrainCourseCategoryMapper trainCourseCategoryMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课程分类管理数据
|
||||||
*
|
*
|
||||||
* @return 部门信息集合
|
* @return 课程分类信息集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(tableAlias = "d")
|
@DataScope(tableAlias = "d")
|
||||||
|
|
@ -36,23 +38,22 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理树
|
* 查询课程分类管理树
|
||||||
*
|
*
|
||||||
* @return 所有部门信息
|
* @return 所有课程分类信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> selectDeptTree() {
|
public List<Map<String, Object>> selectDeptTree() {
|
||||||
List<Map<String, Object>> trees = new ArrayList<Map<String, Object>>();
|
|
||||||
List<TrainCourseCategory> deptList = selectDeptList( new TrainCourseCategory() );
|
List<TrainCourseCategory> deptList = selectDeptList( new TrainCourseCategory() );
|
||||||
trees = getTrees( deptList, false, null );
|
List<Map<String, Object>> trees = getTrees( deptList, false, null );
|
||||||
return trees;
|
return trees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象转部门树
|
* 对象转课程分类树
|
||||||
*
|
*
|
||||||
* @param deptList 部门列表
|
* @param deptList 课程分类列表
|
||||||
* @param isCheck 是否需要选中
|
* @param isCheck 是否需要选中
|
||||||
* @param roleDeptList 角色已存在菜单列表
|
* @param roleDeptList 角色已存在菜单列表
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -79,9 +80,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课程分类人数
|
||||||
*
|
*
|
||||||
* @param parentId 部门ID
|
* @param parentId 课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -92,9 +93,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课程分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -104,9 +105,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课程分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -115,9 +116,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -128,9 +129,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存课程分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -147,7 +148,7 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
/**
|
/**
|
||||||
* 修改子元素关系
|
* 修改子元素关系
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @param ancestors 元素列表
|
* @param ancestors 元素列表
|
||||||
*/
|
*/
|
||||||
public void updateDeptChildren(Long deptId, String ancestors) {
|
public void updateDeptChildren(Long deptId, String ancestors) {
|
||||||
|
|
@ -163,10 +164,10 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课程分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课程分类ID
|
||||||
* @return 部门信息
|
* @return 课程分类信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TrainCourseCategory selectDeptById(Long deptId) {
|
public TrainCourseCategory selectDeptById(Long deptId) {
|
||||||
|
|
@ -174,9 +175,9 @@ public class TrainCourseCategoryServiceImpl extends AbstractBaseServiceImpl<Trai
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课程分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课程分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门信息
|
* 课件分类信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -48,7 +48,7 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门
|
* 新增课件分类
|
||||||
*/
|
*/
|
||||||
@GetMapping("/add/{parentId}")
|
@GetMapping("/add/{parentId}")
|
||||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||||
|
|
@ -58,9 +58,9 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门
|
* 新增保存课件分类
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.INSERT)
|
@Log(title = "课件分类管理", businessType = BusinessType.INSERT)
|
||||||
@RequiresPermissions("train:courseware:category:add")
|
@RequiresPermissions("train:courseware:category:add")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -88,7 +88,7 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "课件分类管理", businessType = BusinessType.UPDATE)
|
||||||
@RequiresPermissions("train:courseware:category:edit")
|
@RequiresPermissions("train:courseware:category:edit")
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -101,7 +101,7 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@Log(title = "部门管理", businessType = BusinessType.DELETE)
|
@Log(title = "课件分类管理", businessType = BusinessType.DELETE)
|
||||||
@RequiresPermissions("train:courseware:category:remove")
|
@RequiresPermissions("train:courseware:category:remove")
|
||||||
@PostMapping("/remove/{deptId}")
|
@PostMapping("/remove/{deptId}")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -109,17 +109,17 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
{
|
{
|
||||||
if (trainCoursewareCategoryService.selectDeptCount(deptId) > 0)
|
if (trainCoursewareCategoryService.selectDeptCount(deptId) > 0)
|
||||||
{
|
{
|
||||||
return error(1, "存在下级部门,不允许删除");
|
return error(1, "存在下级课件分类,不允许删除");
|
||||||
}
|
}
|
||||||
if (trainCoursewareCategoryService.checkDeptExistUser(deptId))
|
if (trainCoursewareCategoryService.checkDeptExistUser(deptId))
|
||||||
{
|
{
|
||||||
return error(1, "部门存在用户,不允许删除");
|
return error(1, "课件分类存在用户,不允许删除");
|
||||||
}
|
}
|
||||||
return toAjax(trainCoursewareCategoryService.deleteDeptById(deptId));
|
return toAjax(trainCoursewareCategoryService.deleteDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称
|
* 校验课件分类名称
|
||||||
*/
|
*/
|
||||||
@PostMapping("/checkDeptNameUnique")
|
@PostMapping("/checkDeptNameUnique")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -129,7 +129,7 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择部门树
|
* 选择课件分类树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/selectDeptTree/{deptId}")
|
@GetMapping("/selectDeptTree/{deptId}")
|
||||||
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
public String selectDeptTree(@PathVariable("deptId") Long deptId, ModelMap mmap)
|
||||||
|
|
@ -139,7 +139,7 @@ public class TrainCoursewareCategoryController extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 加载部门列表树
|
* 加载课件分类列表树
|
||||||
*/
|
*/
|
||||||
@GetMapping("/treeData")
|
@GetMapping("/treeData")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.ruoyi.courseware.controller;
|
||||||
|
|
||||||
|
import com.aliyuncs.DefaultAcsClient;
|
||||||
|
import com.aliyuncs.exceptions.ClientException;
|
||||||
|
import com.aliyuncs.exceptions.ServerException;
|
||||||
|
import com.aliyuncs.profile.DefaultProfile;
|
||||||
|
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest;
|
||||||
|
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/train/courseware/video")
|
||||||
|
public class VideoController {
|
||||||
|
|
||||||
|
@GetMapping("")
|
||||||
|
public GetVideoPlayAuthResponse authority(){
|
||||||
|
DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", "LTAIo1i5PQB4pFme", "NyiVe3pqbVOMnwMQxnOkV39KrTx2jR");
|
||||||
|
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
GetVideoPlayAuthResponse response = getVideoPlayAuth(client);
|
||||||
|
System.out.println(response.getPlayAuth());
|
||||||
|
System.out.println(response.getVideoMeta());
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private GetVideoPlayAuthResponse getVideoPlayAuth(DefaultAcsClient client) {
|
||||||
|
GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();
|
||||||
|
request.setVideoId("ID3dbb151b73c34b678efff61d3d50d999");
|
||||||
|
GetVideoPlayAuthResponse response = null;
|
||||||
|
try {
|
||||||
|
response = client.getAcsResponse(request);
|
||||||
|
} catch (ServerException e) {
|
||||||
|
throw new RuntimeException("GetVideoPlayAuthRequest Server failed");
|
||||||
|
} catch (ClientException e) {
|
||||||
|
throw new RuntimeException("GetVideoPlayAuthRequest Client failed");
|
||||||
|
}
|
||||||
|
response.getPlayAuth(); // 播放凭证
|
||||||
|
response.getVideoMeta(); // 视频Meta信息
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门表 sys_dept
|
* 课件分类表 sys_dept
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -19,16 +19,16 @@ public class TrainCoursewareCategory extends BaseEntity
|
||||||
@Id
|
@Id
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
/**
|
||||||
* 部门
|
* 课件分类
|
||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
/** 父部门ID */
|
/** 父课件分类ID */
|
||||||
private Long parentId;
|
private Long parentId;
|
||||||
|
|
||||||
/** 祖级列表 */
|
/** 祖级列表 */
|
||||||
private String parentIds;
|
private String parentIds;
|
||||||
|
|
||||||
/** 部门名称 */
|
/** 课件分类名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
|
|
@ -37,7 +37,7 @@ public class TrainCoursewareCategory extends BaseEntity
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/** 父部门名称 */
|
/** 父课件分类名称 */
|
||||||
private String parentName;
|
private String parentName;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
|
|
|
||||||
|
|
@ -7,56 +7,56 @@ import org.apache.ibatis.annotations.Param;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 数据层
|
* 课件分类管理 数据层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface TrainCoursewareCategoryMapper extends MyMapper<TrainCoursewareCategory>
|
public interface TrainCoursewareCategoryMapper extends MyMapper<TrainCoursewareCategory>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课件分类人数
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int selectDeptCount(TrainCoursewareCategory dept);
|
public int selectDeptCount(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课件分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int checkDeptExistUser(Long deptId);
|
public int checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课件分类管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 部门信息集合
|
* @return 课件分类信息集合
|
||||||
*/
|
*/
|
||||||
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课件分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增部门信息
|
* 新增课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(TrainCoursewareCategory dept);
|
public int insertDept(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改部门信息
|
* 修改课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(TrainCoursewareCategory dept);
|
public int updateDept(TrainCoursewareCategory dept);
|
||||||
|
|
@ -70,27 +70,27 @@ public interface TrainCoursewareCategoryMapper extends MyMapper<TrainCoursewareC
|
||||||
public int updateDeptChildren(@Param("depts") List<TrainCoursewareCategory> depts);
|
public int updateDeptChildren(@Param("depts") List<TrainCoursewareCategory> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课件分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 部门信息
|
* @return 课件分类信息
|
||||||
*/
|
*/
|
||||||
public TrainCoursewareCategory selectDeptById(Long deptId);
|
public TrainCoursewareCategory selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课件分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param deptName 部门名称
|
* @param deptName 课件分类名称
|
||||||
* @param parentId 父部门ID
|
* @param parentId 父课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public TrainCoursewareCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
public TrainCoursewareCategory checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询部门
|
* 根据角色ID查询课件分类
|
||||||
*
|
*
|
||||||
* @param roleId 角色ID
|
* @param roleId 角色ID
|
||||||
* @return 部门列表
|
* @return 课件分类列表
|
||||||
*/
|
*/
|
||||||
public List<String> selectRoleDeptTree(Long roleId);
|
public List<String> selectRoleDeptTree(Long roleId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,81 +7,81 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 服务层
|
* 课件分类管理 服务层
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public interface ITrainCoursewareCategoryService extends AbstractBaseService<TrainCoursewareCategory>
|
public interface ITrainCoursewareCategoryService extends AbstractBaseService<TrainCoursewareCategory>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课件分类管理数据
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 部门信息集合
|
* @return 课件分类信息集合
|
||||||
*/
|
*/
|
||||||
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
public List<TrainCoursewareCategory> selectDeptList(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理树
|
* 查询课件分类管理树
|
||||||
*
|
*
|
||||||
* @return 所有部门信息
|
* @return 所有课件分类信息
|
||||||
*/
|
*/
|
||||||
public List<Map<String, Object>> selectDeptTree();
|
public List<Map<String, Object>> selectDeptTree();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课件分类人数
|
||||||
*
|
*
|
||||||
* @param parentId 父部门ID
|
* @param parentId 父课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int selectDeptCount(Long parentId);
|
public int selectDeptCount(Long parentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课件分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
public boolean checkDeptExistUser(Long deptId);
|
public boolean checkDeptExistUser(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课件分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteDeptById(Long deptId);
|
public int deleteDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertDept(TrainCoursewareCategory dept);
|
public int insertDept(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int updateDept(TrainCoursewareCategory dept);
|
public int updateDept(TrainCoursewareCategory dept);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课件分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 部门信息
|
* @return 课件分类信息
|
||||||
*/
|
*/
|
||||||
public TrainCoursewareCategory selectDeptById(Long deptId);
|
public TrainCoursewareCategory selectDeptById(Long deptId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课件分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public String checkDeptNameUnique(TrainCoursewareCategory dept);
|
public String checkDeptNameUnique(TrainCoursewareCategory dept);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门管理 服务实现
|
* 课件分类管理 服务实现
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
|
@ -25,9 +25,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
@Autowired
|
@Autowired
|
||||||
private TrainCoursewareCategoryMapper trainCoursewareCategoryMapper;
|
private TrainCoursewareCategoryMapper trainCoursewareCategoryMapper;
|
||||||
/**
|
/**
|
||||||
* 查询部门管理数据
|
* 查询课件分类管理数据
|
||||||
*
|
*
|
||||||
* @return 部门信息集合
|
* @return 课件分类信息集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@DataScope(tableAlias = "d")
|
@DataScope(tableAlias = "d")
|
||||||
|
|
@ -36,9 +36,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门管理树
|
* 查询课件分类管理树
|
||||||
*
|
*
|
||||||
* @return 所有部门信息
|
* @return 所有课件分类信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> selectDeptTree() {
|
public List<Map<String, Object>> selectDeptTree() {
|
||||||
|
|
@ -50,9 +50,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对象转部门树
|
* 对象转课件分类树
|
||||||
*
|
*
|
||||||
* @param deptList 部门列表
|
* @param deptList 课件分类列表
|
||||||
* @param isCheck 是否需要选中
|
* @param isCheck 是否需要选中
|
||||||
* @param roleDeptList 角色已存在菜单列表
|
* @param roleDeptList 角色已存在菜单列表
|
||||||
* @return
|
* @return
|
||||||
|
|
@ -79,9 +79,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门人数
|
* 查询课件分类人数
|
||||||
*
|
*
|
||||||
* @param parentId 部门ID
|
* @param parentId 课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -92,9 +92,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询部门是否存在用户
|
* 查询课件分类是否存在用户
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果 true 存在 false 不存在
|
* @return 结果 true 存在 false 不存在
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -104,9 +104,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除部门管理信息
|
* 删除课件分类管理信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -115,9 +115,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增保存部门信息
|
* 新增保存课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -128,9 +128,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改保存部门信息
|
* 修改保存课件分类信息
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -147,7 +147,7 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
/**
|
/**
|
||||||
* 修改子元素关系
|
* 修改子元素关系
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @param ancestors 元素列表
|
* @param ancestors 元素列表
|
||||||
*/
|
*/
|
||||||
public void updateDeptChildren(Long deptId, String ancestors) {
|
public void updateDeptChildren(Long deptId, String ancestors) {
|
||||||
|
|
@ -163,10 +163,10 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据部门ID查询信息
|
* 根据课件分类ID查询信息
|
||||||
*
|
*
|
||||||
* @param deptId 部门ID
|
* @param deptId 课件分类ID
|
||||||
* @return 部门信息
|
* @return 课件分类信息
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public TrainCoursewareCategory selectDeptById(Long deptId) {
|
public TrainCoursewareCategory selectDeptById(Long deptId) {
|
||||||
|
|
@ -174,9 +174,9 @@ public class TrainCoursewareCategoryServiceImpl extends AbstractBaseServiceImpl<
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验部门名称是否唯一
|
* 校验课件分类名称是否唯一
|
||||||
*
|
*
|
||||||
* @param dept 部门信息
|
* @param dept 课件分类信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.ruoyi.courseware.utils;
|
||||||
|
|
||||||
|
import com.aliyuncs.DefaultAcsClient;
|
||||||
|
import com.aliyuncs.exceptions.ClientException;
|
||||||
|
import com.aliyuncs.exceptions.ServerException;
|
||||||
|
import com.aliyuncs.profile.DefaultProfile;
|
||||||
|
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthRequest;
|
||||||
|
import com.aliyuncs.vod.model.v20170321.GetVideoPlayAuthResponse;
|
||||||
|
|
||||||
|
public class VideoUtils {
|
||||||
|
|
||||||
|
// 设置AccessKey ID和AccessKey secret
|
||||||
|
private static String access_key_id = "LTAILL4H4JcoUJdf";
|
||||||
|
private static String access_key_secret = "6TtJ1MD7ueolOXWjx0VhaseX6nkPVe ";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// 点播服务所在的地域,中国大陆地域请填cn-shanghai
|
||||||
|
DefaultProfile profile = DefaultProfile.getProfile("cn-shanghai", access_key_id, access_key_secret);
|
||||||
|
DefaultAcsClient client = new DefaultAcsClient(profile);
|
||||||
|
// 传入视频ID
|
||||||
|
GetVideoPlayAuthResponse response = getVideoPlayAuth(client, "3dbb151b73c34b678efff61d3d50d999");
|
||||||
|
System.out.println(response.getPlayAuth());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static GetVideoPlayAuthResponse getVideoPlayAuth(DefaultAcsClient client, String videoId) {
|
||||||
|
GetVideoPlayAuthRequest request = new GetVideoPlayAuthRequest();
|
||||||
|
request.setVideoId(videoId);
|
||||||
|
GetVideoPlayAuthResponse response = null;
|
||||||
|
try {
|
||||||
|
response = client.getAcsResponse(request);
|
||||||
|
} catch (ServerException e) {
|
||||||
|
throw new RuntimeException("GetVideoPlayAuthRequest Server failed");
|
||||||
|
} catch (ClientException e) {
|
||||||
|
throw new RuntimeException("GetVideoPlayAuthRequest Client failed");
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue