新增隐藏属性
Showing
9 changed files
with
108 additions
and
0 deletions
| ... | @@ -856,4 +856,16 @@ public class CourseController extends BaseController { | ... | @@ -856,4 +856,16 @@ public class CourseController extends BaseController { |
| 856 | public R<Void> remove(@PathVariable String id) throws ServerException { | 856 | public R<Void> remove(@PathVariable String id) throws ServerException { |
| 857 | return toAjax(service.remove(id)); | 857 | return toAjax(service.remove(id)); |
| 858 | } | 858 | } |
| 859 | |||
| 860 | @RepeatSubmit() | ||
| 861 | @PutMapping("/display/{id}") | ||
| 862 | public R<Void> display(@PathVariable String id) throws ServerException { | ||
| 863 | return toAjax(service.display(id)); | ||
| 864 | } | ||
| 865 | |||
| 866 | @RepeatSubmit() | ||
| 867 | @PutMapping("/hide/{id}") | ||
| 868 | public R<Void> hide(@PathVariable String id) throws ServerException { | ||
| 869 | return toAjax(service.hide(id)); | ||
| 870 | } | ||
| 859 | } | 871 | } | ... | ... |
| ... | @@ -133,4 +133,9 @@ public class Course extends BaseEntity { | ... | @@ -133,4 +133,9 @@ public class Course extends BaseEntity { |
| 133 | */ | 133 | */ |
| 134 | private String programType; | 134 | private String programType; |
| 135 | 135 | ||
| 136 | /** | ||
| 137 | * 是否可见 | ||
| 138 | */ | ||
| 139 | private boolean isVisible; | ||
| 140 | |||
| 136 | } | 141 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -104,4 +104,9 @@ public class CourseBo extends BaseBO { | ... | @@ -104,4 +104,9 @@ public class CourseBo extends BaseBO { |
| 104 | * 编程类型(0没有编程 1图标 2词语) | 104 | * 编程类型(0没有编程 1图标 2词语) |
| 105 | */ | 105 | */ |
| 106 | private String programType; | 106 | private String programType; |
| 107 | |||
| 108 | /** | ||
| 109 | * 是否可见 | ||
| 110 | */ | ||
| 111 | private boolean isVisible; | ||
| 107 | } | 112 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -160,4 +160,9 @@ public class CourseVo { | ... | @@ -160,4 +160,9 @@ public class CourseVo { |
| 160 | * 编程类型(0没有编程 1图标 2词语) | 160 | * 编程类型(0没有编程 1图标 2词语) |
| 161 | */ | 161 | */ |
| 162 | private String programType; | 162 | private String programType; |
| 163 | |||
| 164 | /** | ||
| 165 | * 是否可见 | ||
| 166 | */ | ||
| 167 | private boolean isVisible; | ||
| 163 | } | 168 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -54,4 +54,9 @@ public class EntiretyVo { | ... | @@ -54,4 +54,9 @@ public class EntiretyVo { |
| 54 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) | 54 | * 前端APP数据国际化(zh_CN、en_US、ru_RU) |
| 55 | */ | 55 | */ |
| 56 | private String language; | 56 | private String language; |
| 57 | |||
| 58 | /** | ||
| 59 | * 是否可见 | ||
| 60 | */ | ||
| 61 | private boolean isVisible; | ||
| 57 | } | 62 | } | ... | ... |
| ... | @@ -71,5 +71,39 @@ public interface ICourseService { | ... | @@ -71,5 +71,39 @@ public interface ICourseService { |
| 71 | * @throws ServerException | 71 | * @throws ServerException |
| 72 | */ | 72 | */ |
| 73 | boolean remove(String id) throws ServerException; | 73 | boolean remove(String id) throws ServerException; |
| 74 | |||
| 75 | /** | ||
| 76 | * 隐藏 | ||
| 77 | * | ||
| 78 | * @param id | ||
| 79 | * @return | ||
| 80 | * @throws ServerException | ||
| 81 | */ | ||
| 82 | boolean hide(String id) throws ServerException; | ||
| 83 | /** | ||
| 84 | * 批量隐藏 | ||
| 85 | * | ||
| 86 | * @param ids | ||
| 87 | * @return | ||
| 88 | * @throws ServerException | ||
| 89 | */ | ||
| 90 | boolean batchHide(List<String> ids) throws ServerException; | ||
| 91 | /** | ||
| 92 | * 显示 | ||
| 93 | * | ||
| 94 | * @param id | ||
| 95 | * @return | ||
| 96 | * @throws ServerException | ||
| 97 | */ | ||
| 98 | boolean display(String id) throws ServerException; | ||
| 99 | |||
| 100 | /** | ||
| 101 | * 批量显示 | ||
| 102 | * | ||
| 103 | * @param ids | ||
| 104 | * @return | ||
| 105 | * @throws ServerException | ||
| 106 | */ | ||
| 107 | boolean batchDisplay(List<String> ids) throws ServerException; | ||
| 74 | } | 108 | } |
| 75 | 109 | ... | ... |
| ... | @@ -289,6 +289,38 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -289,6 +289,38 @@ public class CourseServiceImpl implements ICourseService { |
| 289 | return baseMapper.deleteById(id) > 0; | 289 | return baseMapper.deleteById(id) > 0; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | @Override | ||
| 293 | public boolean display(String id) throws ServerException { | ||
| 294 | CourseVo courseVo = baseMapper.selectVoById(id); | ||
| 295 | courseVo.setVisible(true); | ||
| 296 | Course course = BeanUtil.toBean(courseVo, Course.class); | ||
| 297 | return baseMapper.updateById(course) > 0; | ||
| 298 | } | ||
| 299 | |||
| 300 | @Override | ||
| 301 | public boolean batchDisplay(List<String> ids) throws ServerException { | ||
| 302 | CourseVo courseVo = baseMapper.selectVoById(id); | ||
| 303 | courseVo.setVisible(true); | ||
| 304 | Course course = BeanUtil.toBean(courseVo, Course.class); | ||
| 305 | return baseMapper.updateById(course) > 0; | ||
| 306 | } | ||
| 307 | |||
| 308 | @Override | ||
| 309 | public boolean hide(String id) throws ServerException { | ||
| 310 | CourseVo courseVo = baseMapper.selectVoById(id); | ||
| 311 | courseVo.setVisible(false); | ||
| 312 | Course course = BeanUtil.toBean(courseVo, Course.class); | ||
| 313 | return baseMapper.updateById(course) > 0; | ||
| 314 | } | ||
| 315 | |||
| 316 | @Override | ||
| 317 | public boolean batchHide(List<String> ids) throws ServerException { | ||
| 318 | CourseVo courseVo = baseMapper.selectVoById(id); | ||
| 319 | courseVo.setVisible(false); | ||
| 320 | Course course = BeanUtil.toBean(courseVo, Course.class); | ||
| 321 | return baseMapper.updateById(course) > 0; | ||
| 322 | } | ||
| 323 | |||
| 292 | /** | 324 | /** |
| 293 | * 校验数据是否存在 | 325 | * 校验数据是否存在 |
| 294 | * | 326 | * | ... | ... |
-
Please register or sign in to post a comment