feat:机器人消息模板接口
This commit is contained in:
parent
f183fab51e
commit
0feede81b8
@ -4,12 +4,16 @@ import cn.axzo.framework.domain.web.result.ApiPageResult;
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.im.center.api.vo.req.MsgTemplatePageQuery;
|
||||
import cn.axzo.im.center.api.vo.req.RobotMsgTemplateReq;
|
||||
import cn.axzo.im.center.api.vo.resp.MsgTemplateResp;
|
||||
import cn.axzo.im.center.api.vo.resp.RobotMsgTemplateResp;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机器人消息模板管理API
|
||||
*
|
||||
@ -32,6 +36,15 @@ public interface RobotMsgTemplateApi {
|
||||
ApiPageResult<RobotMsgTemplateResp> queryRobotMsgTemplateList(@RequestBody @Validated MsgTemplatePageQuery msgTemplatePageQuery);
|
||||
|
||||
|
||||
/**
|
||||
* 查询可选的消息模板列表
|
||||
*
|
||||
* @return 消息模板列表
|
||||
*/
|
||||
@GetMapping("api/im/robot/msgTemplate/list")
|
||||
ApiResult<List<MsgTemplateResp>> queryMsgTemplateList();
|
||||
|
||||
|
||||
/**
|
||||
* 更新机器人消息模板关联关系
|
||||
*
|
||||
|
||||
@ -0,0 +1,57 @@
|
||||
package cn.axzo.im.center.api.vo.resp;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模板关联信息
|
||||
*
|
||||
* @author zuoqinbo
|
||||
* @version V1.0
|
||||
* @date 2023/10/9 16:01
|
||||
*/
|
||||
@Data
|
||||
public class MsgTemplateResp {
|
||||
|
||||
/**
|
||||
* 消息模板Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 消息模板名称
|
||||
*/
|
||||
private String msgName = "Mock消息模板名称";
|
||||
|
||||
/**
|
||||
* 消息模板Id
|
||||
*/
|
||||
private String msgTemplateId;
|
||||
|
||||
|
||||
/**
|
||||
* 消息类型
|
||||
*/
|
||||
private String msgType = "Mock消息类型";
|
||||
|
||||
/**
|
||||
* 消息标题
|
||||
*/
|
||||
private String msgHeader = "Mock消息标题";
|
||||
|
||||
/**
|
||||
* 消息模板内容
|
||||
*/
|
||||
private String msgContent = "Mock消息模板内容";
|
||||
|
||||
/**
|
||||
* 消息分类
|
||||
*/
|
||||
private String msgCategory = "Mock消息分类";
|
||||
|
||||
/**
|
||||
* 模板上架状态
|
||||
*/
|
||||
private String status = "enabled";
|
||||
|
||||
|
||||
}
|
||||
@ -5,6 +5,7 @@ cn\axzo\im\center\api\vo\req\UpdateRobotInfoReq.class
|
||||
cn\axzo\im\center\api\vo\req\UserAccountReq.class
|
||||
cn\axzo\im\center\api\vo\req\UpdateRobotTagReq$UpdateRobotTagReqBuilder.class
|
||||
cn\axzo\im\center\api\vo\resp\RobotInfoResp.class
|
||||
cn\axzo\im\center\api\vo\resp\MsgTemplateResp.class
|
||||
cn\axzo\im\center\api\vo\req\RobotTagReq$RobotTagReqBuilder.class
|
||||
cn\axzo\im\center\api\vo\req\RobotTagQuery$RobotTagQueryBuilder.class
|
||||
cn\axzo\im\center\api\vo\req\MessageInfo.class
|
||||
|
||||
@ -26,6 +26,10 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.msgcenter</groupId>
|
||||
<artifactId>msg-center-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.framework</groupId>
|
||||
<artifactId>axzo-web-spring-boot-starter</artifactId>
|
||||
|
||||
@ -6,15 +6,16 @@ import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.im.center.api.feign.RobotMsgTemplateApi;
|
||||
import cn.axzo.im.center.api.vo.req.MsgTemplatePageQuery;
|
||||
import cn.axzo.im.center.api.vo.req.RobotMsgTemplateReq;
|
||||
import cn.axzo.im.center.api.vo.resp.MsgTemplateResp;
|
||||
import cn.axzo.im.center.api.vo.resp.RobotMsgTemplateResp;
|
||||
import cn.axzo.im.center.api.vo.resp.RobotTagResp;
|
||||
import cn.axzo.im.channel.netease.INotifyService;
|
||||
import cn.axzo.im.service.RobotMsgTemplateService;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机器人消息模板管理API
|
||||
@ -34,10 +35,22 @@ public class RobotMsgTemplateController implements RobotMsgTemplateApi {
|
||||
|
||||
@Override
|
||||
public ApiPageResult<RobotMsgTemplateResp> queryRobotMsgTemplateList(MsgTemplatePageQuery msgTemplatePageQuery) {
|
||||
PageResp<RobotMsgTemplateResp> robotMsgTemplateResp = robotMsgTemplateService.queryRobotMsgTemplateOfPage(msgTemplatePageQuery);
|
||||
PageResp<RobotMsgTemplateResp> robotMsgTemplateResp = robotMsgTemplateService.queryRobotMsgTemplateOfPage(msgTemplatePageQuery);
|
||||
return ApiPageResult.ok(robotMsgTemplateResp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResult<List<MsgTemplateResp>> queryMsgTemplateList() {
|
||||
List<MsgTemplateResp> msgTemplates = Lists.newArrayList();
|
||||
for (int i = 0; i < 5; i++) {
|
||||
MsgTemplateResp msgTemplateResp = new MsgTemplateResp();
|
||||
msgTemplateResp.setId(i + "");
|
||||
msgTemplateResp.setMsgTemplateId("templateId"+i);
|
||||
msgTemplates.add(msgTemplateResp);
|
||||
}
|
||||
return ApiResult.ok(msgTemplates);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResult<RobotMsgTemplateResp> updateRobotMsgTemplateList(RobotMsgTemplateReq robotMsgTemplateReq) {
|
||||
RobotMsgTemplateResp robotMsgTemplateResp = robotMsgTemplateService.updateRobotMsgTemplateList(robotMsgTemplateReq);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user