Commit 2f5047d5 authored by qinxunjia's avatar qinxunjia

测试请求

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