Commit 528ba3c0 authored by danzhongqin's avatar danzhongqin

定义DTO

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