forked from itwanger/paicoding
-
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
Showing
17 changed files
with
230 additions
and
61 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...-api/src/main/java/com/github/paicoding/forum/api/model/vo/article/SearchCategoryReq.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.github.paicoding.forum.api.model.vo.article; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/27/23 | ||
*/ | ||
@Data | ||
public class SearchCategoryReq { | ||
// 类目名称 | ||
private String category; | ||
// 分页 | ||
private Long pageNumber; | ||
private Long pageSize; | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...oding-api/src/main/java/com/github/paicoding/forum/api/model/vo/article/SearchTagReq.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.paicoding.forum.api.model.vo.article; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/29/23 | ||
*/ | ||
@Data | ||
public class SearchTagReq { | ||
// 标签名称 | ||
private String tag; | ||
// 分页 | ||
private Long pageNumber; | ||
private Long pageSize; | ||
} |
34 changes: 34 additions & 0 deletions
34
...c/main/java/com/github/paicoding/forum/service/article/conveter/CategoryStructMapper.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.paicoding.forum.service.article.conveter; | ||
|
||
import com.github.paicoding.forum.api.model.vo.article.SearchCategoryReq; | ||
import com.github.paicoding.forum.api.model.vo.article.dto.CategoryDTO; | ||
import com.github.paicoding.forum.service.article.repository.entity.CategoryDO; | ||
import com.github.paicoding.forum.service.article.repository.params.SearchCategoryParams; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/27/23 | ||
*/ | ||
@Mapper | ||
public interface CategoryStructMapper { | ||
// instance | ||
CategoryStructMapper INSTANCE = Mappers.getMapper( CategoryStructMapper.class ); | ||
|
||
// req to params | ||
@Mapping(source = "pageNumber", target = "pageNum") | ||
SearchCategoryParams toSearchParams(SearchCategoryReq req); | ||
|
||
// do to dto | ||
@Mapping(source = "id", target = "categoryId") | ||
@Mapping(source = "categoryName", target = "category") | ||
CategoryDTO toDTO(CategoryDO categoryDO); | ||
|
||
List<CategoryDTO> toDTOs(List<CategoryDO> list); | ||
} |
34 changes: 34 additions & 0 deletions
34
...ce/src/main/java/com/github/paicoding/forum/service/article/conveter/TagStructMapper.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.github.paicoding.forum.service.article.conveter; | ||
|
||
import com.github.paicoding.forum.api.model.vo.article.SearchTagReq; | ||
import com.github.paicoding.forum.api.model.vo.article.dto.TagDTO; | ||
import com.github.paicoding.forum.service.article.repository.entity.TagDO; | ||
import com.github.paicoding.forum.service.article.repository.params.SearchTagParams; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/29/23 | ||
*/ | ||
@Mapper | ||
public interface TagStructMapper { | ||
// instance | ||
TagStructMapper INSTANCE = Mappers.getMapper( TagStructMapper.class ); | ||
|
||
// req to params | ||
@Mapping(source = "pageNumber", target = "pageNum") | ||
SearchTagParams toSearchParams(SearchTagReq req); | ||
|
||
// do to dto | ||
@Mapping(source = "id", target = "tagId") | ||
@Mapping(source = "tagName", target = "tag") | ||
TagDTO toDTO(TagDO tagDO); | ||
|
||
List<TagDTO> toDTOs(List<TagDO> list); | ||
} |
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
18 changes: 18 additions & 0 deletions
18
...va/com/github/paicoding/forum/service/article/repository/params/SearchCategoryParams.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.paicoding.forum.service.article.repository.params; | ||
|
||
import com.github.paicoding.forum.api.model.vo.PageParam; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/27/23 | ||
*/ | ||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class SearchCategoryParams extends PageParam { | ||
// 类目名称 | ||
private String category; | ||
} |
18 changes: 18 additions & 0 deletions
18
...in/java/com/github/paicoding/forum/service/article/repository/params/SearchTagParams.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.paicoding.forum.service.article.repository.params; | ||
|
||
import com.github.paicoding.forum.api.model.vo.PageParam; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* 微信搜索「沉默王二」,回复 Java | ||
* | ||
* @author 沉默王二 | ||
* @date 5/29/23 | ||
*/ | ||
@EqualsAndHashCode(callSuper = true) | ||
@Data | ||
public class SearchTagParams extends PageParam { | ||
// 标签名称 | ||
private String tag; | ||
} |
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
Oops, something went wrong.