use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class WriterPointLogController method list.
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询用户积分获取记录列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseBean list(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("userId") Long userId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
PageParameter<WriterPointLogVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
writerPointLogVO.setUserId(userId);
writerPointLogVO.setStartTime(startTime);
writerPointLogVO.setEndTime(endTime);
pageParameter.setParameter(writerPointLogVO);
return new ResponseBean(writerPointLogService.getListWriterPointLog(pageParameter));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class WriterPointRuleController method list.
/**
* 分页查询积分规则列表
* @param pageSize
* @param pageNumber
* @param ruleCode
* @param ruleName
* @return
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询积分规则列表")
@RequestMapping(value = "/pointrule/list", method = RequestMethod.GET)
public ResponseBean list(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("ruleCode") String ruleCode, @RequestParam("ruleName") String ruleName) {
PageParameter<WriterPointRuleVO> pageParameter = new PageParameter<WriterPointRuleVO>(pageNumber, pageSize);
WriterPointRuleVO writerPointRuleVO = new WriterPointRuleVO();
writerPointRuleVO.setRuleName(ruleName);
writerPointRuleVO.setRuleCode(ruleCode);
pageParameter.setParameter(writerPointRuleVO);
return new ResponseBean(writerPointRuleService.getListWriterPointRule(pageParameter));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class ImageController method avatar.
/**
* 图片显示
*
* @param id 图片在MongoDB中的id
* @param response 服务响应
*/
@SuppressWarnings({ "rawtypes" })
@RequestMapping(value = "/image/{id}", method = RequestMethod.GET)
public ResponseBean avatar(@PathVariable("id") String id, HttpServletResponse response) {
response.setContentType("image/png");
GridFSDBFile file = fileService.get(id);
if (null == file) {
// logger.warn("未找到id为'{}'的图片文件", id);
return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.FILE, CheckedExceptionResult.NULL_PARAM, "未找到id为" + id + "的图片文件"));
}
try (OutputStream out = response.getOutputStream()) {
file.writeTo(out);
out.flush();
out.close();
} catch (IOException ex) {
return new ResponseBean(ex);
// logger.error("文件下载时出现IO异常:{}", ex.getMessage());
} catch (Exception ex) {
logger.warn("图片查看时出现异常:{}", ex.getMessage());
throw new CheckedServiceException(CheckedExceptionBusiness.TEACHER_CHECK, CheckedExceptionResult.OBJECT_NOT_FOUND, "图片不存在");
// ResponseBean responseBean = new ResponseBean(ex);
// responseBean.setMsg("图片不存在");
// responseBean.setCode(ResponseBean.MONGO_EXCEPTION);
// return responseBean;
}
return new ResponseBean();
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class BookController method list.
/**
* 功能描述:初始化/条件查询书籍信息
*
* @param pageSize
* 当页条数
* @param pageNumber
* 当前页数
* @param type
* 书籍类别
* @param name
* 书籍名称/ISBN
* @param isOnSale
* 是否上架
* @param isNew
* 是否新书
* @param isPromote
* 是否推荐
* @param path
* 书籍类别根路径
* @return
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "初始化/条件查询书籍信息")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseBean list(Integer pageSize, Integer pageNumber, Long type, String name, Boolean isOnSale, Boolean isNew, Boolean isPromote, String path) {
PageParameter<BookVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
BookVO bookVO = new BookVO();
bookVO.setName(name);
bookVO.setIsNew(isNew);
bookVO.setPath(path);
bookVO.setType(type);
bookVO.setIsOnSale(isOnSale);
bookVO.setIsPromote(isPromote);
pageParameter.setParameter(bookVO);
return new ResponseBean(bookService.listBookVO(pageParameter));
}
use of com.bc.pmpheep.controller.bean.ResponseBean in project pmph by BCSquad.
the class BookVideoController method audit.
/**
* 审核视频
*
* @introduction
* @author Mryang
* @createDate 2018年2月6日 下午5:34:12
* @return
*/
@ResponseBody
@RequestMapping(value = "/audit", method = RequestMethod.PUT)
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "微视频审核")
public ResponseBean<Integer> audit(HttpServletRequest request, Long id, Boolean isAuth) {
if (ObjectUtil.isNull(id)) {
return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO, CheckedExceptionResult.NULL_PARAM, "微视频id不能为空"));
}
if (ObjectUtil.isNull(isAuth)) {
return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO, CheckedExceptionResult.NULL_PARAM, "审核参数不能为空"));
}
String sessionId = CookiesUtil.getSessionId(request);
if (StringUtil.isEmpty(sessionId)) {
return new ResponseBean(new CheckedServiceException(CheckedExceptionBusiness.BOOK_VEDIO, CheckedExceptionResult.USER_SESSION, "尚未登录或session已过期"));
}
BookVideo bookVideo = new BookVideo();
bookVideo.setId(id).setAuthDate(new Date()).setAuthUserId(SessionUtil.getPmphUserBySessionId(sessionId).getId()).setIsAuth(isAuth);
return new ResponseBean(bookVideoService.updateBookVideo(bookVideo));
}
Aggregations