Commit cda94852 by 田超

Merge branch 'feature/1004328' into 'master'

feat: [1004328] 新增查询书籍权益ID接口

See merge request rays/pcloud-book!1206
parents 1fdb99dd 1a1cb0e3
......@@ -1038,4 +1038,6 @@ public interface BookGroupBiz {
void fillBookServe4RightsSetting(List<BookServeDTO> bookServeVOS);
BookAppletSceneDTO getOneBookAppletBySceneIds(List<Long> sceneIds);
Long getRightsSettingId4Book(Long adviserId, Long channelId, Long bookId);
}
......@@ -303,6 +303,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.Callable;
......@@ -6502,4 +6503,12 @@ public class BookGroupBizImpl implements BookGroupBiz {
return bookAppletSceneDTO;
}
@Override
public Long getRightsSettingId4Book(Long adviserId, Long channelId, Long bookId) {
// 查询图书权益ID
RightsSettingDto rightsSettingDto = rightsSettingBiz.getRightsSettingByBookId4AppletHome(bookId, adviserId, channelId);
// 没有则返回兜底权益ID
return Optional.ofNullable(rightsSettingDto).map(RightsSettingDto::getId).orElse(bookBiz.getDefaultRightsSettingId());
}
}
package com.pcloud.book.group.facade.impl;
import cn.hutool.core.map.MapUtil;
import com.pcloud.book.base.exception.BookBizException;
import com.pcloud.book.book.dto.MapResourceTotalCountDTO;
import com.pcloud.book.group.biz.BookGroupBiz;
......@@ -1228,6 +1229,17 @@ public class BookGroupFacadeImpl implements BookGroupFacade {
return new ResponseDto<>(bookGroupBiz.getBookBaseInfo4Applet(adviserId, channelId, bookId));
}
@GetMapping("getRightsSettingId4Book")
public ResponseDto<Map<String,Object>> getRightsSettingId4Book(
@RequestParam("adviserId") Long adviserId,
@RequestParam("bookId") Long bookId,
@RequestParam("channelId") Long channelId) {
if (null == adviserId || null == bookId || null == channelId) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数缺失!");
}
return new ResponseDto<>(MapUtil.of("rightsSettingId",bookGroupBiz.getRightsSettingId4Book(adviserId, channelId, bookId)));
}
@Override
@GetMapping("updateBookGroupOpenWeapp")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment