mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
feign服务封装
This commit is contained in:
@@ -0,0 +1,109 @@
|
||||
package com.xboe.school.study.api;
|
||||
|
||||
import com.xboe.common.beans.IdName;
|
||||
import com.xboe.common.beans.KeyValue;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.school.study.dto.BatchSignup;
|
||||
import com.xboe.school.study.entity.StudySignup;
|
||||
import com.xboe.school.study.service.IStudySignupService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 课程报名, 本控制器只有一个报名处理,没有其它的处理
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping(value = "/remote/xboe/school/study/signup")
|
||||
public class StudySignupRPCController extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
IStudySignupService signupService;
|
||||
|
||||
/**
|
||||
* 批量添加学员
|
||||
*
|
||||
* @param batch 包含课程ID、课程名称、用户列表等信息的批量报名对象
|
||||
* @return 返回操作结果,包括成功添加的学员数量
|
||||
*/
|
||||
@PostMapping("/batch-add")
|
||||
public JsonResponse<Integer> BatchAdd(@RequestBody BatchSignup batch) {
|
||||
if (isBlank(batch.getCourseId())) {
|
||||
return error("无课程信息");
|
||||
}
|
||||
|
||||
if (isBlank(batch.getCourseName())) {
|
||||
return error("无课程名称信息");
|
||||
}
|
||||
|
||||
if (batch.getUsers() == null) {
|
||||
return error("无报名人员信息");
|
||||
}
|
||||
|
||||
if (batch.getUsers().isEmpty()) {
|
||||
return error("无报名人员信息");
|
||||
}
|
||||
|
||||
//如果没有,就直接设置为录播课
|
||||
if (batch.getCourseType() == null) {
|
||||
batch.setCourseType(20);
|
||||
}
|
||||
|
||||
try {
|
||||
List<IdName> idNameList = batch.getUsers();
|
||||
List<String> aids = idNameList.stream()
|
||||
.map(IdName::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<KeyValue> hasList = signupService.findByCourseAndUsers(batch.getCourseId(), aids);
|
||||
Map<String, String> hasMap = new HashMap<>();
|
||||
|
||||
for (KeyValue has : hasList) {
|
||||
hasMap.put((String) has.getValue(), has.getKey());
|
||||
}
|
||||
|
||||
List<StudySignup> list = new ArrayList<>();
|
||||
int n = 0;
|
||||
for (IdName u : idNameList) {
|
||||
//如果报名已经存在,就不再添加
|
||||
if (hasMap.containsKey(u.getId())) {
|
||||
continue;
|
||||
}
|
||||
StudySignup signup = new StudySignup();
|
||||
signup.setAid(u.getId());
|
||||
signup.setCourseId(batch.getCourseId());
|
||||
signup.setCourseName(batch.getCourseName());
|
||||
signup.setCourseType(batch.getCourseType());
|
||||
signup.setName(u.getName());
|
||||
signup.setSignTime(LocalDateTime.now());
|
||||
signup.setSignType(StudySignup.SIGNTYPE_ADD);
|
||||
signup.setSignInfo("");
|
||||
list.add(signup);
|
||||
n++;
|
||||
}
|
||||
signupService.addList(list);
|
||||
return success(n);
|
||||
} catch (Exception e) {
|
||||
log.error("报名处理失败", e);
|
||||
return error("报名失败,请与管理员联系", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isBlank(String string) {
|
||||
return StringUtils.isBlank(string);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.xboe.system.user.api;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.xboe.common.PageList;
|
||||
import com.xboe.common.Pagination;
|
||||
import com.xboe.common.constant.CharacterConstant;
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
@@ -17,8 +13,14 @@ import com.xboe.system.user.service.IMessageService;
|
||||
import com.xboe.system.user.service.MessageSender;
|
||||
import com.xboe.system.user.vo.BatchMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@@ -31,62 +33,69 @@ public class MessageApi extends ApiBaseController {
|
||||
|
||||
/**
|
||||
* 查看当前账户消息列表 分页
|
||||
* @param pager pageIndex 页数 pageSize 每页展示条数
|
||||
* @param isRead true已读 false 未读
|
||||
* */
|
||||
*
|
||||
* @param pager pageIndex 页数 pageSize 每页展示条数
|
||||
* @param isRead true已读 false 未读
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public JsonResponse<PageList<Message>> list(Pagination pager,Boolean isRead){
|
||||
public JsonResponse<PageList<Message>> list(Pagination pager, Boolean isRead) {
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
PageList<Message> list = service.query(pager.getPageIndex(), pager.getPageSize(), aid, isRead);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/mobilelist")
|
||||
public JsonResponse<PageList<Message>> mobileList(Pagination pager,Boolean isRead){
|
||||
public JsonResponse<PageList<Message>> mobileList(Pagination pager, Boolean isRead) {
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
PageList<Message> list = service.queryMobile(pager.getPageIndex(), pager.getPageSize(), aid, isRead);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*
|
||||
* @param ids 所勾选的id集合
|
||||
* 物理删除
|
||||
* */
|
||||
* 物理删除
|
||||
*/
|
||||
@PostMapping("/delete")
|
||||
@AutoLog(module = "消息",action = "删除消息")
|
||||
public JsonResponse<Boolean> delete(@RequestBody List<String> ids){
|
||||
if(ids.isEmpty()){
|
||||
@AutoLog(module = "消息", action = "删除消息")
|
||||
public JsonResponse<Boolean> delete(@RequestBody List<String> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
try {
|
||||
service.delete(ids);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("删除失败",e);
|
||||
return error("删除失败",e.getMessage());
|
||||
log.error("删除失败", e);
|
||||
return error("删除失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看当前消息并且设置已读
|
||||
* */
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public JsonResponse<Message> detail(String id){
|
||||
if(StringUtil.isBlank(id)){
|
||||
public JsonResponse<Message> detail(String id) {
|
||||
if (StringUtil.isBlank(id)) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
Message message = service.detail(id);
|
||||
return success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布消息
|
||||
* */
|
||||
*/
|
||||
@Deprecated
|
||||
@PostMapping("/save")
|
||||
@AutoLog(module = "消息",action = "发布消息")
|
||||
public JsonResponse<Boolean> save(@RequestBody Message message){
|
||||
if(StringUtil.isBlank(message.getTitle())){
|
||||
@AutoLog(module = "消息", action = "发布消息")
|
||||
public JsonResponse<Boolean> save(@RequestBody Message message) {
|
||||
log.info(CharacterConstant.DEPRECATED_METHOD + "=MessageApi.save /xboe/sys/message/save");
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
if(StringUtil.isBlank(message.getContent())){
|
||||
if (StringUtil.isBlank(message.getContent())) {
|
||||
return badRequest("内容不能为空");
|
||||
}
|
||||
try {
|
||||
@@ -96,143 +105,144 @@ public class MessageApi extends ApiBaseController {
|
||||
MessageSender.send(message);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("发布消息失败",e);
|
||||
return error("发布消息失败",e.getMessage());
|
||||
log.error("发布消息失败", e);
|
||||
return error("发布消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/batch-send")
|
||||
@AutoLog(module = "消息",action = "批量发送消息")
|
||||
public JsonResponse<Boolean> batchSave(@RequestBody BatchMessage message){
|
||||
|
||||
if(message.getAcceptIds()==null || message.getAcceptIds().isEmpty()) {
|
||||
return badRequest("无发送人信息");
|
||||
}
|
||||
|
||||
if(message.getAcceptNames()==null || message.getAcceptNames().isEmpty()) {
|
||||
return badRequest("无发送人姓名信息");
|
||||
}
|
||||
|
||||
if(message.getAcceptIds().size()!=message.getAcceptNames().size()) {
|
||||
return badRequest("发送人姓名信息不相符");
|
||||
@AutoLog(module = "消息", action = "批量发送消息")
|
||||
public JsonResponse<Boolean> batchSave(@RequestBody BatchMessage message) {
|
||||
|
||||
if (message.getAcceptIds() == null || message.getAcceptIds().isEmpty()) {
|
||||
return badRequest("无发送人信息");
|
||||
}
|
||||
|
||||
if(StringUtil.isBlank(message.getTitle())){
|
||||
|
||||
if (message.getAcceptNames() == null || message.getAcceptNames().isEmpty()) {
|
||||
return badRequest("无发送人姓名信息");
|
||||
}
|
||||
|
||||
if (message.getAcceptIds().size() != message.getAcceptNames().size()) {
|
||||
return badRequest("发送人姓名信息不相符");
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
|
||||
if(StringUtil.isBlank(message.getTitle())){
|
||||
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
if(StringUtil.isBlank(message.getContent())){
|
||||
if (StringUtil.isBlank(message.getContent())) {
|
||||
return badRequest("内容不能为空");
|
||||
}
|
||||
try {
|
||||
Message msg=new Message();
|
||||
msg.setId(IDGenerator.generate());
|
||||
Message msg = new Message();
|
||||
msg.setId(IDGenerator.generate());
|
||||
// msg.setAcceptId(aid);
|
||||
// msg.setAcceptName(aname);
|
||||
msg.setContent(message.getContent());
|
||||
msg.setConType("0");
|
||||
msg.setIsRead(false);
|
||||
msg.setMsgType(1);
|
||||
msg.setPageParams(message.getPageParams());
|
||||
msg.setPageType(message.getPageType());
|
||||
msg.setRefId(message.getRefId());
|
||||
msg.setRefType(message.getRefType());
|
||||
msg.setSendAid(message.getSendAid());
|
||||
msg.setSendName(message.getSendName());
|
||||
msg.setSendType(1);
|
||||
msg.setSource(message.getSource());
|
||||
msg.setTitle(message.getTitle());
|
||||
MessageSender.batchSend(message.getAcceptIds(),message.getAcceptNames(),msg);
|
||||
msg.setContent(message.getContent());
|
||||
msg.setConType("0");
|
||||
msg.setIsRead(false);
|
||||
msg.setMsgType(1);
|
||||
msg.setPageParams(message.getPageParams());
|
||||
msg.setPageType(message.getPageType());
|
||||
msg.setRefId(message.getRefId());
|
||||
msg.setRefType(message.getRefType());
|
||||
msg.setSendAid(message.getSendAid());
|
||||
msg.setSendName(message.getSendName());
|
||||
msg.setSendType(1);
|
||||
msg.setSource(message.getSource());
|
||||
msg.setTitle(message.getTitle());
|
||||
MessageSender.batchSend(message.getAcceptIds(), message.getAcceptNames(), msg);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("发布消息失败",e);
|
||||
return error("发布消息失败",e.getMessage());
|
||||
log.error("发布消息失败", e);
|
||||
return error("发布消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当前登陆人未读消息条数
|
||||
* */
|
||||
*/
|
||||
@GetMapping("/isRead")
|
||||
public JsonResponse<Integer> isRead(){
|
||||
public JsonResponse<Integer> isRead() {
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
Integer count = service.isRead(aid);
|
||||
return success(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置已读
|
||||
* */
|
||||
*/
|
||||
@PostMapping("/updateIsRead")
|
||||
@AutoLog(module = "消息",action = "设置消息已读")
|
||||
public JsonResponse<Boolean> updateIsRead(@RequestBody List<String> ids){
|
||||
if(ids.isEmpty()){
|
||||
@AutoLog(module = "消息", action = "设置消息已读")
|
||||
public JsonResponse<Boolean> updateIsRead(@RequestBody List<String> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
try {
|
||||
service.updateIsRead(ids);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("设置已读失败",e);
|
||||
return error("设置已读失败",e.getMessage());
|
||||
log.error("设置已读失败", e);
|
||||
return error("设置已读失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置已读
|
||||
* */
|
||||
|
||||
*/
|
||||
|
||||
//@AutoLog(module = "消息",action = "未的全部设置为已读")
|
||||
@GetMapping("/readall")
|
||||
public JsonResponse<Boolean> readAll(){
|
||||
|
||||
String aid=getCurrent().getAccountId();
|
||||
if(StringUtils.isBlank(aid)) {
|
||||
return badRequest("获取用户信息异常");
|
||||
public JsonResponse<Boolean> readAll() {
|
||||
|
||||
String aid = getCurrent().getAccountId();
|
||||
if (StringUtils.isBlank(aid)) {
|
||||
return badRequest("获取用户信息异常");
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
service.setReadByAcceptId(aid);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("设置已读失败",e);
|
||||
return error("设置已读失败",e.getMessage());
|
||||
log.error("设置已读失败", e);
|
||||
return error("设置已读失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/clearall")
|
||||
public JsonResponse<Boolean> clearAll(){
|
||||
|
||||
String aid=getCurrent().getAccountId();
|
||||
if(StringUtils.isBlank(aid)) {
|
||||
return badRequest("获取用户信息异常");
|
||||
public JsonResponse<Boolean> clearAll() {
|
||||
|
||||
String aid = getCurrent().getAccountId();
|
||||
if (StringUtils.isBlank(aid)) {
|
||||
return badRequest("获取用户信息异常");
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
service.cleanByAcceptId(aid);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("清空消息错误",e);
|
||||
return error("清空消息失败",e.getMessage());
|
||||
log.error("清空消息错误", e);
|
||||
return error("清空消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/clearMessageNotCase")
|
||||
public JsonResponse<Integer> clearMessageNotCase(){
|
||||
public JsonResponse<Integer> clearMessageNotCase() {
|
||||
|
||||
String aid=getCurrent().getAccountId();
|
||||
if(StringUtils.isBlank(aid)) {
|
||||
String aid = getCurrent().getAccountId();
|
||||
if (StringUtils.isBlank(aid)) {
|
||||
return badRequest("获取用户信息异常");
|
||||
}
|
||||
try {
|
||||
Integer type = service.clearMessageNotCase(aid);
|
||||
return success(type);
|
||||
} catch (Exception e) {
|
||||
log.error("清空消息错误",e);
|
||||
return error("清空消息失败",e.getMessage());
|
||||
log.error("清空消息错误", e);
|
||||
return error("清空消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,12 +250,11 @@ public class MessageApi extends ApiBaseController {
|
||||
/**
|
||||
* 移动端
|
||||
* 消息页面,按用户分组返回 暂时不用
|
||||
*
|
||||
* */
|
||||
*/
|
||||
@GetMapping("/mess-group")
|
||||
public JsonResponse<Map<String,Object>> messGroup(){
|
||||
public JsonResponse<Map<String, Object>> messGroup() {
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
if(StringUtil.isBlank(aid)){
|
||||
if (StringUtil.isBlank(aid)) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
Map<String, Object> map = service.messGroup(aid);
|
||||
@@ -255,27 +264,27 @@ public class MessageApi extends ApiBaseController {
|
||||
/**
|
||||
* 移动端
|
||||
* 按用户删除消息 暂时不用
|
||||
* */
|
||||
*/
|
||||
@GetMapping("/remove")
|
||||
public JsonResponse<Boolean> remove(String aid){
|
||||
if(StringUtil.isBlank(aid)){
|
||||
public JsonResponse<Boolean> remove(String aid) {
|
||||
if (StringUtil.isBlank(aid)) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
try {
|
||||
service.remove(aid);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
return error("参数异常",e.getMessage());
|
||||
return error("参数异常", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户消息 查最新的一条
|
||||
* */
|
||||
*/
|
||||
@GetMapping
|
||||
public JsonResponse<List<Message>> userMess(){
|
||||
public JsonResponse<List<Message>> userMess() {
|
||||
String aid = this.getCurrent().getAccountId();
|
||||
if(StringUtil.isBlank(aid)){
|
||||
if (StringUtil.isBlank(aid)) {
|
||||
return badRequest("参数异常");
|
||||
}
|
||||
List<Message> messages = service.userMess(aid);
|
||||
@@ -287,5 +296,4 @@ public class MessageApi extends ApiBaseController {
|
||||
* */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.xboe.system.user.api;
|
||||
|
||||
import com.xboe.common.utils.IDGenerator;
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
import com.xboe.core.log.AutoLog;
|
||||
import com.xboe.system.user.entity.Message;
|
||||
import com.xboe.system.user.service.MessageSender;
|
||||
import com.xboe.system.user.vo.BatchMessage;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/remote/xboe/sys/message")
|
||||
public class MessageRpcController extends ApiBaseController {
|
||||
/**
|
||||
* 发布消息
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@AutoLog(module = "消息", action = "发布消息")
|
||||
public JsonResponse<Boolean> save(@RequestBody Message message) {
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
if (StringUtil.isBlank(message.getContent())) {
|
||||
return badRequest("内容不能为空");
|
||||
}
|
||||
try {
|
||||
message.setIsRead(false);
|
||||
message.setMsgType(1);
|
||||
message.setMsgTime(LocalDateTime.now());
|
||||
MessageSender.send(message);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("发布消息失败", e);
|
||||
return error("发布消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/batch-send")
|
||||
@AutoLog(module = "消息", action = "批量发送消息")
|
||||
public JsonResponse<Boolean> batchSave(@RequestBody BatchMessage message) {
|
||||
|
||||
if (message.getAcceptIds() == null || message.getAcceptIds().isEmpty()) {
|
||||
return badRequest("无发送人信息");
|
||||
}
|
||||
|
||||
if (message.getAcceptNames() == null || message.getAcceptNames().isEmpty()) {
|
||||
return badRequest("无发送人姓名信息");
|
||||
}
|
||||
|
||||
if (message.getAcceptIds().size() != message.getAcceptNames().size()) {
|
||||
return badRequest("发送人姓名信息不相符");
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
|
||||
if (StringUtil.isBlank(message.getTitle())) {
|
||||
return badRequest("标题不能为空");
|
||||
}
|
||||
if (StringUtil.isBlank(message.getContent())) {
|
||||
return badRequest("内容不能为空");
|
||||
}
|
||||
try {
|
||||
Message msg = new Message();
|
||||
msg.setId(IDGenerator.generate());
|
||||
msg.setContent(message.getContent());
|
||||
msg.setConType("0");
|
||||
msg.setIsRead(false);
|
||||
msg.setMsgType(1);
|
||||
msg.setPageParams(message.getPageParams());
|
||||
msg.setPageType(message.getPageType());
|
||||
msg.setRefId(message.getRefId());
|
||||
msg.setRefType(message.getRefType());
|
||||
msg.setSendAid(message.getSendAid());
|
||||
msg.setSendName(message.getSendName());
|
||||
msg.setSendType(1);
|
||||
msg.setSource(message.getSource());
|
||||
msg.setTitle(message.getTitle());
|
||||
MessageSender.batchSend(message.getAcceptIds(), message.getAcceptNames(), msg);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("发布消息失败", e);
|
||||
return error("发布消息失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user