diff --git a/.gitignore b/.gitignore index 48f9436c7c216ea4ed2f7f43864dda3951a2eb2f..992e1a0d06abaf560e1dea3598c1f0bc313cdc6f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ target/ .txlcn/ *.iml -*.versionsBackup \ No newline at end of file +*.versionsBackup +/zlt-register/nacos/data +/zlt-register/nacos/bin/derby.log diff --git a/.idea/httpRequests/http-requests-log.http b/.idea/httpRequests/http-requests-log.http new file mode 100644 index 0000000000000000000000000000000000000000..ec3641062568559a041ab7189fada86379c2afe1 --- /dev/null +++ b/.idea/httpRequests/http-requests-log.http @@ -0,0 +1,448 @@ +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "412304", + "nonce": "1234456546" +} + +<> 2021-12-15T053548.200.json + +### + +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "nonce": "412304" +} + +<> 2021-12-15T053531.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "nonce": "1234567", + "templateId": "19496093", + "mobile": "18235529318", + "codeLen": "6" +} + +<> 2021-12-15T053523.200.json + +### + +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "nonce": "1234456546" +} + +<> 2021-12-15T053515.200.json + +### + +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "none": "1234456546" +} + +<> 2021-12-15T053506.200.json + +### + +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "none": "1234456546" +} + +<> 2021-12-15T053152.200.json + +### + +POST http://localhost:5100/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "none": "1234" +} + +<> 2021-12-15T053005.200.json + +### + +POST http://localhost:5001/verify-code +Content-Type: application/json + +{ + "mobile": "18235529318", + "code": "813135", + "none": "1234" +} + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "nonce": "1234567", + "templateId": "19496093", + "mobile": "18235529318", + "codeLen": "6" +} + +<> 2021-12-15T051439.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "nonce": "1234567", + "templateId": "19496093", + "mobile": "18235529318", + "codeLen": "6" +} + +<> 2021-12-15T051210.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "nonce": "1234567", + "templateId": "19496093", + "mobile": "18235529318", + "codeLen": "6" +} + +<> 2021-12-15T051143.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "nonce": "1234567", + "templateId": "19496093", + "mobile": "18235529318", + "codeLen": "6" +} + +<> 2021-12-15T050611.500.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumber": "13051156821", + "BizId": "505520539552195487^0", + "SendDate": "20211215" +} + +<> 2021-12-15T031222.200.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumber": "18235529318", + "BizId": "505520539552195487^0", + "SendDate": "20211215" +} + +<> 2021-12-15T031135.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "SMS_207890087" +} + +<> 2021-12-15T031056.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890087\",\"SMS_207890087\"]" +} + +<> 2021-12-15T031018.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890086\"]" +} + +<> 2021-12-15T031009.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890087\"]", + "TemplateParamJson": "[\"SMS_207890087\",\"SMS_207890087\"]" +} + +<> 2021-12-15T030951.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890087\"]", + "TemplateParamJson": "[\"SMS_207890086\",\"SMS_207890086\"]" +} + +<> 2021-12-15T030941.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890087\"]", + "TemplateParamJson": "[\"SMS_207890086\",\"SMS_207890086\"]" +} + +<> 2021-12-15T030926.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890087\"]", + "TemplateParamJson": "[\"SMS_207890086\",\"SMS_207890087\"]" +} + +<> 2021-12-15T030841.200.json + +### + +POST http://localhost:5100/send-batch-sms +Content-Type: application/json + +{ + "PhoneNumberJson": "[\"18235529318\",\"13051156821\"]", + "SignNameJson": "[\"浅野科技\",\"浅野科技\"]", + "TemplateCode": "[\"SMS_207890086\",\"SMS_207890087\"]", + "TemplateParamJson": "[\"SMS_207890086\",\"SMS_207890087\"]" +} + +<> 2021-12-15T030711.200.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumber": "18235529318", + "BizId": "453511539550599091^0", + "SendDate": "20211215" +} + +<> 2021-12-15T025459.200.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumber": "18235529318", + "BizId": "453511539550599091^0", + "SendDate": "20211215" +} + +<> 2021-12-15T025415.200.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumber": "18235529318", + "BizId": "453511539550599091^0", + "SendDate": "20211215" +} + +<> 2021-12-15T025222.500.json + +### + +POST http://localhost:5100/query-send-info +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "BizId": "453511539550599091^0", + "SendDate": "20211215" +} + +<> 2021-12-15T025214.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T024426.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T023757.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T023719.200.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T023548.500.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T023452.500.json + +### + +POST http://localhost:5100/send-sms +Content-Type: application/json + +{ + "PhoneNumbers": "18235529318", + "SignName": "浅野科技", + "TemplateCode": "SMS_207890086" +} + +<> 2021-12-15T022832.500.json + +### + +GET http://localhost:5100/query-send-info + +<> 2021-12-15T020628.200.json + +### + +POST http://localhost:5100/query-send-info + +<> 2021-12-15T020621.405.json + +### + +POST http://localhost:5100/send-batch-sms + +<> 2021-12-15T020608.200.json + +### + +POST http://localhost:5100/send-sms + +<> 2021-12-15T020600.200.json + +### + diff --git a/pom.xml b/pom.xml index 6d37a32a5c721ba37295f5a0c37bec5aa381046b..7284c889aea19fc3773d7bf8c7bab02f748cb762 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,7 @@ 1.10 2.2.9.RELEASE 1.12.40 + 3.10.2 2.2.5.RELEASE 1.2.2 zlt-job/**/*, zlt-register/**/*, zlt-web/**/* @@ -62,6 +63,9 @@ hub.zlt.com:8080/microservices-platform -Djava.security.egd=file:/dev/./urandom -Xms128m -Xmx128m + + 0.2.0 + 2.0.8 @@ -398,6 +402,12 @@ aws-java-sdk-s3 ${aws-java-sdk-s3.version} + + + com.aliyun.oss + aliyun-sdk-oss + ${aliyun-oss-java-sdk-s3.version} + org.springframework.cloud spring-cloud-starter-netflix-zuul @@ -430,6 +440,24 @@ pom import + + + + com.aliyun + tea-openapi + ${tea-openapi.version} + + + com.aliyun + dysmsapi20170525 + ${dysmsapi20170525.version} + + + com.zlt + zlt-sms-spring-boot-starter + ${project.version} + + diff --git a/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java b/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java index 93c784f921933459b0b8d53cc87d1ec24123f38c..63d3c95a92d528a5afd80d7169a6d1eb2e872beb 100644 --- a/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java +++ b/zlt-business/file-center/src/main/java/com/central/file/controller/FileController.java @@ -36,8 +36,9 @@ public class FileController { * @throws Exception */ @PostMapping("/files-anon") - public FileInfo upload(@RequestParam("file") MultipartFile file) throws Exception { - return fileService.upload(file); + public FileInfo upload(@RequestParam("file") MultipartFile file, + @RequestParam("folder") String folder){ + return fileService.upload(file, folder); } /** diff --git a/zlt-business/file-center/src/main/java/com/central/file/service/IFileService.java b/zlt-business/file-center/src/main/java/com/central/file/service/IFileService.java index 2e44595f27335394cadc119119c18c8620e5cf32..a03e8e8d3f5853839bf6573aedd3348b3bb8703e 100644 --- a/zlt-business/file-center/src/main/java/com/central/file/service/IFileService.java +++ b/zlt-business/file-center/src/main/java/com/central/file/service/IFileService.java @@ -15,7 +15,7 @@ import com.central.file.model.FileInfo; * @author 作者 owen E-mail: 624191343@qq.com */ public interface IFileService extends IService { - FileInfo upload(MultipartFile file ) throws Exception; + FileInfo upload(MultipartFile file,String folder); PageResult findList(Map params); diff --git a/zlt-business/file-center/src/main/java/com/central/file/service/impl/AbstractIFileService.java b/zlt-business/file-center/src/main/java/com/central/file/service/impl/AbstractIFileService.java index 93e38e1ea6acb8cff3e6b9a481f1559d96945483..ff092a3edb6b736a75d80b037a6724f8dd82d7fb 100644 --- a/zlt-business/file-center/src/main/java/com/central/file/service/impl/AbstractIFileService.java +++ b/zlt-business/file-center/src/main/java/com/central/file/service/impl/AbstractIFileService.java @@ -1,5 +1,6 @@ package com.central.file.service.impl; +import java.io.IOException; import java.util.List; import java.util.Map; @@ -28,12 +29,12 @@ public abstract class AbstractIFileService extends ServiceImpl + */ +@Service +@ConditionalOnProperty(prefix = FileServerProperties.PREFIX, name = "type", havingValue = FileServerProperties.TYPE_ALI_OSS) +public class AliOssService extends AbstractIFileService { + @Resource + private AliOssTemplate aliOssTemplate; + + @Override + protected String fileType() { + return FileServerProperties.TYPE_ALI_OSS; + } + + @Override + protected ObjectInfo uploadFile(MultipartFile file, String folder) { + return aliOssTemplate.upload(file, folder); + } + + @Override + protected void deleteFile(String objectPath) { + aliOssTemplate.delete(objectPath); + } + + @Override + public void out(String id, OutputStream os) { + } +} diff --git a/zlt-business/file-center/src/main/java/com/central/file/service/impl/FastdfsService.java b/zlt-business/file-center/src/main/java/com/central/file/service/impl/FastdfsService.java index fe54278e492c6f33e16698fdc893ab99cce4cd7f..47458f4569cf0ed8519eca72f6e7685e6eeef8b3 100644 --- a/zlt-business/file-center/src/main/java/com/central/file/service/impl/FastdfsService.java +++ b/zlt-business/file-center/src/main/java/com/central/file/service/impl/FastdfsService.java @@ -29,7 +29,7 @@ public class FastdfsService extends AbstractIFileService { } @Override - protected ObjectInfo uploadFile(MultipartFile file) { + protected ObjectInfo uploadFile(MultipartFile file, String folder) { return fdfsTemplate.upload(file); } diff --git a/zlt-business/file-center/src/main/java/com/central/file/service/impl/S3Service.java b/zlt-business/file-center/src/main/java/com/central/file/service/impl/S3Service.java index f87679d6a5ea98f61221ffce1f57acb385cfe023..a38461f0849e986fa2bab8b6c842d64b931cd8df 100644 --- a/zlt-business/file-center/src/main/java/com/central/file/service/impl/S3Service.java +++ b/zlt-business/file-center/src/main/java/com/central/file/service/impl/S3Service.java @@ -34,7 +34,7 @@ public class S3Service extends AbstractIFileService { } @Override - protected ObjectInfo uploadFile(MultipartFile file) { + protected ObjectInfo uploadFile(MultipartFile file, String folder) { return s3Template.upload(file); } diff --git a/zlt-business/file-center/src/main/resources/application.yml b/zlt-business/file-center/src/main/resources/application.yml index 839effbe114100687e5b20530272cf42bad193a8..6fe48d0737747d2523a9f29d984a9988d6614f68 100644 --- a/zlt-business/file-center/src/main/resources/application.yml +++ b/zlt-business/file-center/src/main/resources/application.yml @@ -15,7 +15,7 @@ mybatis-plus: zlt: file-server: - type: s3 + type: alioss #fdfs: # web-url: ${zlt.fdfs.web-url} s3: @@ -23,6 +23,12 @@ zlt: accessKeySecret: ${zlt.s3.accessKeySecret} endpoint: ${zlt.s3.endpoint} bucketName: ${zlt.s3.bucketName} + alioss: + accessKey: ${zlt.alioss.accessKey} + accessKeySecret: ${zlt.alioss.accessKeySecret} + endpoint: ${zlt.alioss.endpoint} + bucketName: ${zlt.alioss.bucketName} + bucketHost: ${zlt.alioss.bucketHost} swagger: enabled: true title: 文件中心 diff --git a/zlt-business/pom.xml b/zlt-business/pom.xml index 8bfb217e48b5db5cc22236c1004ee2aacab2ec78..db9c6cc9fc5c5c07d5b586288a358a6b06643a5c 100644 --- a/zlt-business/pom.xml +++ b/zlt-business/pom.xml @@ -18,5 +18,6 @@ code-generator search-center + third-center \ No newline at end of file diff --git a/zlt-business/third-center/pom.xml b/zlt-business/third-center/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..5db57065f2c253ba145b33c79f950e2f936661ae --- /dev/null +++ b/zlt-business/third-center/pom.xml @@ -0,0 +1,59 @@ + + + + zlt-business + com.zlt + 5.1.0 + + 4.0.0 + jar + third-center + 第三方组件集成 + + + + + com.zlt + zlt-config + + + com.zlt + zlt-common-spring-boot-starter + + + com.zlt + zlt-db-spring-boot-starter + + + com.zlt + zlt-redis-spring-boot-starter + + + + + com.zlt + zlt-swagger2-spring-boot-starter + + + + com.zlt + zlt-sms-spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-web + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + + mysql + mysql-connector-java + + + \ No newline at end of file diff --git a/zlt-business/third-center/src/main/java/com/central/ThirdCenterApp.java b/zlt-business/third-center/src/main/java/com/central/ThirdCenterApp.java new file mode 100644 index 0000000000000000000000000000000000000000..4df143e1c0281931fdbdd26d840618b29f6ba7d6 --- /dev/null +++ b/zlt-business/third-center/src/main/java/com/central/ThirdCenterApp.java @@ -0,0 +1,13 @@ +package com.central; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +public class ThirdCenterApp { + public static void main(String[] args) { + SpringApplication.run(ThirdCenterApp.class, args); + } +} diff --git a/zlt-business/third-center/src/main/java/com/central/third/controller/SmsController.java b/zlt-business/third-center/src/main/java/com/central/third/controller/SmsController.java new file mode 100644 index 0000000000000000000000000000000000000000..d6e12b69fc348fec884a7af88b2deb4d62cccba8 --- /dev/null +++ b/zlt-business/third-center/src/main/java/com/central/third/controller/SmsController.java @@ -0,0 +1,59 @@ +package com.central.third.controller; + +import cn.hutool.core.util.RandomUtil; +import com.central.common.model.Result; +import com.central.common.utils.JsonUtil; +import com.central.third.service.ISmsService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author 杨彬鑫 + */ +@RestController +public class SmsController { + @Resource + private ISmsService iSmsService; + + @PostMapping("/send-sms") + public Result sendSms(@RequestBody Map map) { + // 生成验证码 + String number = RandomUtil.randomNumbers(4); + HashMap params = new HashMap<>(); + params.put("code", number); + map.put("TemplateParam", JsonUtil.toJSONString(params)); + return iSmsService.sendSms(map); + } + + @PostMapping("/send-batch-sms") + public Result sendBatchSms(@RequestBody Map map) { + List> list = new ArrayList<>(); + for (int i = 0; i < 2; i++) { + // 生成验证码 + String number = RandomUtil.randomNumbers(4); + HashMap params = new HashMap<>(); + params.put("code", number); + list.add(params); + } + + map.put("TemplateParamJson", JsonUtil.toJSONString(list)); + return iSmsService.sendBatchSms(map); + } + + @PostMapping("/query-send-info") + public Result QuerySendInfo(@RequestBody Map map) { + return iSmsService.QuerySendInfo(map); + } + + @PostMapping("/verify-code") + public Result VerifyCode(@RequestBody Map map){ + return iSmsService.verifyCode(map); + } +} diff --git a/zlt-business/third-center/src/main/java/com/central/third/service/ISmsService.java b/zlt-business/third-center/src/main/java/com/central/third/service/ISmsService.java new file mode 100644 index 0000000000000000000000000000000000000000..9119d97e21cea0e72033153c95c81c48f504ebd5 --- /dev/null +++ b/zlt-business/third-center/src/main/java/com/central/third/service/ISmsService.java @@ -0,0 +1,45 @@ +package com.central.third.service; + +import com.central.common.model.Result; + +import java.util.Map; + +/** + * 短信业务接口 + * @author 杨彬鑫 + */ +public interface ISmsService { + /** + * 发送短信 + * @param map + * @return + */ + Result sendSms(Map map); + + /** + * 批量发送短信 + * @param map + * @return + */ + Result sendBatchSms(Map map); + + /** + * 查询短信详情 + * @param map + * @return + */ + Result QuerySendInfo(Map map); + + /** + * 短信厂商 + * @return + */ + String SmsType(); + + /** + * 校验验证码 + * @param map + * @return + */ + Result verifyCode(Map map); +} diff --git a/zlt-business/third-center/src/main/java/com/central/third/service/impl/AliSmsServiceImpl.java b/zlt-business/third-center/src/main/java/com/central/third/service/impl/AliSmsServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..dec664748599e6caf7bea6b4fb04ea0feabde0f8 --- /dev/null +++ b/zlt-business/third-center/src/main/java/com/central/third/service/impl/AliSmsServiceImpl.java @@ -0,0 +1,112 @@ +package com.central.third.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.central.common.model.Result; +import com.central.sms.model.alisms.QuerySendInfoCo; +import com.central.sms.model.alisms.SendBatchSmsCo; +import com.central.sms.model.alisms.SendSmsCo; +import com.central.sms.properties.SmsServerProperties; +import com.central.sms.template.AliSmsTemplate; +import com.central.third.service.ISmsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 阿里短信,接口实现类 + * + * @author 杨彬鑫 + */ +@Service +@ConditionalOnProperty(prefix = SmsServerProperties.PREFIX, name = "type", havingValue = "alisms") +public class AliSmsServiceImpl implements ISmsService { + + @Resource + private AliSmsTemplate aliSmsTemplate; + + /** + * 发送短信 + * + * @param map + * @return + */ + @Override + public Result sendSms(Map map) { + SendSmsCo sendSmsCo = BeanUtil.mapToBean(map, SendSmsCo.class, true); + + // 校验参数,非空 + if (StringUtils.isEmpty(sendSmsCo.getPhoneNumbers())) { + return Result.failed("【PhoneNumbers】参数不能为空"); + } + if (StringUtils.isEmpty(sendSmsCo.getSignName())) { + return Result.failed("【SignName】参数不能为空"); + } + if (StringUtils.isEmpty(sendSmsCo.getTemplateCode())) { + return Result.failed("【TemplateCode】参数不能为空"); + } + + return aliSmsTemplate.sendSms(sendSmsCo); + } + + @Override + public Result sendBatchSms(Map map) { + SendBatchSmsCo sendBatchSmsCo = BeanUtil.mapToBean(map, SendBatchSmsCo.class, true); + // 校验参数,非空 + if (StringUtils.isEmpty(sendBatchSmsCo.getPhoneNumberJson())) { + return Result.failed("【PhoneNumberJson】参数不能为空"); + } + if (StringUtils.isEmpty(sendBatchSmsCo.getSignNameJson())) { + return Result.failed("【SignNameJson】参数不能为空"); + } + if (StringUtils.isEmpty(sendBatchSmsCo.getTemplateCode())) { + return Result.failed("【TemplateCode】参数不能为空"); + } + + return aliSmsTemplate.sendBatchSms(sendBatchSmsCo); + } + + /** + * 查询短信详情 + * + * @param map + * @return + */ + @Override + public Result QuerySendInfo(Map map) { + QuerySendInfoCo querySendInfoCo = BeanUtil.mapToBean(map, QuerySendInfoCo.class, true); + + // 校验参数,非空 + if (StringUtils.isEmpty(querySendInfoCo.getPhoneNumber())) { + return Result.failed("【PhoneNumber】参数不能为空"); + } + if (StringUtils.isEmpty(querySendInfoCo.getSendDate())) { + return Result.failed("【SendDate】参数不能为空"); + } + if (querySendInfoCo.getPageSize() == null) { + querySendInfoCo.setPageSize(0L); + } + if (querySendInfoCo.getCurrentPage() == null) { + querySendInfoCo.setCurrentPage(10L); + } + + return aliSmsTemplate.QuerySendInfo(querySendInfoCo); + } + + /** + * 短信厂商 + * + * @return + */ + @Override + public String SmsType() { + return SmsServerProperties.TYPE_ALI_SMS; + } + + @Override + public Result verifyCode(Map map) { + return Result.failed("未开发"); + } +} diff --git a/zlt-business/third-center/src/main/java/com/central/third/service/impl/WyySmsServiceImpl.java b/zlt-business/third-center/src/main/java/com/central/third/service/impl/WyySmsServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..86ad79030df266c4b391a420ec20a8bf47c5c460 --- /dev/null +++ b/zlt-business/third-center/src/main/java/com/central/third/service/impl/WyySmsServiceImpl.java @@ -0,0 +1,58 @@ +package com.central.third.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.central.common.model.Result; +import com.central.sms.model.wyysms.SendSmsCo; +import com.central.sms.model.wyysms.VerifyCodeCo; +import com.central.sms.properties.SmsServerProperties; +import com.central.sms.template.WyySmsTemplate; +import com.central.third.service.ISmsService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 网易云短信,业务实现类 + * @author 杨彬鑫 + */ +@Service +@ConditionalOnProperty(prefix = SmsServerProperties.PREFIX,name = "type",havingValue = "wyysms") +public class WyySmsServiceImpl implements ISmsService { + @Resource + private WyySmsTemplate wyySmsTemplate; + + @Override + public Result sendSms(Map map) { + return wyySmsTemplate.sendSms(BeanUtil.mapToBean(map, SendSmsCo.class,true)); + } + + @Override + public Result sendBatchSms(Map map) { + return Result.failed("厂商暂不提供该方法"); + } + + @Override + public Result QuerySendInfo(Map map) { + return null; + } + + @Override + public String SmsType() { + return SmsServerProperties.TYPE_WYY_SMS; + } + + @Override + public Result verifyCode(Map map) { + VerifyCodeCo verifyCodeCo = BeanUtil.mapToBean(map, VerifyCodeCo.class, true); + if(StringUtils.isEmpty(verifyCodeCo.getMobile())){ + return Result.failed("【Mobile】参数不能为空"); + } + if(StringUtils.isEmpty(verifyCodeCo.getCode())){ + return Result.failed("【Code】参数不能为空"); + } + return wyySmsTemplate.verifyCode(verifyCodeCo); + } +} diff --git a/zlt-business/third-center/src/main/resources/application.yml b/zlt-business/third-center/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..4737f7b4c5dca213e31e5f99e7238d6fe6ab5462 --- /dev/null +++ b/zlt-business/third-center/src/main/resources/application.yml @@ -0,0 +1,34 @@ +spring: + datasource: + url: jdbc:mysql://${zlt.datasource.ip}:3306/third_center?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai + username: ${zlt.datasource.username} + password: ${zlt.datasource.password} + driver-class-name: com.mysql.cj.jdbc.Driver + +mybatis-plus: + mapper-locations: classpath:/mapper/*Mapper.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.central.third.model + global-config: + db-config: + id-type: INPUT + +zlt: + sms-server: + type: wyysms + alisms: + accessKeyId: ${zlt.alisms.accessKeyId} + accessKeySecret: ${zlt.alisms.accessKeySecret} + endpoint: ${zlt.alisms.endpoint} + wyysms: + appKey: 6048288d66a2508d7c2c654f70f29a6d + appSecret: a626dde5c805 + swagger: + enabled: true + title: 文件中心 + description: 文件中心接口文档 + version: 1.0 + base-package: com.central.third.controller + #多租户配置 + tenant: + enable: true \ No newline at end of file diff --git a/zlt-business/third-center/src/main/resources/bootstrap.yml b/zlt-business/third-center/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000000000000000000000000000000000..a3754aa6453bcb91270dab860d5259a556c3526d --- /dev/null +++ b/zlt-business/third-center/src/main/resources/bootstrap.yml @@ -0,0 +1,6 @@ +server: + port: 5100 + +spring: + application: + name: third-center \ No newline at end of file diff --git a/zlt-commons/pom.xml b/zlt-commons/pom.xml index eb15b5545a6f9aecd0896faf35717462c5d3625b..7cb06e7ab832fbaaa8a18b9173c03478165b22f0 100644 --- a/zlt-commons/pom.xml +++ b/zlt-commons/pom.xml @@ -23,5 +23,6 @@ zlt-elasticsearch-spring-boot-starter zlt-oss-spring-boot-starter zlt-zookeeper-spring-boot-starter + zlt-sms-spring-boot-starter \ No newline at end of file diff --git a/zlt-commons/zlt-oss-spring-boot-starter/pom.xml b/zlt-commons/zlt-oss-spring-boot-starter/pom.xml index b68157ec9b21f007552bcc20f73e705df7f0582b..72cd50b6d8d221c4b69c91af31269eddbbc5fe89 100644 --- a/zlt-commons/zlt-oss-spring-boot-starter/pom.xml +++ b/zlt-commons/zlt-oss-spring-boot-starter/pom.xml @@ -24,6 +24,11 @@ aws-java-sdk-s3 true + + + com.aliyun.oss + aliyun-sdk-oss + org.springframework spring-web diff --git a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/config/OssAutoConfigure.java b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/config/OssAutoConfigure.java index 725bc196540081934675352df8ca7b60dda81211..fdfdcacabb50203aea1ecefefcba9baf4c0dd3a3 100644 --- a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/config/OssAutoConfigure.java +++ b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/config/OssAutoConfigure.java @@ -1,6 +1,7 @@ package com.central.oss.config; import com.central.oss.properties.FileServerProperties; +import com.central.oss.template.AliOssTemplate; import com.central.oss.template.FdfsTemplate; import com.central.oss.template.S3Template; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -14,7 +15,7 @@ import org.springframework.context.annotation.Import; * Github: https://github.com/zlt2000 */ @EnableConfigurationProperties(FileServerProperties.class) -@Import({FdfsTemplate.class, S3Template.class}) +@Import({FdfsTemplate.class, S3Template.class, AliOssTemplate.class}) public class OssAutoConfigure { } diff --git a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/ALiOssProperties.java b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/ALiOssProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..b2011bc16895bc2b38257cc2625a0bce92d345c6 --- /dev/null +++ b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/ALiOssProperties.java @@ -0,0 +1,36 @@ +package com.central.oss.properties; + +import lombok.Getter; +import lombok.Setter; + +/** + * ali oss协议配置 + * + * @author 杨彬鑫 + * @date 2021/12/13 + *

+ */ +@Setter +@Getter +public class ALiOssProperties { + /** + * 密钥key + */ + private String accessKey; + /** + * 密钥密码 + */ + private String accessKeySecret; + /** + * 端点 + */ + private String endpoint; + /** + * bucket名称 + */ + private String bucketName; + /** + * bucket域名 + */ + private String bucketHost; +} diff --git a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/FileServerProperties.java b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/FileServerProperties.java index ac5a786dcd85ba710e539e01e9ae5d0a1b7e9fdf..e36b543c1578028e4f1593e13e72151b308df377 100644 --- a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/FileServerProperties.java +++ b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/properties/FileServerProperties.java @@ -18,6 +18,7 @@ public class FileServerProperties { public static final String PREFIX = "zlt.file-server"; public static final String TYPE_FDFS = "fastdfs"; public static final String TYPE_S3 = "s3"; + public static final String TYPE_ALI_OSS = "alioss"; /** * 为以下2个值,指定不同的自动化配置 @@ -35,4 +36,9 @@ public class FileServerProperties { * fastDFS配置 */ FdfsProperties fdfs = new FdfsProperties(); + + /** + * alibaba oss配置 + */ + ALiOssProperties aliOss = new ALiOssProperties(); } diff --git a/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/template/AliOssTemplate.java b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/template/AliOssTemplate.java new file mode 100644 index 0000000000000000000000000000000000000000..e4a0774bb1c55d379082af1d12ce7329c5ebac75 --- /dev/null +++ b/zlt-commons/zlt-oss-spring-boot-starter/src/main/java/com/central/oss/template/AliOssTemplate.java @@ -0,0 +1,76 @@ +package com.central.oss.template; + +import com.aliyun.oss.OSS; +import com.aliyun.oss.OSSClientBuilder; +import com.aliyun.oss.common.comm.ResponseMessage; +import com.aliyun.oss.model.PutObjectResult; +import com.central.oss.model.ObjectInfo; +import com.central.oss.properties.FileServerProperties; +import lombok.SneakyThrows; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.IOException; +import java.util.UUID; + +/** + * 阿里oss,文件上传 + * + * @author 杨彬鑫 + */ +@ConditionalOnClass(OSS.class) +@ConditionalOnProperty(prefix = FileServerProperties.PREFIX, name = "type", havingValue = FileServerProperties.TYPE_ALI_OSS) +public class AliOssTemplate { + private static final String PATH_SPLIT = "/"; + + @Resource + private FileServerProperties fileProperties; + + /** + * 上传文件 + * + * @param file 文件 + * @param folder 子目录 + * @return + * @throws IOException + */ + @SneakyThrows + public ObjectInfo upload(MultipartFile file, String folder) { + // 文件名 + String fileName = file.getOriginalFilename(); + + //获取文件的后缀名 .jpg + String newFileName = UUID.randomUUID().toString(); + String suffix = fileName.substring(fileName.lastIndexOf(".")); + String filePath = folder + "/" + newFileName + suffix; + + OSS ossClient = new OSSClientBuilder().build(fileProperties.getAliOss().getEndpoint(), fileProperties.getAliOss().getAccessKey(), fileProperties.getAliOss().getAccessKeySecret()); + + // 桶名称,地址 + PutObjectResult putObjectResult = ossClient.putObject(fileProperties.getAliOss().getBucketName(), filePath, file.getInputStream()); + ResponseMessage response = putObjectResult.getResponse(); + + ossClient.shutdown(); + + ObjectInfo info = new ObjectInfo(); + info.setObjectPath(filePath); + info.setObjectUrl(fileProperties.getAliOss().getBucketHost() + PATH_SPLIT + info.getObjectPath()); + return info; + } + + /** + * 删除对象 + * + * @param objectPath 对象路径 + */ + public void delete(String objectPath) { + if (!StringUtils.isEmpty(objectPath)) { + OSS ossClient = new OSSClientBuilder().build(fileProperties.getAliOss().getEndpoint(), fileProperties.getAliOss().getAccessKey(), fileProperties.getAliOss().getAccessKeySecret()); + + ossClient.deleteObject(fileProperties.getAliOss().getBucketName(), objectPath); + } + } +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/pom.xml b/zlt-commons/zlt-sms-spring-boot-starter/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..b024fc1b82f6389acb0d04a0339c66ce113f34ed --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/pom.xml @@ -0,0 +1,46 @@ + + + + zlt-commons + com.zlt + 5.1.0 + + 4.0.0 + jar + zlt-sms-spring-boot-starter + 短信通用组件 + + + + org.springframework + spring-web + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + com.aliyun + tea-openapi + true + + + com.aliyun + dysmsapi20170525 + + + + com.zlt + zlt-common-core + + + org.apache.httpcomponents + httpclient + + + \ No newline at end of file diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/config/SmsAutoConfigure.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/config/SmsAutoConfigure.java new file mode 100644 index 0000000000000000000000000000000000000000..846ba2011763e3def2e0c260578f800fe3ac6ce9 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/config/SmsAutoConfigure.java @@ -0,0 +1,15 @@ +package com.central.sms.config; + +import com.central.sms.properties.SmsServerProperties; +import com.central.sms.template.AliSmsTemplate; +import com.central.sms.template.WyySmsTemplate; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Import; + +/** + * @author 杨彬鑫 + */ +@EnableConfigurationProperties(SmsServerProperties.class) +@Import({AliSmsTemplate.class, WyySmsTemplate.class}) +public class SmsAutoConfigure { +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoCo.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoCo.java new file mode 100644 index 0000000000000000000000000000000000000000..a0b218885bdbb0803efc35540c5bcdeabc3d1195 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoCo.java @@ -0,0 +1,36 @@ +package com.central.sms.model.alisms; + +import lombok.Data; + +/** + * 根据短信发送日期查看发送记录和短信内容,请求参数Co + * @author 杨彬鑫 + */ +@Data +public class QuerySendInfoCo { + /** + * 接收短信的手机号码。 + */ + private String PhoneNumber; + /** + * 发送回执ID,即发送流水号 + */ + private String BizId; + /** + * 短信发送日期,支持查询最近30天的记录。 + * + * 注意:格式为yyyyMMdd,例如20181225。 + */ + private String SendDate; + /** + * 分页查看发送记录,指定每页显示的短信记录数量。 + * + * 取值范围为1~50。 + */ + private Long PageSize; + /** + * + * 分页查看发送记录,指定发送记录的当前页码。 + */ + private Long CurrentPage; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoDto.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoDto.java new file mode 100644 index 0000000000000000000000000000000000000000..e9ee1d4cd3713996eede1f167a2fbf88f1e2369d --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/QuerySendInfoDto.java @@ -0,0 +1,40 @@ +package com.central.sms.model.alisms; + +import com.aliyun.tea.NameInMap; +import lombok.Data; + +/** + * 根据短信发送日期查看发送记录和短信内容,返回结果Dto + * @author 杨彬鑫 + */ +@Data +public class QuerySendInfoDto { + /** + * 请求状态码。 + * + * 返回OK代表请求成功。 + */ + private String code; + /** + * 状态码的描述。 + */ + private String message; + /** + * 请求ID。 + */ + private String requestId; + + private SmsSendDetailDto[] smsSendDetailDTOs; + + @Data + class SmsSendDetailDto{ + public String errCode; + public String templateCode; + public String outId; + public String receiveDate; + public String sendDate; + public String phoneNum; + public String content; + public Long sendStatus; + } +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendBatchSmsCo.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendBatchSmsCo.java new file mode 100644 index 0000000000000000000000000000000000000000..c1e3a87fbf23c74a87d31a6df8a4807508797fcf --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendBatchSmsCo.java @@ -0,0 +1,34 @@ +package com.central.sms.model.alisms; + +import lombok.Data; + +/** + * 批量发送短信,请求参数Co + * @author 杨彬鑫 + */ +@Data +public class SendBatchSmsCo { + /** + * 接收短信的手机号码,JSON数组格式。 + */ + private String PhoneNumberJson; + /** + * 短信签名名称,JSON数组格式。 + * + * 注意:必须是已添加、并通过审核的短信签名;且短信签名的个数必须与手机号码的个数相同、内容一一对应。 + */ + private String SignNameJson; + /** + * 短信模板CODE。 + */ + private String TemplateCode; + /** + * 短信模板变量对应的实际值,JSON格式。 + */ + private String TemplateParamJson; + /** + * 上行短信扩展码,JSON数组格式。 + */ + private String SmsUpExtendCodeJson; + +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsCo.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsCo.java new file mode 100644 index 0000000000000000000000000000000000000000..412328ceccf2251db381ba247bd2998706dbb7e7 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsCo.java @@ -0,0 +1,35 @@ +package com.central.sms.model.alisms; + +import lombok.Data; + +/** + * 发送短信,请求参数Co + * @author 杨彬鑫 + */ +@Data +public class SendSmsCo { + /** + * 接收短信的手机号码 + */ + private String PhoneNumbers; + /** + * 短信签名名称 + */ + private String SignName; + /** + * 短信模板ID + */ + private String TemplateCode; + /** + * 短信模板变量对应的实际值,JSON格式 + */ + private String TemplateParam; + /** + * 上行短信扩展码 + */ + private String SmsUpExtendCode; + /** + * 外部流水扩展字段 + */ + private String OutId; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsDto.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsDto.java new file mode 100644 index 0000000000000000000000000000000000000000..3d4e849a3b5aaa31e982dbeab03edffab14ec27d --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/alisms/SendSmsDto.java @@ -0,0 +1,29 @@ +package com.central.sms.model.alisms; + +import lombok.Data; + +/** + * 发送短信,返回结果Dto + * @author 杨彬鑫 + */ +@Data +public class SendSmsDto { + /** + * 请求状态码。 + * + * 返回OK代表请求成功。 + */ + private String code; + /** + * 状态码的描述。 + */ + private String message; + /** + * 发送回执ID。 + */ + private String bizId; + /** + * 请求ID。 + */ + private String requestId; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsCo.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsCo.java new file mode 100644 index 0000000000000000000000000000000000000000..c01e27b7ef59671892c263d419d718583af28e66 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsCo.java @@ -0,0 +1,27 @@ +package com.central.sms.model.wyysms; + +import lombok.Data; + +/** + * 网易云,发送短信,请求参数 + * @author 杨彬鑫 + */ +@Data +public class SendSmsCo { + /** + * 随机数 + */ + private String nonce; + /** + * 模板id + */ + private String templateId; + /** + * 手机号 + */ + private String mobile; + /** + * 验证码长度 + */ + private String codeLen; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsDto.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsDto.java new file mode 100644 index 0000000000000000000000000000000000000000..7fae80dee022f34795cb93f32380a79b6a0b0042 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/SendSmsDto.java @@ -0,0 +1,14 @@ +package com.central.sms.model.wyysms; + +import lombok.Data; + +/** + * 网易,发送短信,返回结果 + * @author 杨彬鑫 + */ +@Data +public class SendSmsDto { + private Integer code; + private String msg; + private String obj; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/VerifyCodeCo.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/VerifyCodeCo.java new file mode 100644 index 0000000000000000000000000000000000000000..6fe3d40e98a28d8ede1aed9ccf6724f72e20fa5d --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/model/wyysms/VerifyCodeCo.java @@ -0,0 +1,14 @@ +package com.central.sms.model.wyysms; + +import lombok.Data; + +/** + * 校验验证码,请求参数 + * @author 杨彬鑫 + */ +@Data +public class VerifyCodeCo { + private String mobile; + private String code; + private String nonce; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/AliSmsProperties.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/AliSmsProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..e76bbf824f0f0d1b251f19ddffd6f0eeae498c88 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/AliSmsProperties.java @@ -0,0 +1,20 @@ +package com.central.sms.properties; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author 杨彬鑫 + */ +@Getter +@Setter +public class AliSmsProperties { + private String accessKeyId; + + private String accessKeySecret; + + /** + * 访问的域名 + */ + private String endpoint; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/SmsServerProperties.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/SmsServerProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..17e3a3262228d46cf2d9bfedde46891aab871b29 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/SmsServerProperties.java @@ -0,0 +1,36 @@ +package com.central.sms.properties; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * @author 杨彬鑫 + * @date 2021/12/15 + *

+ */ +@Setter +@Getter +@ConfigurationProperties(prefix = SmsServerProperties.PREFIX) +public class SmsServerProperties { + public static final String PREFIX = "zlt.sms-server"; + public static final String TYPE_ALI_SMS = "alisms"; + public static final String TYPE_WYY_SMS = "wyysms"; + + /** + * 为以下2个值,指定不同的自动化配置 + * alisms:阿里云短信 + * wyysms:网易云短信 + */ + private String type; + + /** + * 阿里云短信配置 + */ + AliSmsProperties alisms = new AliSmsProperties(); + + /** + * 网易云短信配置 + */ + WyySmsProperties wyysms = new WyySmsProperties(); +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/WyySmsProperties.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/WyySmsProperties.java new file mode 100644 index 0000000000000000000000000000000000000000..7bf6c51ce888982e34c5f0f799ef29d1d11a9282 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/properties/WyySmsProperties.java @@ -0,0 +1,13 @@ +package com.central.sms.properties; + +import lombok.Data; + +/** + * 网易云短信 + * @author 杨彬鑫 + */ +@Data +public class WyySmsProperties { + private String appKey; + private String appSecret; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/AliSmsTemplate.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/AliSmsTemplate.java new file mode 100644 index 0000000000000000000000000000000000000000..8e6eb73c01daeb1380c38da68da12143d235f803 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/AliSmsTemplate.java @@ -0,0 +1,95 @@ +package com.central.sms.template; + +import cn.hutool.core.bean.BeanUtil; +import com.aliyun.dysmsapi20170525.Client; +import com.aliyun.dysmsapi20170525.models.*; +import com.aliyun.teaopenapi.models.Config; +import com.central.common.model.Result; +import com.central.sms.model.alisms.*; +import com.central.sms.properties.SmsServerProperties; +import lombok.SneakyThrows; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; + +/** + * @author 杨彬鑫 + */ +@ConditionalOnClass(Client.class) +@ConditionalOnProperty(prefix = SmsServerProperties.PREFIX, name = "type", havingValue = "alisms") +public class AliSmsTemplate implements InitializingBean { + private final String SUCCESS = "OK"; + + @Autowired + private SmsServerProperties smsServerProperties; + + private Client client; + + @Override + public void afterPropertiesSet() throws Exception { + Config config = new Config() + .setAccessKeyId(smsServerProperties.getAlisms().getAccessKeyId()) + .setAccessKeySecret(smsServerProperties.getAlisms().getAccessKeySecret()) + .setEndpoint(smsServerProperties.getAlisms().getEndpoint()); + client = new Client(config); + } + + /** + * 发送短信 + * + * @param sendSmsCo + * @return + */ + @SneakyThrows + public Result sendSms(SendSmsCo sendSmsCo) {// 请求参数 + SendSmsRequest sendSmsRequest = SendSmsRequest.build(BeanUtil.beanToMap(sendSmsCo)); + + // 发送请求 + SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest); + // 获取响应 + SendSmsResponseBody body = sendSmsResponse.getBody(); + SendSmsDto sendSmsDto = BeanUtil.toBean(body, SendSmsDto.class); + + return sendSmsDto.getCode().equals(SUCCESS) ? Result.succeed(sendSmsDto) : Result.failed(sendSmsDto, "发送失败"); + } + + /** + * 批量发送短信 + * + * @param sendBatchSmsCo + * @return + */ + @SneakyThrows + public Result sendBatchSms(SendBatchSmsCo sendBatchSmsCo) { + // 请求参数 + SendBatchSmsRequest sendBatchSmsRequest = SendBatchSmsRequest.build(BeanUtil.beanToMap(sendBatchSmsCo)); + + // 发送请求 + SendBatchSmsResponse sendBatchSmsResponse = client.sendBatchSms(sendBatchSmsRequest); + // 获取响应 + SendBatchSmsResponseBody body = sendBatchSmsResponse.getBody(); + SendSmsDto sendSmsDto = BeanUtil.toBean(body, SendSmsDto.class); + + return sendSmsDto.getCode().equals(SUCCESS) ? Result.succeed(sendSmsDto) : Result.failed(sendSmsDto, "发送失败"); + } + + /** + * 根据短信发送日期查看发送记录和短信内容 + * + * @param querySendInfoCo + * @return + */ + @SneakyThrows + public Result QuerySendInfo(QuerySendInfoCo querySendInfoCo) { + // 请求参数 + QuerySendDetailsRequest querySendDetailsRequest = QuerySendDetailsRequest.build(BeanUtil.beanToMap(querySendInfoCo)); + + // 发送请求 + QuerySendDetailsResponse querySendDetailsResponse = client.querySendDetails(querySendDetailsRequest); + // 获取响应 + QuerySendDetailsResponseBody body = querySendDetailsResponse.getBody(); + QuerySendInfoDto querySendInfoDto = BeanUtil.toBean(body, QuerySendInfoDto.class); + return querySendInfoDto.getCode().equals(SUCCESS) ? Result.succeed(querySendInfoDto) : Result.failed(querySendInfoDto, "发送失败"); + } +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/WyySmsTemplate.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/WyySmsTemplate.java new file mode 100644 index 0000000000000000000000000000000000000000..6dd698ca178174856ecef8302715d503dd3de3b1 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/template/WyySmsTemplate.java @@ -0,0 +1,130 @@ +package com.central.sms.template; + +import com.central.common.model.Result; +import com.central.common.utils.JsonUtil; +import com.central.sms.model.wyysms.SendSmsDto; +import com.central.sms.model.wyysms.SendSmsCo; +import com.central.sms.model.wyysms.VerifyCodeCo; +import com.central.sms.properties.SmsServerProperties; +import com.central.sms.properties.WyySmsProperties; +import com.central.sms.utils.CheckSumBuilder; +import lombok.SneakyThrows; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 网易云 + * + * @author 杨彬鑫 + */ +@ConditionalOnClass(DefaultHttpClient.class) +@ConditionalOnProperty(prefix = SmsServerProperties.PREFIX, name = "type", havingValue = "wyysms") +public class WyySmsTemplate { + private final Integer SUCCESS = 200; + + @Autowired + private SmsServerProperties smsServerProperties; + + /** + * 发送短信 + * + * @param sendSmsCo + * @return + */ + @SneakyThrows + public Result sendSms(SendSmsCo sendSmsCo) { + //发送验证码的请求路径URL + String SERVER_URL = "https://api.netease.im/sms/sendcode.action"; + // 请求参数 + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpPost httpPost = new HttpPost(SERVER_URL); + String curTime = String.valueOf((new Date()).getTime() / 1000L); + /* + * 参考计算CheckSum的java代码,在上述文档的参数列表中,有CheckSum的计算文档示例 + */ + String checkSum = CheckSumBuilder.getCheckSum(smsServerProperties.getWyysms().getAppSecret(), + sendSmsCo.getNonce(), curTime); + + // 设置请求的header + httpPost.addHeader("AppKey", smsServerProperties.getWyysms().getAppKey()); + httpPost.addHeader("Nonce", sendSmsCo.getNonce()); + httpPost.addHeader("CurTime", curTime); + httpPost.addHeader("CheckSum", checkSum); + httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); + + // 设置请求的的参数,requestBody参数 + List nvps = new ArrayList(); + /* + * 1.如果是模板短信,请注意参数mobile是有s的,详细参数配置请参考“发送模板短信文档” + * 2.参数格式是jsonArray的格式,例如 "['13888888888','13666666666']" + * 3.params是根据你模板里面有几个参数,那里面的参数也是jsonArray格式 + */ + nvps.add(new BasicNameValuePair("templateid", sendSmsCo.getTemplateId())); + nvps.add(new BasicNameValuePair("mobile", sendSmsCo.getMobile())); + nvps.add(new BasicNameValuePair("codeLen", sendSmsCo.getCodeLen())); + + httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8")); + + // 执行请求 + HttpResponse response = httpClient.execute(httpPost); + /*获取返回的信息 是一个json字符串*/ + String responseEntity = EntityUtils.toString(response.getEntity(), "utf-8"); + SendSmsDto sendSmsDto = JsonUtil.toObject(responseEntity, SendSmsDto.class); + + return sendSmsDto.getCode().equals(SUCCESS) ? Result.succeed(sendSmsDto) : Result.failed(sendSmsDto, "发送失败"); + } + + /** + * 校验验证码 + * + * @return + */ + @SneakyThrows + public Result verifyCode(VerifyCodeCo verifyCodeCo) { + //发送验证码的请求路径URL + String SERVER_URL = "https://api.netease.im/sms/verifycode.action"; + // 请求参数 + DefaultHttpClient httpClient = new DefaultHttpClient(); + HttpPost httpPost = new HttpPost(SERVER_URL); + String curTime = String.valueOf((new Date()).getTime() / 1000L); + /* + * 参考计算CheckSum的java代码,在上述文档的参数列表中,有CheckSum的计算文档示例 + */ + String checkSum = CheckSumBuilder.getCheckSum(smsServerProperties.getWyysms().getAppSecret(), + verifyCodeCo.getNonce(), curTime); + + // 设置请求的header + httpPost.addHeader("AppKey", smsServerProperties.getWyysms().getAppKey()); + httpPost.addHeader("Nonce", verifyCodeCo.getNonce()); + httpPost.addHeader("CurTime", curTime); + httpPost.addHeader("CheckSum", checkSum); + httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8"); + + // 设置请求的的参数,requestBody参数 + List nvps = new ArrayList<>(); + nvps.add(new BasicNameValuePair("mobile", verifyCodeCo.getMobile())); + nvps.add(new BasicNameValuePair("code", verifyCodeCo.getCode())); + + httpPost.setEntity(new UrlEncodedFormEntity(nvps, "utf-8")); + + // 执行请求 + HttpResponse response = httpClient.execute(httpPost); + /*获取返回的信息 是一个json字符串*/ + String responseEntity = EntityUtils.toString(response.getEntity(), "utf-8"); + SendSmsDto sendSmsDto = JsonUtil.toObject(responseEntity, SendSmsDto.class); + + return sendSmsDto.getCode().equals(SUCCESS) ? Result.succeed(sendSmsDto) : Result.failed(sendSmsDto, "校验失败"); + } +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/utils/CheckSumBuilder.java b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/utils/CheckSumBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..aaab749d4001e8a5aaf67e28b001728f1f349364 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/java/com/central/sms/utils/CheckSumBuilder.java @@ -0,0 +1,58 @@ +package com.central.sms.utils; + +import java.security.MessageDigest; + +/** + * 网易云短信,请求方式加密 + */ +public class CheckSumBuilder { + /** + * 计算并获取CheckSum + * @param appSecret + * @param nonce + * @param curTime + * @return + */ + public static String getCheckSum(String appSecret, String nonce, String curTime) { + return encode("sha1", appSecret + nonce + curTime); + } + + + /** + * 计算并获取md5值 + * @param requestBody + * @return + */ + public static String getMD5(String requestBody) { + return encode("md5", requestBody); + } + + + private static String encode(String algorithm, String value) { + if (value == null) { + return null; + } + try { + MessageDigest messageDigest = MessageDigest.getInstance(algorithm); + messageDigest.update(value.getBytes()); + return getFormattedText(messageDigest.digest()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + + private static String getFormattedText(byte[] bytes) { + int len = bytes.length; + StringBuilder buf = new StringBuilder(len * 2); + for (int j = 0; j < len; j++) { + buf.append(HEX_DIGITS[(bytes[j] >> 4) & 0x0f]); + buf.append(HEX_DIGITS[bytes[j] & 0x0f]); + } + return buf.toString(); + } + + + private static final char[] HEX_DIGITS = + {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; +} diff --git a/zlt-commons/zlt-sms-spring-boot-starter/src/main/resources/META-INF/spring.factories b/zlt-commons/zlt-sms-spring-boot-starter/src/main/resources/META-INF/spring.factories new file mode 100644 index 0000000000000000000000000000000000000000..4912d27da39034ad78af5c4aeb408aff933bea58 --- /dev/null +++ b/zlt-commons/zlt-sms-spring-boot-starter/src/main/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ +com.central.sms.config.SmsAutoConfigure \ No newline at end of file diff --git a/zlt-config/pom.xml b/zlt-config/pom.xml index e5fbb6ca988684e61671e006193bf2833ba1ffc0..13004ba5f53d10e5ccf2305b150d3cbc4f1bc77d 100644 --- a/zlt-config/pom.xml +++ b/zlt-config/pom.xml @@ -17,4 +17,60 @@ spring-cloud-starter-alibaba-nacos-config + + + + + dev + + dev + 127.0.0.1:8848 + nacos + nacos + 127.0.0.1:6999 + + + true + + + + + prod + + prod + 127.0.0.1:8848 + nacos + nacos + 127.0.0.1:6999 + + + false + + + + + + + + src/main/resources + + true + + + application.properties + application-dev.properties + application-prod.properties + + + + src/main/resources + true + + + application.properties + application-${profileActive}.properties + + + + diff --git a/zlt-config/src/main/resources/application-dev.properties b/zlt-config/src/main/resources/application-dev.properties index 091ab6e3dee748b7254db8561b36565974ec963f..6a30e364f610006dcdf6efe6f87477b9c0895a60 100644 --- a/zlt-config/src/main/resources/application-dev.properties +++ b/zlt-config/src/main/resources/application-dev.properties @@ -1,21 +1,21 @@ ########################## 统一变量配置 ########################## ##### 数据库配置 -zlt.datasource.ip=192.168.28.130 +zlt.datasource.ip=39.103.222.107 zlt.datasource.username=root -zlt.datasource.password=1q2w3e4r +zlt.datasource.password=lilishop ##### redis配置 -spring.redis.host=192.168.28.130 +spring.redis.host=127.0.0.1 spring.redis.port=6379 spring.redis.timeout=5000 ##### elasticsearch配置 -zlt.elasticsearch.uris=192.168.28.130:9200 -zlt.elasticsearch.username=elastic -zlt.elasticsearch.password=qEnNfKNujqNrOPD9q5kb +zlt.elasticsearch.uris=39.103.222.107 +zlt.elasticsearch.username=elasticsearch +zlt.elasticsearch.password=elasticsearch ##### sentinel配置 -zlt.sentinel.dashboard=192.168.28.130:6999 +zlt.sentinel.dashboard=localhost:6999 ##### fastDFS配置 zlt.fdfs.web-url=192.168.28.130 @@ -27,6 +27,18 @@ zlt.s3.accessKeySecret=minioadmin zlt.s3.endpoint=http://192.168.28.130:9000 zlt.s3.bucketName=test +##### 阿里OSS配置 +zlt.alioss.accessKey=LTAI5tH7YyqGEBMebYtHuvJE +zlt.alioss.accessKeySecret=WWcVwDpDcyrUVzcWhO7NCJupX1fC84 +zlt.alioss.endpoint=https://oss-cn-shenzhen.aliyuncs.com +zlt.alioss.bucketName=ioath +zlt.alioss.bucketHost=https://ioath.oss-cn-shenzhen.aliyuncs.com + +##### 阿里SMS配置 +zlt.alisms.accessKeyId=LTAI5tH7YyqGEBMebYtHuvJE +zlt.alisms.accessKeySecret=WWcVwDpDcyrUVzcWhO7NCJupX1fC84 +zlt.alisms.endpoint=dysmsapi.aliyuncs.com + ##### 日志链路追踪 zlt.trace.enable=true diff --git a/zlt-config/src/main/resources/application-prod.properties b/zlt-config/src/main/resources/application-prod.properties index 5fe2ca3d0a2b9f3a8ba32d8369e0de2042e3290e..b48cf1c5dbe4c0837e9b07b5797f7bc17b019b2c 100644 --- a/zlt-config/src/main/resources/application-prod.properties +++ b/zlt-config/src/main/resources/application-prod.properties @@ -27,5 +27,12 @@ zlt.s3.accessKeySecret=minioadmin zlt.s3.endpoint=http://192.168.28.130:9000 zlt.s3.bucketName=test +##### 阿里OSS配置 +zlt.alioss.accessKey=LTAI5tH7YyqGEBMebYtHuvJE +zlt.alioss.accessKeySecret=WWcVwDpDcyrUVzcWhO7NCJupX1fC84 +zlt.alioss.endpoint=https://oss-cn-shenzhen.aliyuncs.com +zlt.alioss.bucketName=ioath +zlt.alioss.bucketHost=https://ioath.oss-cn-shenzhen.aliyuncs.com + ##### 日志链路追踪 zlt.trace.enable=true \ No newline at end of file diff --git a/zlt-config/src/main/resources/application-test.properties b/zlt-config/src/main/resources/application-test.properties index ddf043952b87ba60a89b8ea07ebcbf45862f5276..8ae2dd92b7989ef984c5489dd4df7d6443ea5b0c 100644 --- a/zlt-config/src/main/resources/application-test.properties +++ b/zlt-config/src/main/resources/application-test.properties @@ -27,5 +27,12 @@ zlt.s3.accessKeySecret=minioadmin zlt.s3.endpoint=http://192.168.28.130:9000 zlt.s3.bucketName=test +##### 阿里OSS配置 +zlt.alioss.accessKey=LTAI5tH7YyqGEBMebYtHuvJE +zlt.alioss.accessKeySecret=WWcVwDpDcyrUVzcWhO7NCJupX1fC84 +zlt.alioss.endpoint=https://oss-cn-shenzhen.aliyuncs.com +zlt.alioss.bucketName=ioath +zlt.alioss.bucketHost=https://ioath.oss-cn-shenzhen.aliyuncs.com + ##### 日志链路追踪 zlt.trace.enable=true \ No newline at end of file diff --git a/zlt-config/src/main/resources/bootstrap.properties b/zlt-config/src/main/resources/bootstrap.properties index 5fe083086b9ec5188c53e2c196daf8aaf6a9a410..be8dc76602b7471a9d536bb781ad0a95e64b1c0d 100644 --- a/zlt-config/src/main/resources/bootstrap.properties +++ b/zlt-config/src/main/resources/bootstrap.properties @@ -1,14 +1,16 @@ ########################## bootstrap级别通用配置 ########################## # 默认开发环境 -spring.profiles.active=dev +spring.profiles.active=@profileActive@ -##### nacos(注册中心和配置中心)地址 -spring.cloud.nacos.server-addr=192.168.28.130:8848 -#spring.cloud.nacos.username=nacos -#spring.cloud.nacos.password=nacos +#nacos(注册中心和配置中心)地址 +spring.cloud.nacos.server-addr=@nacosIp@ +spring.cloud.nacos.username=@nacosUserName@ +spring.cloud.nacos.password=@nacosPassWord@ + +#naocs配置文件配置 spring.cloud.nacos.config.file-extension=yml -spring.cloud.nacos.config.shared-dataids=common.yml -spring.cloud.nacos.config.refreshable-dataids=common.yml +spring.cloud.nacos.config.shared-dataids=application.properties +spring.cloud.nacos.config.refreshable-dataids=application.properties ##### spring-boot-actuator配置 management.endpoints.web.exposure.include=* diff --git a/zlt-job/job-admin/src/main/resources/application-dev.properties b/zlt-job/job-admin/src/main/resources/application-dev.properties index bc97e7df1e67875056660b5c74a383233f6abf0f..3af4c5a3ea36e04b12a6933e8a3600a31443e7cb 100644 --- a/zlt-job/job-admin/src/main/resources/application-dev.properties +++ b/zlt-job/job-admin/src/main/resources/application-dev.properties @@ -1,7 +1,7 @@ ### xxl-job, datasource -zlt.datasource.ip=192.168.28.131 +zlt.datasource.ip=39.103.222.107 zlt.datasource.username=root -zlt.datasource.password=1q2w3e4r +zlt.datasource.password=lilishop spring.datasource.url=jdbc:mysql://${zlt.datasource.ip}:3306/xxl-job?Unicode=true&characterEncoding=UTF-8 spring.datasource.username=${zlt.datasource.username} diff --git a/zlt-job/job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/zlt-job/job-admin/src/main/resources/mybatis-mapper/IQuerySendInfoCo.xml similarity index 100% rename from zlt-job/job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml rename to zlt-job/job-admin/src/main/resources/mybatis-mapper/IQuerySendInfoCo.xml diff --git a/zlt-register/nacos/bin/startup.cmd b/zlt-register/nacos/bin/startup.cmd index c9910877229d6637b61f44e6e162e21a313e75e5..99334533bd517a559027b0d2b4de3dbd9f099a5c 100644 --- a/zlt-register/nacos/bin/startup.cmd +++ b/zlt-register/nacos/bin/startup.cmd @@ -23,7 +23,7 @@ set BASE_DIR="%BASE_DIR:~0,-5%" set CUSTOM_SEARCH_LOCATIONS=file:%BASE_DIR%/conf/ -set MODE="cluster" +set MODE="standalone" set FUNCTION_MODE="all" set SERVER=nacos-server set MODE_INDEX=-1