Commit 79d0a06f by weiss

1

1 parent 757dafd0
...@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil; ...@@ -4,6 +4,8 @@ import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.pipihelper.project.core.Result;
import com.pipihelper.project.core.ResultGenerator;
import com.pipihelper.project.feishu.dto.FeiShuConfig; import com.pipihelper.project.feishu.dto.FeiShuConfig;
import com.pipihelper.project.feishu.dto.FeiShuEventDTO; import com.pipihelper.project.feishu.dto.FeiShuEventDTO;
import com.pipihelper.project.feishu.dto.FeiShuMsgCardEventDTO; import com.pipihelper.project.feishu.dto.FeiShuMsgCardEventDTO;
...@@ -21,6 +23,7 @@ import com.pipihelper.project.feishu.service.PainService; ...@@ -21,6 +23,7 @@ import com.pipihelper.project.feishu.service.PainService;
import com.pipihelper.project.feishu.service.massage.MassageMsgCardSerivce; import com.pipihelper.project.feishu.service.massage.MassageMsgCardSerivce;
import com.pipihelper.project.feishu.service.massage.MassageService; import com.pipihelper.project.feishu.service.massage.MassageService;
import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter; import com.pipihelper.project.feishu.utils.FeiShuEventDataDecrypter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -32,6 +35,7 @@ import java.io.BufferedReader; ...@@ -32,6 +35,7 @@ import java.io.BufferedReader;
import java.io.InputStream; import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
...@@ -43,6 +47,7 @@ import java.util.stream.Stream; ...@@ -43,6 +47,7 @@ import java.util.stream.Stream;
* @author: charles * @author: charles
* @date: 2022年03月30日 17:39 * @date: 2022年03月30日 17:39
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("/pipitest/feishu") @RequestMapping("/pipitest/feishu")
public class FeiShuEventController { public class FeiShuEventController {
...@@ -257,4 +262,23 @@ public class FeiShuEventController { ...@@ -257,4 +262,23 @@ public class FeiShuEventController {
feiShuChatDTO.setIdList(new String[]{openId}); feiShuChatDTO.setIdList(new String[]{openId});
return feiShuApiService.joinChatList(feiShuChatDTO); return feiShuApiService.joinChatList(feiShuChatDTO);
} }
@PostMapping("/start")
public Result start() {
List<Pain> pains = painService.findListAsc(3);
for(Pain pain:pains){
String messageId = pain.getMessageId();
massageService.updateSingleMassageMsgCardWhenBegin(messageId);
//1代表正在按
pain.setStatus(1);
painService.update(pain);
JSONObject noticeMsg = new JSONObject();
noticeMsg.put("user_id_list", Arrays.asList(pain.getOpenId()));
//发送应用内提醒
log.info("发送应用内容消息提醒");
feiShuApiService.patchUrgentApp(messageId, noticeMsg);
}
return ResultGenerator.genSuccessResult();
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!