diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumMsgOpen.java b/mallinkService/src/main/java/com/iformall/enums/EnumMsgOpen.java new file mode 100644 index 000000000..7ce8f7664 --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/enums/EnumMsgOpen.java @@ -0,0 +1,36 @@ +package com.iformall.enums; + +/** + * 短信发送开关 + */ +public enum EnumMsgOpen { + + OPEN(0, "open"), + CLOSE(1, "close"), + ; + + public static EnumMsgOpen getEnum(Integer code) { + for (EnumMsgOpen value : values()) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + private Integer code; + private String message; + + EnumMsgOpen(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public String getMessage() { + return message; + } +} diff --git a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java index 422929f01..d91116eaa 100644 --- a/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/msg/impl/SendSmsServiceImpl.java @@ -6,13 +6,12 @@ import com.iformall.common.IdWorker; import com.iformall.domain.po.*; import com.iformall.domain.po.msg.BaseMsg; import com.iformall.domain.po.msg.WxMsgRecord; -import com.iformall.enums.EnumMsgLimitType; +import com.iformall.enums.EnumMsgOpen; import com.iformall.enums.EnumVerifyCode; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxMsgConfigMapper; import com.iformall.mapper.WxMsgValidationcodeMapper; import com.iformall.mapper.WxMsgValidationcodeModelMapper; -import com.iformall.service.WxMsgLimitService; import com.iformall.service.msg.MsgSendService; import com.iformall.service.WxMsgValidationcodeService; import com.iformall.utils.WiwideUtil; @@ -41,9 +40,6 @@ public class SendSmsServiceImpl implements MsgSendService { @Autowired private WxMsgValidationcodeService wxMsgValidationcodeService; - @Autowired - private WxMsgLimitService wxMsgLimitService; - @Override public void send(BaseMsg baseMsg) throws Exception{ WxMsgRecord record = (WxMsgRecord)baseMsg; @@ -67,6 +63,7 @@ public class SendSmsServiceImpl implements MsgSendService { WxMsgValidationcodeModel wxMsgValidationcodeModel = new WxMsgValidationcodeModel(); wxMsgValidationcodeModel.setTenantId(record.getTenantId()); wxMsgValidationcodeModel.setType(record.getModelType()); + wxMsgValidationcodeModel.setOpen(EnumMsgOpen.OPEN.getCode()); List modelList = wxMsgValidationcodeModelMapper.findList(wxMsgValidationcodeModel); if(CollectionUtils.isEmpty(modelList)){ throw new MallinkException(ErrorCode.MSG_MODEL_NOT_FOUND);