-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7af369c
commit 981f4b1
Showing
11 changed files
with
76 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
...s-history/src/main/java/com/zhangjiashuai/yyetshistory/repository/ResourceRepository.java
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
.../main/java/com/zhangjiashuai/yyetshistory/repository/impl/ResourceRepositoryJdbcImpl.java
This file was deleted.
Oops, something went wrong.
26 changes: 4 additions & 22 deletions
26
yyets-history/src/main/java/com/zhangjiashuai/yyetshistory/service/ResourceService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,21 @@ | ||
package com.zhangjiashuai.yyetshistory.service; | ||
|
||
import cn.hutool.db.PageResult; | ||
import com.github.pagehelper.PageInfo; | ||
import com.zhangjiashuai.yyetshistory.entity.Resource; | ||
import com.zhangjiashuai.yyetshistory.entity.ResourceDO; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public interface ResourceService { | ||
|
||
ResourceDO findById(long id); | ||
|
||
List<ResourceDO> findByNameLike(String name); | ||
|
||
ResourceDO findOneByName(String name); | ||
|
||
List<ResourceDO> findAll(); | ||
long countByNameLike(String name); | ||
|
||
Resource parseResource(ResourceDO resourceDO); | ||
|
||
Resource getResourceByName(String name); | ||
|
||
Resource getResourceById(long id); | ||
|
||
List<Resource> getResourceByNameLike(String name); | ||
|
||
List<Resource> getAllResources(); | ||
|
||
PageResult<ResourceDO> selectDOPage(String name, int pageNo); | ||
PageInfo<Resource> selectPage(String name, int pageNo, int pageSize); | ||
|
||
default PageResult<Resource> selectPage(String name, int pageNo) { | ||
PageResult<ResourceDO> doPageResult = selectDOPage(name, pageNo); | ||
PageResult<Resource> pageResult = new PageResult<>(doPageResult.getPage(), doPageResult.getPageSize(), doPageResult.getTotal()); | ||
doPageResult.stream().map(this::parseResource).forEach(pageResult::add); | ||
return pageResult; | ||
} | ||
PageInfo<Resource> selectPage(String name, int pageNo); | ||
|
||
} |
Oops, something went wrong.