From 42809ae81c0de1102063a1ba7bd23a7c016deae0 Mon Sep 17 00:00:00 2001 From: gongbiao Date: Thu, 23 Aug 2018 09:49:59 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81]?= =?UTF-8?q?[=E4=BF=AE=E6=94=B9]:=E5=8F=91=E9=80=81=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E6=B7=BB=E5=8A=A0C=E7=AB=AFcontroller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WxMsgValidationcodeController.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 mallinkCApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java diff --git a/mallinkCApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java b/mallinkCApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java new file mode 100644 index 000000000..4c0b279a1 --- /dev/null +++ b/mallinkCApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java @@ -0,0 +1,68 @@ +package com.simple.controller; + +import com.simple.common.ResultData; +import com.simple.domain.po.WxMsgValidationcode; +import com.simple.service.WxMerchantBUserService; +import com.simple.service.WxMerchantService; +import com.simple.service.WxMsgValidationcodeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("wxMsgValidationcode") +@Api(description="短信验证相关接口") +public class WxMsgValidationcodeController extends BaseController { + private Logger logger = Logger.getLogger(WxMsgValidationcodeController.class); + + @Autowired + private WxMsgValidationcodeService wxMsgValidationcodeService; + + @Autowired + private WxMerchantBUserService wxMerchantBUserService; + + @Autowired + private WxMerchantService wxMerchantService; + + + + @GetMapping("sendvalidationcode") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), + @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), + @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) + public ResultData sendvalidationcode(String tenantId, String phone, Integer type, String appid) { + + WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); + wxMsgValidationcode.setTenantId(tenantId); + wxMsgValidationcode.setPhone(phone); + wxMsgValidationcode.setType(type); + wxMsgValidationcode.setAppid(appid); + return wxMsgValidationcodeService.sendvalidationcode(wxMsgValidationcode); + } + + @GetMapping("hasvalidationcode") + @ApiImplicitParams({ + @ApiImplicitParam(name = "tenantId", value = "租户ID", dataType = "String", paramType = "query"), + @ApiImplicitParam(name = "phone", value = "手机号", dataType = "String", paramType = "query", required = true), + @ApiImplicitParam(name = "type", value = "场景", dataType = "Integer", paramType = "query", required = true), + @ApiImplicitParam(name = "code", value = "验证码", dataType = "String", paramType = "query", required = true), + @ApiImplicitParam(name = "appid", value = "appid", dataType = "String", paramType = "query", required = true)}) + public ResultData hasvalidationcode(String tenantId, String phone, Integer type, String code, String appid) { + WxMsgValidationcode wxMsgValidationcode = new WxMsgValidationcode(); + wxMsgValidationcode.setTenantId(tenantId); + wxMsgValidationcode.setPhone(phone); + wxMsgValidationcode.setType(type); + wxMsgValidationcode.setCode(code); + wxMsgValidationcode.setAppid(appid); + return wxMsgValidationcodeService.hasvalidationcode(wxMsgValidationcode); + } + + +}