Commit 47bed68d authored by qinxunjia's avatar qinxunjia

修改一些内容

parent 78c171e1
...@@ -48,6 +48,24 @@ ...@@ -48,6 +48,24 @@
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--redis-->
<!--rabbitmq-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.62</version>
</dependency>
</dependencies> </dependencies>
......
...@@ -28,7 +28,7 @@ public class BizController { ...@@ -28,7 +28,7 @@ public class BizController {
*/ */
@RequestMapping("/sms/template") @RequestMapping("/sms/template")
public XfaceDmHubTemplateResponseDTO template(XfaceDmHubTemplateRequestDTO requestDTO) { public XfaceDmHubTemplateResponseDTO template(XfaceDmHubTemplateRequestDTO requestDTO) {
XfaceDmHubTemplateResponseDTO responseDTO = service.send(requestDTO); XfaceDmHubTemplateResponseDTO responseDTO = service.createTemplate(requestDTO);
return responseDTO; return responseDTO;
} }
......
package com.jz.sms.chuanlan.service; package com.jz.sms.chuanlan.service;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO; import com.jz.sms.dto.*;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
public interface ChuanLanSmsService { public interface ChuanLanSmsService {
...@@ -9,9 +8,15 @@ public interface ChuanLanSmsService { ...@@ -9,9 +8,15 @@ public interface ChuanLanSmsService {
XfaceDmHubTemplateResponseDTO createTemplate(XfaceDmHubTemplateRequestDTO requestDTO); XfaceDmHubTemplateResponseDTO createTemplate(XfaceDmHubTemplateRequestDTO requestDTO);
XfaceDmHubTemplateResponseDTO sendByFixed(XfaceDmHubTemplateRequestDTO requestDTO); XfaceDmHubSendResponseDTO sendByFixed(XfaceDmHubSendRequestDTO requestDTO);
XfaceDmHubTemplateResponseDTO sendByVariable(XfaceDmHubTemplateRequestDTO requestDTO); XfaceDmHubSendResponseDTO sendByVariable(XfaceDmHubSendRequestDTO requestDTO);
XfaceDmHubSendResponseDTO sendBatchByFixed(XfaceDmHubSendRequestDTO requestDTO);
XfaceDmHubBatchSendResponseDTO sendBatchByVariable(XfaceDmHubBatchSendRequestDTO requestDTO);
} }
...@@ -2,10 +2,7 @@ package com.jz.sms.chuanlan.service.impl; ...@@ -2,10 +2,7 @@ package com.jz.sms.chuanlan.service.impl;
import com.jz.sms.chuanlan.service.ChuanLanSmsService; import com.jz.sms.chuanlan.service.ChuanLanSmsService;
import com.jz.sms.dto.XfaceClTemplateRequestDTO; import com.jz.sms.dto.*;
import com.jz.sms.dto.XfaceClTemplateResponseDTO;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -30,17 +27,26 @@ public class ChuanLanSmsServiceImpl implements ChuanLanSmsService { ...@@ -30,17 +27,26 @@ public class ChuanLanSmsServiceImpl implements ChuanLanSmsService {
return responseDTO; return responseDTO;
} }
@Override @Override
public XfaceDmHubTemplateResponseDTO sendByFixed(XfaceDmHubTemplateRequestDTO requestDTO) { public XfaceDmHubSendResponseDTO sendByFixed(XfaceDmHubSendRequestDTO requestDTO) {
return null; return null;
} }
@Override @Override
public XfaceDmHubTemplateResponseDTO sendByVariable(XfaceDmHubTemplateRequestDTO requestDTO) { public XfaceDmHubSendResponseDTO sendByVariable(XfaceDmHubSendRequestDTO requestDTO) {
return null; return null;
} }
@Override
public XfaceDmHubSendResponseDTO sendBatchByFixed(XfaceDmHubSendRequestDTO requestDTO) {
return null;
}
@Override
public XfaceDmHubBatchSendResponseDTO sendBatchByVariable(XfaceDmHubBatchSendRequestDTO requestDTO) {
return null;
}
} }
package com.jz.sms.dto; package com.jz.sms.dto;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
public class XfaceDmHubBatchSendRequestDTO { public class XfaceDmHubBatchSendRequestDTO {
// 批量发送短信的模板id
private String templateId;
// 批次号
private String batchId;
// 短信数据
private List<JSONObject> data;
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public List<JSONObject> getData() {
return data;
}
public void setData(List<JSONObject> data) {
this.data = data;
}
} }
package com.jz.sms.dto; package com.jz.sms.dto;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
public class XfaceDmHubSendRequestDTO { public class XfaceDmHubSendRequestDTO {
// 发送短信的模板ID
private String templateId;
// DMHUb的批次号
private String batchId;
// 渠道类型(初期给到DMHUb系统库的类型,如果是sms,data里面会直接反手机号,
// 如果是customerIdentity.memberId,data返回memberId,需要查询系统memberId用户对应的手机号发送短信)
private String audienceIdType;
// 发送数据
private List<JSONObject> data;
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getBatchId() {
return batchId;
}
public void setBatchId(String batchId) {
this.batchId = batchId;
}
public String getAudienceIdType() {
return audienceIdType;
}
public void setAudienceIdType(String audienceIdType) {
this.audienceIdType = audienceIdType;
}
public List<JSONObject> getData() {
return data;
}
public void setData(List<JSONObject> data) {
this.data = data;
}
} }
package com.jz.sms.service; package com.jz.sms.service;
import com.jz.sms.config.SMSConfig; import com.jz.sms.dto.*;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
import com.jz.sms.repository.MessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service public interface MessageService {
public class MessageService {
/** 数据层 */ XfaceDmHubTemplateResponseDTO createTemplate(XfaceDmHubTemplateRequestDTO requestDTO);
// @Autowired
// private MessageMapper messageMapper;
/** XfaceDmHubSendResponseDTO send(XfaceDmHubSendRequestDTO requestDTO);
* 短信模板创建
* @param requestDTO
* @return
*/
public XfaceDmHubTemplateResponseDTO createTemplate(XfaceDmHubTemplateRequestDTO requestDTO) {
XfaceDmHubTemplateResponseDTO responseDTO = new XfaceDmHubTemplateResponseDTO();
try {
// XfaceClTemplateRequestDTO clTemplateRequestDTO = new XfaceClTemplateRequestDTO();
// XfaceClTemplateResponseDTO clTemplateResponseDTO = new XfaceClTemplateResponseDTO();
// logger.info("短信通道请求URL:"+url);
// logger.info("短信通道返回内容:"+responseStr);
} catch (Exception exception) {
// 记录异常日志
throw exception;
}
return responseDTO;
}
XfaceDmHubBatchSendResponseDTO batchSend(XfaceDmHubBatchSendRequestDTO requestDTO);
} }
package com.jz.sms.service.impl;
import com.jz.sms.config.SMSConfig;
import com.jz.sms.dto.*;
import com.jz.sms.repository.MessageMapper;
import com.jz.sms.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class MessageServiceImpl implements MessageService {
/**
* 数据层
*/
@Autowired
private MessageMapper messageMapper;
/**
* 短信模板创建
*
* @param requestDTO
* @return
*/
@Override
public XfaceDmHubTemplateResponseDTO createTemplate(XfaceDmHubTemplateRequestDTO requestDTO) {
XfaceDmHubTemplateResponseDTO responseDTO = new XfaceDmHubTemplateResponseDTO();
try {
// XfaceClTemplateRequestDTO clTemplateRequestDTO = new XfaceClTemplateRequestDTO();
// XfaceClTemplateResponseDTO clTemplateResponseDTO = new XfaceClTemplateResponseDTO();
// logger.info("短信通道请求URL:"+url);
// logger.info("短信通道返回内容:"+responseStr);
} catch (Exception exception) {
// 记录异常日志
throw exception;
}
return responseDTO;
}
@Override
public XfaceDmHubSendResponseDTO send(XfaceDmHubSendRequestDTO requestDTO) {
return null;
}
@Override
public XfaceDmHubBatchSendResponseDTO batchSend(XfaceDmHubBatchSendRequestDTO requestDTO) {
return null;
}
}
...@@ -2,7 +2,7 @@ package com.jz.sms.wrapper.maintenance; ...@@ -2,7 +2,7 @@ package com.jz.sms.wrapper.maintenance;
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 com.jz.sms.service.MessageService; import com.jz.sms.service.impl.MessageServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service; ...@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
public class XfaceCreateTempLateWrapperImpl { public class XfaceCreateTempLateWrapperImpl {
@Autowired @Autowired
private MessageService messageService; private MessageServiceImpl messageService;
public XfaceDmHubTemplateResponseDTO doProcessRequest(XfaceDmHubTemplateRequestDTO requestDTO) { public XfaceDmHubTemplateResponseDTO doProcessRequest(XfaceDmHubTemplateRequestDTO requestDTO) {
......
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