| | |
| | | if(StringUtils.isNotBlank(dto.getCreateDateEndStr())){ |
| | | dto.setCreateDateEnd(DateUtils.dateToLocalDateTime(dto.getCreateDateEndStr(),false)); |
| | | } |
| | | |
| | | //todo 这里的用户ID可能为空,用户存在不登录的情况下访问,传null |
| | | try { |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | } catch (Exception e) { |
| | | dto.setUserId(null); |
| | | } |
| | | |
| | | List<FilmWorksVO> list = filmWorksMapper.queryPage(dto,page); |
| | | page.setRecords(list); |
| | | |
| | | |
| | | return page; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public FilmWorksVO detail(Long id) { |
| | | FilmWorks filmWork = filmWorksMapper.selectById(id); |
| | | if(filmWork==null){ |
| | | // userId 可以是空,因为用户可以登录 |
| | | |
| | | String userId = SecurityUtils.getUserId(); |
| | | FilmWorksVO filmWorksVO = filmWorksMapper.selectInfoById(id,userId); |
| | | if(filmWorksVO==null){ |
| | | return null; |
| | | } |
| | | FilmWorksVO filmWorksVO = new FilmWorksVO(); |
| | | BeanUtils.copyProperties(filmWork,filmWorksVO); |
| | | CustomerDTO currentCustomer = customerMapper.getCurrentCustomer(filmWork.getCreateBy()); |
| | | CustomerDTO currentCustomer = customerMapper.getCurrentCustomer(filmWorksVO.getCreateBy()); |
| | | filmWorksVO.setNickname(currentCustomer.getNickName()); |
| | | filmWorksVO.setAvatar(currentCustomer.getCover()); |
| | | return filmWorksVO; |