com.macro.mall.portal.domain.MemberReadHistory Java Examples

The following examples show how to use com.macro.mall.portal.domain.MemberReadHistory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MemberReadHistoryController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("展示浏览记录")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<MemberReadHistory>> list(Long memberId) {
    List<MemberReadHistory> memberReadHistoryList = memberReadHistoryService.list(memberId);
    return CommonResult.success(memberReadHistoryList);
}
 
Example #2
Source File: MemberReadHistoryServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int delete(List<String> ids) {
    List<MemberReadHistory> deleteList = new ArrayList<>();
    for(String id:ids){
        MemberReadHistory memberReadHistory = new MemberReadHistory();
        memberReadHistory.setId(id);
        deleteList.add(memberReadHistory);
    }
    memberReadHistoryRepository.delete(deleteList);
    return ids.size();
}
 
Example #3
Source File: MemberReadHistoryServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int create(MemberReadHistory memberReadHistory) {
    memberReadHistory.setId(null);
    memberReadHistory.setCreateTime(new Date());
    memberReadHistoryRepository.save(memberReadHistory);
    return 1;
}
 
Example #4
Source File: MemberReadHistoryController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("展示浏览记录")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(Long memberId) {
    List<MemberReadHistory> memberReadHistoryList = memberReadHistoryService.list(memberId);
    return new CommonResult().success(memberReadHistoryList);
}
 
Example #5
Source File: MemberReadHistoryController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("创建浏览记录")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody MemberReadHistory memberReadHistory) {
    int count  = memberReadHistoryService.create(memberReadHistory);
    if(count>0){
        return new CommonResult().success(count);
    }else{
        return new CommonResult().failed();
    }
}
 
Example #6
Source File: MemberReadHistoryServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(List<String> ids) {
    List<MemberReadHistory> deleteList = new ArrayList<>();
    for(String id:ids){
        MemberReadHistory memberReadHistory = new MemberReadHistory();
        memberReadHistory.setId(id);
        deleteList.add(memberReadHistory);
    }
    memberReadHistoryRepository.deleteAll(deleteList);
    return ids.size();
}
 
Example #7
Source File: MemberReadHistoryServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int create(MemberReadHistory memberReadHistory) {
    UmsMember member = memberService.getCurrentMember();
    memberReadHistory.setMemberId(member.getId());
    memberReadHistory.setMemberNickname(member.getNickname());
    memberReadHistory.setMemberIcon(member.getIcon());
    memberReadHistory.setId(null);
    memberReadHistory.setCreateTime(new Date());
    memberReadHistoryRepository.save(memberReadHistory);
    return 1;
}
 
Example #8
Source File: MemberReadHistoryController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("分页获取用户浏览记录")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<MemberReadHistory>> list(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                        @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) {
    Page<MemberReadHistory> page = memberReadHistoryService.list(pageNum, pageSize);
    return CommonResult.success(CommonPage.restPage(page));
}
 
Example #9
Source File: MemberReadHistoryController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("创建浏览记录")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody MemberReadHistory memberReadHistory) {
    int count = memberReadHistoryService.create(memberReadHistory);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}
 
Example #10
Source File: MemberReadHistoryServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(List<String> ids) {
    List<MemberReadHistory> deleteList = new ArrayList<>();
    for(String id:ids){
        MemberReadHistory memberReadHistory = new MemberReadHistory();
        memberReadHistory.setId(id);
        deleteList.add(memberReadHistory);
    }
    memberReadHistoryRepository.deleteAll(deleteList);
    return ids.size();
}
 
Example #11
Source File: MemberReadHistoryServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int create(MemberReadHistory memberReadHistory) {
    memberReadHistory.setId(null);
    memberReadHistory.setCreateTime(new Date());
    memberReadHistoryRepository.save(memberReadHistory);
    return 1;
}
 
Example #12
Source File: MemberReadHistoryController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("创建浏览记录")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody MemberReadHistory memberReadHistory) {
    int count = memberReadHistoryService.create(memberReadHistory);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}
 
Example #13
Source File: MemberReadHistoryController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("展示浏览记录")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<List<MemberReadHistory>> list(Long memberId) {
    List<MemberReadHistory> memberReadHistoryList = memberReadHistoryService.list(memberId);
    return CommonResult.success(memberReadHistoryList);
}
 
Example #14
Source File: MemberReadHistoryServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int create(MemberReadHistory memberReadHistory) {
    memberReadHistory.setId(null);
    memberReadHistory.setCreateTime(new Date());
    memberReadHistoryRepository.save(memberReadHistory);
    return 1;
}
 
Example #15
Source File: MemberReadHistoryController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("创建浏览记录")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody MemberReadHistory memberReadHistory) {
    int count = memberReadHistoryService.create(memberReadHistory);
    if (count > 0) {
        return CommonResult.success(count);
    } else {
        return CommonResult.failed();
    }
}
 
Example #16
Source File: MemberReadHistoryServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(List<String> ids) {
    List<MemberReadHistory> deleteList = new ArrayList<>();
    for(String id:ids){
        MemberReadHistory memberReadHistory = new MemberReadHistory();
        memberReadHistory.setId(id);
        deleteList.add(memberReadHistory);
    }
    memberReadHistoryRepository.deleteAll(deleteList);
    return ids.size();
}
 
Example #17
Source File: MemberReadHistoryServiceImpl.java    From macrozheng-mall with MIT License 4 votes vote down vote up
@Override
public List<MemberReadHistory> list(Long memberId) {
    return memberReadHistoryRepository.findByMemberIdOrderByCreateTimeDesc(memberId);
}
 
Example #18
Source File: MemberReadHistoryServiceImpl.java    From mall with Apache License 2.0 4 votes vote down vote up
@Override
public Page<MemberReadHistory> list(Integer pageNum, Integer pageSize) {
    UmsMember member = memberService.getCurrentMember();
    Pageable pageable = PageRequest.of(pageNum-1, pageSize);
    return memberReadHistoryRepository.findByMemberIdOrderByCreateTimeDesc(member.getId(),pageable);
}
 
Example #19
Source File: MemberReadHistoryServiceImpl.java    From mall-swarm with Apache License 2.0 4 votes vote down vote up
@Override
public List<MemberReadHistory> list(Long memberId) {
    return memberReadHistoryRepository.findByMemberIdOrderByCreateTimeDesc(memberId);
}
 
Example #20
Source File: MemberReadHistoryServiceImpl.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
@Override
public List<MemberReadHistory> list(Long memberId) {
    return memberReadHistoryRepository.findByMemberIdOrderByCreateTimeDesc(memberId);
}
 
Example #21
Source File: MemberReadHistoryService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 生成浏览记录
 */
int create(MemberReadHistory memberReadHistory);
 
Example #22
Source File: MemberReadHistoryService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 分页获取用户浏览历史记录
 */
Page<MemberReadHistory> list(Integer pageNum, Integer pageSize);
 
Example #23
Source File: MemberReadHistoryService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 获取用户浏览历史记录
 */
List<MemberReadHistory> list(Long memberId);
 
Example #24
Source File: MemberReadHistoryService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 生成浏览记录
 */
int create(MemberReadHistory memberReadHistory);
 
Example #25
Source File: MemberReadHistoryService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 生成浏览记录
 */
int create(MemberReadHistory memberReadHistory);
 
Example #26
Source File: MemberReadHistoryService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 获取用户浏览历史记录
 */
List<MemberReadHistory> list(Long memberId);
 
Example #27
Source File: MemberReadHistoryService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 获取用户浏览历史记录
 */
List<MemberReadHistory> list(Long memberId);
 
Example #28
Source File: MemberReadHistoryService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 生成浏览记录
 */
int create(MemberReadHistory memberReadHistory);
 
Example #29
Source File: MemberReadHistoryRepository.java    From mall with Apache License 2.0 votes vote down vote up
Page<MemberReadHistory> findByMemberIdOrderByCreateTimeDesc(Long memberId, Pageable pageable); 
Example #30
Source File: MemberReadHistoryRepository.java    From macrozheng with Apache License 2.0 votes vote down vote up
List<MemberReadHistory> findByMemberIdOrderByCreateTimeDesc(Long memberId);