Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
fabb5c3d
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fabb5c3d
编写于
2月 03, 2021
作者:
1
18356073052
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
侧边栏收藏修改
上级
cfb5ef04
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
31 addition
and
7 deletion
+31
-7
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatItemController.java
...linkwechat/web/controller/wecom/WeChatItemController.java
+2
-2
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatSideVo.java
...ain/java/com/linkwechat/wecom/domain/vo/WeChatSideVo.java
+5
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
...in/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
+1
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
...java/com/linkwechat/wecom/service/IWeChatItemService.java
+1
-1
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
...echat/wecom/service/impl/WeChatCollectionServiceImpl.java
+9
-0
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatItemServiceImpl.java
.../linkwechat/wecom/service/impl/WeChatItemServiceImpl.java
+2
-2
linkwe-wecom/src/main/resources/mapper/wecom/WeChatItemMapper.xml
...ecom/src/main/resources/mapper/wecom/WeChatItemMapper.xml
+11
-1
未找到文件。
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeChatItemController.java
浏览文件 @
fabb5c3d
...
...
@@ -43,9 +43,9 @@ public class WeChatItemController extends BaseController {
//@PreAuthorize("@ss.hasPermi('chat:item:list')")
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
@RequestParam
(
value
=
"sideId"
)
Long
sideId
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"mediaType"
)
String
mediaType
)
{
,
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@RequestParam
(
value
=
"mediaType"
)
String
mediaType
,
@RequestParam
(
value
=
"userId"
)
String
userId
)
{
startPage
();
List
<
WeChatSideVo
>
weChatSideVos
=
weChatItemService
.
chatItems
(
sideId
,
keyword
,
mediaType
);
List
<
WeChatSideVo
>
weChatSideVos
=
weChatItemService
.
chatItems
(
sideId
,
keyword
,
mediaType
,
userId
);
return
getDataTable
(
weChatSideVos
);
}
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/vo/WeChatSideVo.java
浏览文件 @
fabb5c3d
...
...
@@ -34,4 +34,9 @@ public class WeChatSideVo {
*/
private
String
materialName
;
/**
* 是否收藏 0未收藏 1 已收藏
*/
private
String
collection
;
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/mapper/WeChatItemMapper.java
浏览文件 @
fabb5c3d
...
...
@@ -39,5 +39,5 @@ public interface WeChatItemMapper extends BaseMapper<WeChatItem> {
* @param keyword 关键词
* @return
*/
public
List
<
WeChatSideVo
>
findChatItems
(
@Param
(
"sideId"
)
Long
sideId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"mediaType"
)
String
mediaType
);
public
List
<
WeChatSideVo
>
findChatItems
(
@Param
(
"sideId"
)
Long
sideId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"mediaType"
)
String
mediaType
,
@Param
(
"userId"
)
String
userId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeChatItemService.java
浏览文件 @
fabb5c3d
...
...
@@ -27,6 +27,6 @@ public interface IWeChatItemService extends IService<WeChatItem> {
* @param sideId 侧边栏id
* @return
*/
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
);
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
,
String
userId
);
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatCollectionServiceImpl.java
浏览文件 @
fabb5c3d
package
com.linkwechat.wecom.service.impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.linkwechat.common.exception.CustomException
;
import
com.linkwechat.common.exception.wecom.WeComException
;
import
com.linkwechat.common.utils.SnowFlakeUtil
;
import
com.linkwechat.wecom.domain.WeChatCollection
;
import
com.linkwechat.wecom.domain.vo.WeChatSideVo
;
...
...
@@ -25,6 +28,12 @@ public class WeChatCollectionServiceImpl extends ServiceImpl<WeChatCollectionMap
@Override
public
int
addCollection
(
Long
materialId
,
String
userId
)
{
QueryWrapper
<
WeChatCollection
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"material_id"
,
materialId
).
eq
(
"user_id"
,
userId
);
WeChatCollection
queryCollection
=
weChatCollectionMapper
.
selectOne
(
wrapper
);
if
(
null
!=
queryCollection
){
throw
new
CustomException
(
"你已收藏"
);
}
WeChatCollection
chatCollection
=
new
WeChatCollection
();
chatCollection
.
setCollectionId
(
SnowFlakeUtil
.
nextId
());
chatCollection
.
setMaterialId
(
materialId
);
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeChatItemServiceImpl.java
浏览文件 @
fabb5c3d
...
...
@@ -96,8 +96,8 @@ public class WeChatItemServiceImpl extends ServiceImpl<WeChatItemMapper, WeChatI
}
@Override
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
)
{
return
weChatItemMapper
.
findChatItems
(
sideId
,
keyword
,
mediaType
);
public
List
<
WeChatSideVo
>
chatItems
(
Long
sideId
,
String
keyword
,
String
mediaType
,
String
userId
)
{
return
weChatItemMapper
.
findChatItems
(
sideId
,
keyword
,
mediaType
,
userId
);
}
/**
...
...
linkwe-wecom/src/main/resources/mapper/wecom/WeChatItemMapper.xml
浏览文件 @
fabb5c3d
...
...
@@ -27,7 +27,17 @@
wm.material_name,
wm.material_url,
wm.content,
wc.media_type
wc.media_type,
(
SELECT
COUNT(1)
FROM
we_chat_collection
WHERE
material_id = wci.material_id
AND user_id = #{userId}
) collection
FROM
we_chat_item wci
LEFT JOIN we_material wm ON wci.material_id = wm.id
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录