mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-24 16:05:08 +08:00
mp:增加【自动回复】的前端实现
This commit is contained in:
@ -8,11 +8,13 @@ import cn.iocoder.yudao.module.mp.convert.message.MpAutoReplyConvert;
|
||||
import cn.iocoder.yudao.module.mp.dal.dataobject.message.MpAutoReplyDO;
|
||||
import cn.iocoder.yudao.module.mp.service.message.MpAutoReplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -37,4 +39,13 @@ public class MpAutoReplyController {
|
||||
return success(MpAutoReplyConvert.INSTANCE.convertPage(pageResult));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@ApiOperation("获得公众号自动回复")
|
||||
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mp:auto-reply:query')")
|
||||
public CommonResult<MpAutoReplyRespVO> getAutoReply(@RequestParam("id") Long id) {
|
||||
MpAutoReplyDO autoReply = mpAutoReplyService.getAutoReply(id);
|
||||
return success(MpAutoReplyConvert.INSTANCE.convert(autoReply));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class MpAutoReplyBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "请求的关键字", example = "关键字", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填")
|
||||
private String requestKeyword;
|
||||
@ApiModelProperty(value = "请求的关键字", example = "关键字", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填")
|
||||
@ApiModelProperty(value = "请求的匹配方式", example = "1", notes = "当 type 为 MpAutoReplyTypeEnum#KEYWORD 时,必填")
|
||||
private Integer requestMatch;
|
||||
|
||||
@ApiModelProperty(value = "请求的消息类型", example = "text", notes = "当 type 为 MpAutoReplyTypeEnum#MESSAGE 时,必填")
|
||||
|
@ -6,6 +6,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@ApiModel("管理后台 - 公众号自动回复 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ -20,4 +22,7 @@ public class MpAutoReplyRespVO extends MpAutoReplyBaseVO {
|
||||
@ApiModelProperty(value = "微信公众号 appid", required = true, example = "wx1234567890")
|
||||
private String appId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间", required = true)
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
@ -27,4 +27,6 @@ public interface MpAutoReplyConvert {
|
||||
|
||||
PageResult<MpAutoReplyRespVO> convertPage(PageResult<MpAutoReplyDO> page);
|
||||
|
||||
MpAutoReplyRespVO convert(MpAutoReplyDO bean);
|
||||
|
||||
}
|
||||
|
@ -21,6 +21,14 @@ public interface MpAutoReplyService {
|
||||
*/
|
||||
PageResult<MpAutoReplyDO> getAutoReplyPage(MpMessagePageReqVO pageVO);
|
||||
|
||||
/**
|
||||
* 获得公众号自动回复
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 自动回复
|
||||
*/
|
||||
MpAutoReplyDO getAutoReply(Long id);
|
||||
|
||||
/**
|
||||
* 当收到消息时,自动回复
|
||||
*
|
||||
|
@ -44,6 +44,11 @@ public class MpAutoReplyServiceImpl implements MpAutoReplyService {
|
||||
return mpAutoReplyMapper.selectPage(pageVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MpAutoReplyDO getAutoReply(Long id) {
|
||||
return mpAutoReplyMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxMpXmlOutMessage replyForMessage(String appId, WxMpXmlMessage wxMessage) {
|
||||
// 第一步,匹配自动回复
|
||||
|
Reference in New Issue
Block a user