7429fc8b by chentao

新增隐藏属性

1 parent d11cae39
......@@ -856,4 +856,16 @@ public class CourseController extends BaseController {
public R<Void> remove(@PathVariable String id) throws ServerException {
return toAjax(service.remove(id));
}
@RepeatSubmit()
@PutMapping("/display/{id}")
public R<Void> display(@PathVariable String id) throws ServerException {
return toAjax(service.display(id));
}
@RepeatSubmit()
@PutMapping("/hide/{id}")
public R<Void> hide(@PathVariable String id) throws ServerException {
return toAjax(service.hide(id));
}
}
......
......@@ -133,4 +133,9 @@ public class Course extends BaseEntity {
*/
private String programType;
/**
* 是否可见
*/
private boolean isVisible;
}
\ No newline at end of file
......
......@@ -58,4 +58,9 @@ public class Entirety extends BaseEntity {
@TableLogic
private String delFlag;
/**
* 是否可见
*/
private boolean isVisible;
}
......
......@@ -104,4 +104,9 @@ public class CourseBo extends BaseBO {
* 编程类型(0没有编程 1图标 2词语)
*/
private String programType;
/**
* 是否可见
*/
private boolean isVisible;
}
\ No newline at end of file
......
......@@ -44,4 +44,9 @@ public class EntiretyBo extends BaseBO {
* 文件ID
*/
private String ossId;
/**
* 是否可见
*/
private boolean isVisible;
}
......
......@@ -160,4 +160,9 @@ public class CourseVo {
* 编程类型(0没有编程 1图标 2词语)
*/
private String programType;
/**
* 是否可见
*/
private boolean isVisible;
}
\ No newline at end of file
......
......@@ -54,4 +54,9 @@ public class EntiretyVo {
* 前端APP数据国际化(zh_CN、en_US、ru_RU)
*/
private String language;
/**
* 是否可见
*/
private boolean isVisible;
}
......
......@@ -71,5 +71,39 @@ public interface ICourseService {
* @throws ServerException
*/
boolean remove(String id) throws ServerException;
/**
* 隐藏
*
* @param id
* @return
* @throws ServerException
*/
boolean hide(String id) throws ServerException;
/**
* 批量隐藏
*
* @param ids
* @return
* @throws ServerException
*/
boolean batchHide(List<String> ids) throws ServerException;
/**
* 显示
*
* @param id
* @return
* @throws ServerException
*/
boolean display(String id) throws ServerException;
/**
* 批量显示
*
* @param ids
* @return
* @throws ServerException
*/
boolean batchDisplay(List<String> ids) throws ServerException;
}
......
......@@ -289,6 +289,38 @@ public class CourseServiceImpl implements ICourseService {
return baseMapper.deleteById(id) > 0;
}
@Override
public boolean display(String id) throws ServerException {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(true);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
}
@Override
public boolean batchDisplay(List<String> ids) throws ServerException {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(true);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
}
@Override
public boolean hide(String id) throws ServerException {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(false);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
}
@Override
public boolean batchHide(List<String> ids) throws ServerException {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(false);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
}
/**
* 校验数据是否存在
*
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!