Commit 2f5047d5 authored by qinxunjia's avatar qinxunjia

测试请求

parent ee15d7ea
......@@ -3,22 +3,22 @@ package com.jz.sms.api;
import com.jz.sms.chuanlan.service.ChuanLanSmsService;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@RestController
@RequestMapping("test")
@RequestMapping("/test")
public class BizController {
@Autowired
private ChuanLanSmsService service;
private static final Logger log = LoggerFactory.getLogger(BizController.class);
@RequestMapping("index")
public String index() {
return "success";
}
@Autowired
private ChuanLanSmsService service;
/**
......@@ -26,33 +26,37 @@ public class BizController {
*
* @return
*/
@RequestMapping("/sms/template")
public XfaceDmHubTemplateResponseDTO template(XfaceDmHubTemplateRequestDTO requestDTO) {
XfaceDmHubTemplateResponseDTO responseDTO = service.createTemplate(requestDTO);
return responseDTO;
@PostMapping("/sms/template")
public String template(@RequestParam Map<String, Object> params) {
log.info("**********创建模板入参*******:{}", params);
return "ok";
}
/**
* 批量发送(通知或营销类)
*
* @return
*/
@RequestMapping("/sms/batch")
public String batch() {
@PostMapping("/sms/batch")
public String batch(@RequestParam Map<String, Object> params) {
log.info("**********批量发送入参*******:{}", params);
return "success";
}
/**
* 发送单条(通知或营销类)
*
* @return
*/
@RequestMapping("/sms/send")
public String send() {
public String send(@RequestParam Map<String, Object> params) {
log.info("**********单条发送入参*******:{}", params);
return "success";
}
}
......@@ -3,7 +3,10 @@ package com.jz.sms.repository;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.sms.repository.domain.SmsTemplateInfo;
import com.jz.sms.repository.domain.SysBatchInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface SysBatchMapper extends BaseMapper<SysBatchInfo> {
......
......@@ -3,7 +3,10 @@ package com.jz.sms.repository;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.sms.repository.domain.SmsTemplateInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Repository
public interface TemplateMapper extends BaseMapper<SmsTemplateInfo> {
......
......@@ -16,11 +16,11 @@ import org.springframework.stereotype.Service;
public class MessageServiceImpl implements MessageService {
@Autowired
private SysBatchMapper sysBatchMapper;
@Autowired
private TemplateMapper templateMapper;
// @Autowired
// private SysBatchMapper sysBatchMapper;
//
// @Autowired
// private TemplateMapper templateMapper;
@Autowired
private ChuanLanSmsService chuanLanSmsService;
......@@ -56,18 +56,18 @@ public class MessageServiceImpl implements MessageService {
String audienceIdType = requestDTO.getAudienceIdType();
JSONObject data = requestDTO.getData();
// 获取模板信息
SmsTemplateInfo templateInfo = templateMapper.selectOne(new SmsTemplateInfo(templateId));
if (null == templateInfo) {
return null;
}
String content = templateInfo.getContent();
String smsType = templateInfo.getType();
// 系统记录批次,不管是单发还是批量发送都当是批量发送处理
SysBatchInfo info = new SysBatchInfo();
info.setBatchId(IdHandler.nextId());
Integer insert = sysBatchMapper.insert(info);
// SmsTemplateInfo templateInfo = templateMapper.selectOne(new SmsTemplateInfo(templateId));
// if (null == templateInfo) {
// return null;
// }
//
// String content = templateInfo.getContent();
// String smsType = templateInfo.getType();
//
// // 系统记录批次,不管是单发还是批量发送都当是批量发送处理
// SysBatchInfo info = new SysBatchInfo();
// info.setBatchId(IdHandler.nextId());
// Integer insert = sysBatchMapper.insert(info);
// chuanLanSmsService.sendByFixed(content);
......
......@@ -18,7 +18,7 @@ public class XfaceCreateTempLateWrapper {
XfaceCreateTempLateWrapperImpl xfaceCreateTempLateWrapperImpl;
// @ApiOperation(value = "SMS0001 短信模板创建", httpMethod = "POST")
@PostMapping(value = "/sms/template/create")
@PostMapping(value = "/sms/template")
@ResponseBody
public XfaceDmHubTemplateResponseDTO processRequest(@Valid @RequestBody XfaceDmHubTemplateRequestDTO requestDTO) {
......
<!--<?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.qianlian.cloud.tms.repository.BaApplicationConfigMapper">-->
<?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.jz.sms.repository.MessageMapper">
<!--</mapper>-->
\ No newline at end of file
</mapper>
\ No newline at end of file
<?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.jz.sms.repository.SysBatchMapper">
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment