Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
俞扬
2023-06-29 21:03:27 +08:00
7 changed files with 25 additions and 10 deletions

View File

@@ -41,9 +41,9 @@ public interface HyContentInfoMapper {
/**
* B 端使用的动态查询
* C 端使用的动态查询
*/
List<HyContentInfoVO> queryContentListForB(ContentQueryListDto dto);
List<HyContentInfoVO> queryContentListForC(ContentQueryListDto dto);
/**
* 根据contentId查询动态详情

View File

@@ -24,7 +24,7 @@
</resultMap>
<sql id="Base_Column_List">
id, content_title, subject, content_type, cover, content, status, deleted, create_time, update_time,
id, content_title, `subject`, content_type, cover, content, `status`, deleted, create_time, update_time,
create_user_id, update_user_id
</sql>
<sql id="Blob_Column_List">
@@ -165,6 +165,7 @@
<if test="endTime != null and endTime != ''">
and update_time &lt;= #{endTime}
</if>
order by update_time desc
</select>
<select id="getUpdateUserName" resultType="string">
select name
@@ -179,12 +180,12 @@
and user_id = #{updateUserId}
</select>
<!-- B 端使用的动态查询 -->
<select id="queryContentListForB" resultType="com.cool.store.vo.HyContentInfoVO">
<!-- C 端使用的动态查询 -->
<select id="queryContentListForC" resultType="com.cool.store.vo.HyContentInfoVO">
select <include refid="Base_Column_List"></include>
from hy_content_info
where deleted = 0
and status = 1
and status = 0
<if test="contentTitle != null and contentTitle != ''">
and content_title like concat('%', #{contentTitle}, '%')
</if>
@@ -200,6 +201,7 @@
<if test="endTime != null and endTime != ''">
and update_time &lt;= #{endTime}
</if>
order by update_time desc
</select>
<!-- 查询动态详情 -->

View File

@@ -7,6 +7,6 @@ import lombok.Data;
public class ContentQueryTitlesDto {
@ApiModelProperty("用户输入标题")
private String tittle;
private String title;
}

View File

@@ -35,6 +35,11 @@ public interface ContentService {
*/
List<HyContentInfoVO> queryContentList(ContentQueryListDto dto);
/**
* 查询动态列表 C 端用
*/
List<HyContentInfoVO> queryContentListToC(ContentQueryListDto dto);
/**
* 查询动态详情
* @param contentId

View File

@@ -75,7 +75,15 @@ public class ContentServiceImpl implements ContentService {
*/
@Override
public List<HyContentInfoVO> queryContentList(ContentQueryListDto dto) {
return contentInfoMapper.queryContentListForB(dto);
return contentInfoMapper.queryContentList(dto);
}
/**
* 查询动态列表 C 端用
*/
@Override
public List<HyContentInfoVO> queryContentListToC(ContentQueryListDto dto) {
return contentInfoMapper.queryContentListForC(dto);
}
/**

View File

@@ -30,7 +30,7 @@ public class ContentController {
@PostMapping("/queryTitles")
@ApiOperation("搜索标题是否重复")
public ResponseResult<Boolean> queryTitles(@RequestBody ContentQueryTitlesDto title) {
return ResponseResult.success(contentService.queryTitles(title.getTittle()));
return ResponseResult.success(contentService.queryTitles(title.getTitle()));
}
@PostMapping("/add")

View File

@@ -29,7 +29,7 @@ public class ContentController {
@ApiOperation("查询动态列表")
public ResponseResult<PageInfo<HyContentInfoVO>> queryContentList(@RequestBody ContentQueryListDto dto) {
PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
List<HyContentInfoVO> list = contentService.queryContentList(dto);
List<HyContentInfoVO> list = contentService.queryContentListToC(dto);
PageInfo<HyContentInfoVO> page = new PageInfo<>(list);
return ResponseResult.success(page);
}