15cd555c by chentao

no message

1 parent 7429fc8b
......@@ -28,6 +28,7 @@ import javax.validation.Valid;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.rmi.ServerException;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
......@@ -864,8 +865,20 @@ public class CourseController extends BaseController {
}
@RepeatSubmit()
@PutMapping("/batch/display/{courseIds}")
public R<Void> batchDisplay(@PathVariable String[] courseIds) throws ServerException {
return toAjax(service.batchDisplay(courseIds));
}
@RepeatSubmit()
@PutMapping("/hide/{id}")
public R<Void> hide(@PathVariable String id) throws ServerException {
return toAjax(service.hide(id));
}
@RepeatSubmit()
@PutMapping("/batch/hide/{courseIds}")
public R<Void> batchHide(@PathVariable String[] courseIds) throws ServerException {
return toAjax(service.batchHide(courseIds));
}
}
......
......@@ -136,6 +136,6 @@ public class Course extends BaseEntity {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
}
\ No newline at end of file
......
......@@ -61,6 +61,6 @@ public class Entirety extends BaseEntity {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
}
......
......@@ -108,5 +108,5 @@ public class CourseBo extends BaseBO {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
}
\ No newline at end of file
......
......@@ -48,5 +48,5 @@ public class EntiretyBo extends BaseBO {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
}
......
......@@ -164,5 +164,10 @@ public class CourseVo {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
/**
* 是否可见
*/
private String display;
}
\ No newline at end of file
......
......@@ -58,5 +58,10 @@ public class EntiretyVo {
/**
* 是否可见
*/
private boolean isVisible;
private boolean visible;
/**
* 是否可见
*/
private String display;
}
......
......@@ -80,14 +80,15 @@ public interface ICourseService {
* @throws ServerException
*/
boolean hide(String id) throws ServerException;
/**
* 批量隐藏
*
* @param ids
* @param courseIds
* @return
* @throws ServerException
*/
boolean batchHide(List<String> ids) throws ServerException;
boolean batchHide(String[] courseIds) throws ServerException;
/**
* 显示
*
......@@ -100,10 +101,10 @@ public interface ICourseService {
/**
* 批量显示
*
* @param ids
* @param courseIds
* @return
* @throws ServerException
*/
boolean batchDisplay(List<String> ids) throws ServerException;
boolean batchDisplay(String[] courseIds) throws ServerException;
}
......
......@@ -30,6 +30,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.rmi.ServerException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
......@@ -94,6 +95,12 @@ public class CourseServiceImpl implements ICourseService {
if(StrUtil.isNotBlank(vo.getPptOssId())){
vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId()));
}
if(vo.isVisible()){
vo.setDisplay("已显示");
}
else{
vo.setDisplay("已隐藏");
}
}
}
return TableDataInfo.build(page);
......@@ -298,11 +305,18 @@ public class CourseServiceImpl implements ICourseService {
}
@Override
public boolean batchDisplay(List<String> ids) throws ServerException {
public boolean batchDisplay(String[] courseIds) throws ServerException {
if(courseIds==null)
System.out.println("=============1==========");
else
System.out.println("========================"+Arrays.asList(courseIds));
for (String id : courseIds) {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(true);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
baseMapper.updateById(course);
}
return true;
}
@Override
......@@ -314,11 +328,14 @@ public class CourseServiceImpl implements ICourseService {
}
@Override
public boolean batchHide(List<String> ids) throws ServerException {
public boolean batchHide(String[] courseIds) throws ServerException {
for (String id : courseIds) {
CourseVo courseVo = baseMapper.selectVoById(id);
courseVo.setVisible(false);
Course course = BeanUtil.toBean(courseVo, Course.class);
return baseMapper.updateById(course) > 0;
baseMapper.updateById(course);
}
return true;
}
/**
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!