Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
zhangshaowu
/
pipi-helper
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9e740599
authored
Oct 16, 2022
by
zhaolianjie
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
2 parents
3a35fbaf
1880ee07
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
164 additions
and
1 deletions
src/main/java/com/pipihelper/project/controller/LoveChatController.java
src/main/java/com/pipihelper/project/feishu/bo/LoveChatVO.java
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
src/main/java/com/pipihelper/project/feishu/dao/LoveChatDao.java
src/main/java/com/pipihelper/project/feishu/entity/LoveChat.java
src/main/java/com/pipihelper/project/feishu/service/LoveChatService.java
src/main/resources/mybatis/LoveChatMapper.xml
src/main/resources/templates/massage-msg-card-rob-end.json
src/main/java/com/pipihelper/project/controller/LoveChatController.java
0 → 100644
View file @
9e74059
package
com
.
pipihelper
.
project
.
controller
;
import
com.pipihelper.project.feishu.bo.LoveChatVO
;
import
com.pipihelper.project.feishu.service.LoveChatService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/api/v1/love-chat"
)
public
class
LoveChatController
{
@Autowired
private
LoveChatService
loveChatService
;
@PostMapping
(
value
=
"list"
)
public
List
<
LoveChatVO
>
list
(
@RequestParam
(
value
=
"title"
,
required
=
false
)
String
title
,
@RequestParam
(
"pageNum"
)
Integer
pageNum
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
)
{
return
loveChatService
.
list
(
title
,
pageNum
,
pageSize
);
}
}
src/main/java/com/pipihelper/project/feishu/bo/LoveChatVO.java
0 → 100644
View file @
9e74059
package
com
.
pipihelper
.
project
.
feishu
.
bo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LoveChatVO
{
private
Integer
id
;
private
String
title
;
private
List
<
LoveChatDetail
>
loveChatDetails
;
@Data
public
static
class
LoveChatDetail
{
private
Integer
type
;
private
String
text
;
}
}
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
View file @
9e74059
...
...
@@ -18,6 +18,7 @@ import com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO;
import
com.pipihelper.project.feishu.entity.Employee
;
import
com.pipihelper.project.feishu.entity.LastMaxPain
;
import
com.pipihelper.project.feishu.entity.Pain
;
import
com.pipihelper.project.feishu.service.ChatMessageService
;
import
com.pipihelper.project.feishu.service.EmployeeService
;
import
com.pipihelper.project.feishu.service.FeiShuApiService
;
import
com.pipihelper.project.feishu.service.FeiShuEventService
;
...
...
@@ -72,6 +73,8 @@ public class FeiShuEventController {
@Autowired
private
EmployeeService
employeeService
;
@Autowired
private
ChatMessageService
chatMessageService
;
@Autowired
private
LastMaxPainService
lastMaxPainService
;
@Autowired
private
PainService
painService
;
...
...
@@ -215,6 +218,8 @@ public class FeiShuEventController {
@PostMapping
(
"/employee-list"
)
public
Object
event
()
{
employeeService
.
uprsetAllEmployee
();
chatMessageService
.
deleteAll
();
for
(
Integer
floor
:
Lists
.
newArrayList
(
14
))
{
LastMaxPain
maxPain
=
lastMaxPainService
.
findByFloor
(
floor
);
int
startEmployeeId
=
0
;
...
...
src/main/java/com/pipihelper/project/feishu/dao/LoveChatDao.java
0 → 100644
View file @
9e74059
package
com
.
pipihelper
.
project
.
feishu
.
dao
;
import
com.pipihelper.project.feishu.entity.LoveChat
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
LoveChatDao
{
List
<
LoveChat
>
findList
(
@Param
(
value
=
"title"
)
String
title
);
}
src/main/java/com/pipihelper/project/feishu/entity/LoveChat.java
0 → 100644
View file @
9e74059
package
com
.
pipihelper
.
project
.
feishu
.
entity
;
import
lombok.Data
;
@Data
public
class
LoveChat
{
private
Integer
id
;
private
String
title
;
private
String
content
;
private
Integer
isDelete
;
}
src/main/java/com/pipihelper/project/feishu/service/LoveChatService.java
0 → 100644
View file @
9e74059
package
com
.
pipihelper
.
project
.
feishu
.
service
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageHelper
;
import
com.pipihelper.project.feishu.bo.LoveChatVO
;
import
com.pipihelper.project.feishu.dao.LoveChatDao
;
import
com.pipihelper.project.feishu.entity.LoveChat
;
import
lombok.Data
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Service
public
class
LoveChatService
{
@Autowired
private
LoveChatDao
loveChatDao
;
public
List
<
LoveChatVO
>
list
(
String
title
,
Integer
pageNum
,
Integer
pageSize
)
{
if
(
StringUtils
.
isBlank
(
title
)){
title
=
null
;
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
LoveChat
>
chatList
=
loveChatDao
.
findList
(
title
);
if
(
CollectionUtil
.
isEmpty
(
chatList
))
{
return
new
ArrayList
<>();
}
return
chatList
.
stream
().
map
(
it
->
{
LoveChatVO
loveChatVO
=
new
LoveChatVO
();
loveChatVO
.
setTitle
(
it
.
getTitle
());
loveChatVO
.
setId
(
it
.
getId
());
List
<
SpeedContent
>
speedContentList
=
JSON
.
parseArray
(
it
.
getContent
(),
SpeedContent
.
class
);
loveChatVO
.
setLoveChatDetails
(
speedContentList
.
stream
().
map
(
speedContent
->
{
LoveChatVO
.
LoveChatDetail
chatDetail
=
new
LoveChatVO
.
LoveChatDetail
();
chatDetail
.
setType
(
"me"
.
equals
(
speedContent
.
getObject
())
?
1
:
2
);
chatDetail
.
setText
(
speedContent
.
getPlan
());
return
chatDetail
;
}).
collect
(
Collectors
.
toList
()));
return
loveChatVO
;
}).
collect
(
Collectors
.
toList
());
}
@Data
private
static
class
SpeedContent
{
private
String
object
;
private
String
plan
;
}
}
src/main/resources/mybatis/LoveChatMapper.xml
0 → 100644
View file @
9e74059
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.pipihelper.project.feishu.dao.LoveChatDao"
>
<resultMap
id=
"ChatMessageResultMap"
type=
"com.pipihelper.project.feishu.entity.LoveChat"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"title"
property=
"title"
/>
<result
column=
"content"
property=
"content"
/>
<result
column=
"is_delete"
property=
"isDelete"
/>
</resultMap>
<!-- <resultMap id="BuffConfigResultBOMap" type="com.pipihelper.project.feishu.entity.Deployee"
extends="ChatMessageResultMap">
</resultMap>-->
<sql
id=
"Base_Column_List"
>
id,title,content,is_delete
</sql>
<select
id=
"findList"
resultMap=
"ChatMessageResultMap"
>
SELECT
<include
refid=
"Base_Column_List"
/>
FROM t_love_chat
<where>
is_delete = 0
<if
test=
"title != null"
>
and title like '%${title}%'
</if>
</where>
</select>
</mapper>
src/main/resources/templates/massage-msg-card-rob-end.json
View file @
9e74059
...
...
@@ -7,7 +7,7 @@
{
"tag"
:
"div"
,
"text"
:
{
"content"
:
"
已抢完~
"
,
"content"
:
"
%s
"
,
"tag"
:
"lark_md"
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment