Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐少华
midjourney-proxy
Commits
88398595
Commit
88398595
authored
Apr 20, 2021
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1004620] 资讯处理
parent
c71d04ae
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
175 additions
and
3 deletions
+175
-3
ArticleInfoDTO.java
.../main/java/com/pcloud/book/applet/dto/ArticleInfoDTO.java
+20
-0
HandleNewsDTO.java
...c/main/java/com/pcloud/book/applet/dto/HandleNewsDTO.java
+21
-0
ProductConsr.java
.../java/com/pcloud/book/consumer/resource/ProductConsr.java
+26
-0
ResourcePageBiz.java
.../main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
+8
-0
ResourcePageBizImpl.java
...a/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
+10
-0
RightsSettingBiz.java
...a/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
+5
-0
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+0
-0
RightsSettingDAO.java
...a/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
+6
-0
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+12
-0
RightsSettingFacede.java
...pcloud/book/rightsSetting/facade/RightsSettingFacede.java
+8
-0
ResourcePageDao.xml
...-book/src/main/resources/mapper/group/ResourcePageDao.xml
+7
-3
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+52
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/ArticleInfoDTO.java
0 → 100644
View file @
88398595
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ArticleInfoDTO
implements
Serializable
{
//类型
private
String
type
;
//排序值
private
Integer
seqNum
;
//内容
private
String
content
;
//音乐名称
private
String
musicName
;
//音乐地址
private
String
musicUrl
;
}
pcloud-service-book/src/main/java/com/pcloud/book/applet/dto/HandleNewsDTO.java
0 → 100644
View file @
88398595
package
com
.
pcloud
.
book
.
applet
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
HandleNewsDTO
{
private
Long
bookId
;
private
Long
adviserId
;
private
Long
channelId
;
private
Long
adviserBookId
;
private
List
<
Long
>
appletNewsIds
;
}
pcloud-service-book/src/main/java/com/pcloud/book/consumer/resource/ProductConsr.java
View file @
88398595
...
...
@@ -14,6 +14,7 @@ import com.pcloud.resourcecenter.product.dto.ProductDto;
import
com.pcloud.resourcecenter.product.dto.ProductLabelDto
;
import
com.pcloud.resourcecenter.product.dto.ProductTypeDto
;
import
com.pcloud.resourcecenter.product.dto.UpdateAppProductParamDTO
;
import
com.pcloud.resourcecenter.product.entity.Article
;
import
com.pcloud.resourcecenter.product.entity.Product
;
import
com.pcloud.resourcecenter.product.service.ProductService
;
...
...
@@ -347,4 +348,29 @@ public class ProductConsr {
return
productDtoMap
==
null
?
new
HashMap
<>()
:
productDtoMap
;
}
public
Long
addProductStepOne
(
Product
product
)
{
Long
productId
=
null
;
try
{
productId
=
ResponseHandleUtil
.
parseResponse
(
productService
.
addProductStepOne
(
product
),
Long
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"创建作品第一步[productService.addProductStepOne]:创建失败:product:{}"
+
e
.
getMessage
(),
product
);
}
return
productId
;
}
public
void
addArticle
(
Article
article
)
{
try
{
productService
.
addArticle
(
article
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"创建精品文章第二步[productService.addArticle]:创建失败:article:{}"
+
e
.
getMessage
(),
article
);
}
}
public
void
selfAudit
(
Product
product
)
{
try
{
productService
.
selfAudit
(
product
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"自主审核失败[productService.selfAudit]:创建失败:article:{}"
+
e
.
getMessage
(),
product
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/ResourcePageBiz.java
View file @
88398595
...
...
@@ -143,4 +143,12 @@ public interface ResourcePageBiz {
* * @param null
*/
void
batchUpdateQrcode
(
List
<
Long
>
bookGroupIds
);
/**
* 根据书籍id和channel获取资源配置页
* @param adviserBookId
* @param channelId
* @return
*/
ResourcePageVO
getResourcePageByBookIdAndChannelId
(
Long
adviserBookId
,
Long
channelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/ResourcePageBizImpl.java
View file @
88398595
...
...
@@ -1261,4 +1261,14 @@ public class ResourcePageBizImpl implements ResourcePageBiz {
}
}
@Override
public
ResourcePageVO
getResourcePageByBookIdAndChannelId
(
Long
bookId
,
Long
channelId
)
{
ResourcePageVO
resourcePageVO
=
new
ResourcePageVO
();
ResourcePage
resourcePage
=
resourcePageDao
.
getByBookId
(
bookId
,
channelId
,
null
);
if
(
null
!=
resourcePage
)
{
BeanUtils
.
copyProperties
(
resourcePage
,
resourcePageVO
);
}
return
resourcePageVO
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/RightsSettingBiz.java
View file @
88398595
...
...
@@ -268,4 +268,9 @@ public interface RightsSettingBiz {
* 根据图书信息及权益ID检查是否配置了读书卡片应用
*/
Map
<
String
,
Object
>
getBookCardId4Book
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
Long
rightsSettingId
);
/**
* 处理资讯
*/
void
handleNews
();
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
88398595
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/RightsSettingDAO.java
View file @
88398595
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
;
import
com.pcloud.book.applet.dto.HandleNewsDTO
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.rightsSetting.dto.BookRightsCountsDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingShowStateDTO
;
...
...
@@ -40,4 +42,8 @@ public interface RightsSettingDAO extends BaseDao<RightsSetting> {
void
updateUser
(
RightsSetting
rightsSetting
);
RightsSettingDto
getDTOById
(
Long
id
);
List
<
AppletNews
>
getAllNews
();
List
<
HandleNewsDTO
>
getAllBookNews
();
}
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
88398595
package
com
.
pcloud
.
book
.
rightsSetting
.
dao
.
impl
;
import
com.pcloud.book.applet.dto.HandleNewsDTO
;
import
com.pcloud.book.applet.entity.AppletNews
;
import
com.pcloud.book.rightsSetting.dao.RightsSettingDAO
;
import
com.pcloud.book.rightsSetting.dto.BookRightsCountsDto
;
import
com.pcloud.book.rightsSetting.dto.RightsSettingDto
;
...
...
@@ -100,6 +102,16 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
}
@Override
public
List
<
AppletNews
>
getAllNews
()
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllNews"
));
}
@Override
public
List
<
HandleNewsDTO
>
getAllBookNews
()
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getAllBookNews"
));
}
@Override
public
List
<
BookRightsCountsDto
>
rightsCountByBookIds
(
List
<
Long
>
bookIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookIds"
,
bookIds
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/facade/RightsSettingFacede.java
View file @
88398595
...
...
@@ -429,4 +429,11 @@ public class RightsSettingFacede {
@RequestParam
(
value
=
"rightsSettingId"
,
required
=
false
)
Long
rightsSettingId
)
{
return
new
ResponseDto
<>(
rightsSettingBiz
.
getBookCardId4Book
(
bookId
,
channelId
,
adviserId
,
rightsSettingId
));
}
@ApiOperation
(
"将资讯转成作品"
)
@GetMapping
(
"handleNews"
)
public
ResponseDto
<?>
handleNews
()
{
rightsSettingBiz
.
handleNews
();
return
new
ResponseDto
<>();
}
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/ResourcePageDao.xml
View file @
88398595
...
...
@@ -77,12 +77,16 @@
p.open_rays
FROM
resource_page p
INNER JOIN book_group g ON p.book_group_id = g.id
INNER JOIN book_group g ON p.book_group_id = g.id
and g.is_delete = 0
AND g.join_group_type = 4
WHERE
g.book_id = #{bookId}
AND g.channel_id = #{channelId}
AND g.create_user = #{adviserId}
<if
test=
"channelId != null"
>
AND g.channel_id = #{channelId}
</if>
<if
test=
"adviserId != null"
>
AND g.create_user = #{adviserId}
</if>
ORDER BY
p.open_rays DESC, p.book_group_id desc
LIMIT 1
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
88398595
...
...
@@ -76,6 +76,16 @@
column=
"id"
select=
"com.pcloud.book.rightsSetting.mapper.RightsSettingBookRelationMapper.selectBookByRithsSettingId"
>
</collection>
</resultMap>
<resultMap
id=
"BookNewsDTOMap"
type=
"com.pcloud.book.applet.dto.HandleNewsDTO"
>
<result
column=
"book_adviser_id"
property=
"adviserBookId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_id"
property=
"bookId"
jdbcType=
"BIGINT"
/>
<result
column=
"channel_id"
property=
"channelId"
jdbcType=
"BIGINT"
/>
<collection
property=
"appletNewsIds"
ofType=
"long"
>
<result
column=
"serve_id"
jdbcType=
"BIGINT"
/>
</collection>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,rights_number, introduce, detail, count, first_classify, second_classify, third_classify,grade_label_id, subject_label_id,
create_time, update_time, enable_group_service, rights_setting_type, book_id
...
...
@@ -459,4 +469,46 @@ WHERE
GROUP BY a.book_id
</select>
<select
id=
"getAllNews"
resultMap=
"com.pcloud.book.applet.dao.impl.AppletNewsDaoImpl.BaseResultMap"
>
select
news.id, news.news_name, news.source, news.news_classify_id, news.pro_label_id, news.dep_label_id, news.pur_label_id, news.type, news.digest,
pic1, pic2, pic3, news.content, news.create_time, news.update_time, news.first_classify, news.second_classify, news.grade_label_id, news.subject_label_id, news.rights_classify_id,
news.jump_type, news.jump_url, news.url_number, news.custom_tag_id
from
rights_setting a
inner join
rights_setting_book_relation c on a.id = c.rights_setting_id
inner join
rights_now_item b on a.id = b.rights_setting_id
inner join
applet_news news on b.serve_id = news.id
where
a.rights_setting_type = 2
and
b.serve_type = 'NEWS'
and
content is not null
group by news.id
</select>
<select
id=
"getAllBookNews"
resultMap=
"BookNewsDTOMap"
>
SELECT
c.book_adviser_id,
c.book_id,
c.adviser_id,
c.channel_id,
b.serve_id
FROM
rights_setting a
INNER JOIN rights_setting_book_relation c ON a.id = c.rights_setting_id
INNER JOIN rights_now_item b ON a.id = b.rights_setting_id
INNER JOIN applet_news news ON b.serve_id = news.id
INNER JOIN book_group d ON c.book_id = d.book_id
INNER JOIN resource_page e ON e.book_group_id = d.id
WHERE
a.rights_setting_type = 2
AND b.serve_type = 'NEWS'
AND content IS NOT NULL
</select>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment