Explorar o código

短信群发接口修改

anderx %!s(int64=7) %!d(string=hai) anos
pai
achega
c040c57432

+ 2 - 5
src/main/java/com/goafanti/message/controller/AdminMessageController.java

@@ -342,17 +342,14 @@ public class AdminMessageController extends CertifyApiController{
 		Result res = checkMessageCode(messageCode);
 		Result res = checkMessageCode(messageCode);
 		if (res.getError().isEmpty()) {
 		if (res.getError().isEmpty()) {
 			//发送消息
 			//发送消息
-			res.setData(jtMessageProducerService.MobileMessage(messageCode));
+			res.setData(jtMessageProducerService.saveMobileMessage(messageCode));
 		}
 		}
 		return res;
 		return res;
 	}
 	}
 	
 	
 	private Result checkMessageCode(String messageCode) {
 	private Result checkMessageCode(String messageCode) {
 		Result res = new Result();
 		Result res = new Result();
-		if(StringUtils.isBlank(messageCode)){
-			res.getError().add(buildError("", "消息Code不能为空"));
-		}
-		String regex = "^(SMS_)\\d{8}$";
+		String regex = "^(SMS_)\\d{9}$";
 		Pattern p = Pattern.compile(regex);
 		Pattern p = Pattern.compile(regex);
 		Matcher m = p.matcher(messageCode);
 		Matcher m = p.matcher(messageCode);
 		if ( !m.matches()) {
 		if ( !m.matches()) {

+ 1 - 1
src/main/java/com/goafanti/message/service/JtMessageProducerService.java

@@ -39,5 +39,5 @@ public interface JtMessageProducerService {
 	 */
 	 */
 	Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime, String code,Integer subject,Integer pageNo,Integer pageSize);
 	Pagination<JtMessageProducer> getMessageList(JtMessageProducer messageProducer, String sendStartTime, String sendEndTime, String code,Integer subject,Integer pageNo,Integer pageSize);
 
 
-	int MobileMessage(String messageCode);
+	int saveMobileMessage(String messageCode);
 }
 }

+ 4 - 1
src/main/java/com/goafanti/message/service/impl/JtMessageProducerServiceImpl.java

@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.JtMessageConsumerMapper;
 import com.goafanti.common.dao.JtMessageConsumerMapper;
 import com.goafanti.common.dao.JtMessageProducerMapper;
 import com.goafanti.common.dao.JtMessageProducerMapper;
@@ -133,7 +134,7 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 	}
 	}
 
 
 	@Override
 	@Override
-	public int MobileMessage(String messageCode) {
+	public int saveMobileMessage(String messageCode) {
 		String regex = "^(1[1-9][0-9])\\d{8}$";
 		String regex = "^(1[1-9][0-9])\\d{8}$";
 		Pattern p = Pattern.compile(regex);
 		Pattern p = Pattern.compile(regex);
 		List<String> mobileList=userMapper.getUserListMobile();
 		List<String> mobileList=userMapper.getUserListMobile();
@@ -150,6 +151,8 @@ public class JtMessageProducerServiceImpl  extends BaseMybatisDao<JtMessageProdu
 		MobileMessageUtils.sendMessage(messageCode, null, mobile, accessKey, accessSecret);
 		MobileMessageUtils.sendMessage(messageCode, null, mobile, accessKey, accessSecret);
 		JtMessageProducer producer=new JtMessageProducer();
 		JtMessageProducer producer=new JtMessageProducer();
 		producer.setId(UUID.randomUUID().toString());
 		producer.setId(UUID.randomUUID().toString());
+		producer.setCreater(AFTConstants.DEFAULT_INITIATOR);
+		producer.setTitle("");
 		producer.setSubject(2);
 		producer.setSubject(2);
 		producer.setIsSend(true);
 		producer.setIsSend(true);
 		producer.setIsDraft(false);
 		producer.setIsDraft(false);