Commit 528ba3c0 authored by danzhongqin's avatar danzhongqin

定义DTO

parent 3a7c4917
package com.jz.sms.api;
import com.jz.sms.chuanlan.SendService;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -7,6 +11,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("test")
public class BizController {
@Autowired
private SendService service;
@RequestMapping("index")
public String index() {
......@@ -20,9 +27,9 @@ public class BizController {
* @return
*/
@RequestMapping("/sms/template")
public String template() {
return "success";
public XfaceDmHubTemplateResponseDTO template(XfaceDmHubTemplateRequestDTO requestDTO) {
XfaceDmHubTemplateResponseDTO responseDTO = service.send(requestDTO);
return responseDTO;
}
......
package com.jz.sms.chuanlan;
import java.util.Map;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
public interface SendService {
Map<String, Object> send(Map<String, Object> params);
XfaceDmHubTemplateResponseDTO send(XfaceDmHubTemplateRequestDTO requestDTO);
}
......@@ -2,6 +2,10 @@ package com.jz.sms.chuanlan.impl;
import com.jz.sms.chuanlan.SendService;
import com.jz.sms.dto.XfaceClTemplateRequestDTO;
import com.jz.sms.dto.XfaceClTemplateResponseDTO;
import com.jz.sms.dto.XfaceDmHubTemplateRequestDTO;
import com.jz.sms.dto.XfaceDmHubTemplateResponseDTO;
import org.springframework.stereotype.Service;
import java.util.Map;
......@@ -11,13 +15,19 @@ public class SendServiceImpl implements SendService {
@Override
public Map<String, Object> send(Map<String, Object> params) {
return null;
public XfaceDmHubTemplateResponseDTO send(XfaceDmHubTemplateRequestDTO requestDTO) {
/**
* 调用创蓝的业务逻辑.....
* requestDTO.getXXX....
*/
XfaceClTemplateRequestDTO clRequestDto = new XfaceClTemplateRequestDTO();
XfaceClTemplateResponseDTO clResponseDTO = new XfaceClTemplateResponseDTO();
/**
* 调用结果包装到DM Hub Response中
*/
XfaceDmHubTemplateResponseDTO responseDTO = new XfaceDmHubTemplateResponseDTO();
return responseDTO;
}
}
package com.jz.sms.dto;
public class XfaceClTemplateRequestDTO {
}
package com.jz.sms.dto;
public class XfaceClTemplateResponseDTO {
}
package com.jz.sms.dto;
public class XfaceDmHubTemplateRequestDTO {
}
package com.jz.sms.dto;
public class XfaceDmHubTemplateResponseDTO {
}
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