优化短信模块的代码

pull/2/head
YunaiV 2022-04-11 01:21:33 +08:00
parent e33b2f0dd3
commit 076c7a4e3e
18 changed files with 41 additions and 40 deletions

View File

@ -3716,7 +3716,7 @@ INSERT INTO `system_menu` VALUES (1128, '支付应用信息创建', 'pay:app:cre
INSERT INTO `system_menu` VALUES (1129, '', 'pay:app:update', 3, 3, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0');
INSERT INTO `system_menu` VALUES (1130, '', 'pay:app:delete', 3, 4, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0');
INSERT INTO `system_menu` VALUES (1131, '', 'pay:app:export', 3, 5, 1126, '', '', '', 0, '', '2021-11-10 01:13:31', '', '2021-11-10 01:13:31', b'0');
INSERT INTO `system_menu` VALUES (1132, '', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '2021-11-08 15:15:47', '1', '2021-11-08 15:15:47', b'0');
INSERT INTO `system_menu` VALUES (1132, '', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '2021-11-08 15:15:47', '1', '2021-11-08 15:15:47', b'0');
INSERT INTO `system_menu` VALUES (1133, '', 'pay:merchant:query', 3, 1, 1132, '', '', '', 0, '', '2021-11-10 01:13:41', '', '2021-11-10 01:13:41', b'0');
INSERT INTO `system_menu` VALUES (1134, '', 'pay:merchant:create', 3, 2, 1132, '', '', '', 0, '', '2021-11-10 01:13:41', '', '2021-11-10 01:13:41', b'0');
INSERT INTO `system_menu` VALUES (1135, '', 'pay:merchant:update', 3, 3, 1132, '', '', '', 0, '', '2021-11-10 01:13:41', '', '2021-11-10 01:13:41', b'0');
@ -3734,7 +3734,7 @@ INSERT INTO `system_menu` VALUES (1146, '支付应用信息创建', 'pay:app:cre
INSERT INTO `system_menu` VALUES (1147, '', 'pay:app:update', 3, 3, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:48', b'1');
INSERT INTO `system_menu` VALUES (1148, '', 'pay:app:delete', 3, 4, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:46', b'1');
INSERT INTO `system_menu` VALUES (1149, '', 'pay:app:export', 3, 5, 1144, '', '', '', 0, '', '2021-12-25 08:26:31', '', '2021-12-25 08:47:43', b'1');
INSERT INTO `system_menu` VALUES (1150, '', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '2021-11-08 15:15:47', '1', '2021-11-08 15:15:47', b'0');
INSERT INTO `system_menu` VALUES (1150, '', 'pay:channel:parsing', 3, 6, 1129, '', '', '', 0, '1', '2021-11-08 15:15:47', '1', '2021-11-08 15:15:47', b'0');
INSERT INTO `system_menu` VALUES (1156, '', 'pay:order:query', 3, 1, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2022-03-23 16:45:18', b'1');
INSERT INTO `system_menu` VALUES (1157, '', 'pay:order:create', 3, 2, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2022-03-23 16:45:39', b'1');
INSERT INTO `system_menu` VALUES (1158, '', 'pay:order:update', 3, 3, 1155, '', '', '', 0, '', '2021-12-25 08:29:01', '', '2022-03-23 16:45:50', b'1');
@ -6039,7 +6039,7 @@ CREATE TABLE `system_sms_channel` (
`status` tinyint NOT NULL COMMENT '',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`api_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' API ',
`api_secret` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' API ',
`api_secret` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' API ',
`callback_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' URL',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',

View File

@ -82,9 +82,9 @@ public class WXPayClientConfig implements PayClientConfig {
@NotBlank(message = "apiclient_cert 不能为空", groups = V3.class)
private String privateCertContent;
/**
* apiV3
* apiV3
*/
@NotBlank(message = "apiV3 钥值 不能为空", groups = V3.class)
@NotBlank(message = "apiV3 钥值 不能为空", groups = V3.class)
private String apiV3Key;
/**

View File

@ -11,7 +11,7 @@ import java.util.List;
* SDK
*
* @author zzf
* @date 2021/1/25 14:14
* @since 2021/1/25 14:14
*/
public interface SmsClient {

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties;
*
*
* @author zzf
* @date 2021/1/28 14:01
* @since 2021/1/28 14:01
*/
public interface SmsClientFactory {

View File

@ -16,7 +16,7 @@ import java.util.List;
*
*
* @author zzf
* @date 2021/2/1 9:28
* @since 2021/2/1 9:28
*/
@Slf4j
public abstract class AbstractSmsClient implements SmsClient {

View File

@ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE
*
*
* @author zzf
* @date 2021/1/25 14:17
* @since 2021/1/25 14:17
*/
@Slf4j
public class AliyunSmsClient extends AbstractSmsClient {

View File

@ -1,7 +1,8 @@
package cn.iocoder.yudao.framework.sms.core.property;
package cn.iocoder.yudao.framework.sms.core.client.impl.tencent;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties;
import lombok.Data;
/**

View File

@ -1,6 +1,5 @@
package cn.iocoder.yudao.framework.sms.core.client.impl.tencent;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.core.KeyValue;
@ -14,7 +13,6 @@ import cn.iocoder.yudao.framework.sms.core.client.dto.SmsTemplateRespDTO;
import cn.iocoder.yudao.framework.sms.core.client.impl.AbstractSmsClient;
import cn.iocoder.yudao.framework.sms.core.enums.SmsTemplateAuditStatusEnum;
import cn.iocoder.yudao.framework.sms.core.property.SmsChannelProperties;
import cn.iocoder.yudao.framework.sms.core.property.TencentSmsChannelProperties;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.annotations.VisibleForTesting;

View File

@ -35,7 +35,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DE
*
*
* @author zzf
* @date 9:48 2021/3/5
* @since 9:48 2021/3/5
*/
@Slf4j
public class YunpianSmsClient extends AbstractSmsClient {

View File

@ -8,7 +8,7 @@ import lombok.Getter;
*
*
* @author zzf
* @date 2021/1/25 10:56
* @since 2021/1/25 10:56
*/
@Getter
@AllArgsConstructor

View File

@ -11,7 +11,7 @@ import javax.validation.constraints.NotNull;
*
*
* @author zzf
* @date 2021/1/25 17:01
* @since 2021/1/25 17:01
*/
@Data
@Validated
@ -40,9 +40,9 @@ public class SmsChannelProperties {
@NotEmpty(message = "短信 API 的账号不能为空")
private String apiKey;
/**
* API
* API
*/
@NotEmpty(message = "短信 API 的钥不能为空")
@NotEmpty(message = "短信 API 的钥不能为空")
private String apiSecret;
/**
* URL

View File

@ -37,10 +37,10 @@ public class SecurityProperties {
@NotNull(message = "mock 模式的开关不能为空")
private Boolean mockEnable;
/**
* mock
*
* mock
*
*/
@NotEmpty(message = "mock 模式的钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。
@NotEmpty(message = "mock 模式的钥不能为空") // 这里设置了一个默认值,因为实际上只有 mockEnable 为 true 时才需要配置。
private String mockSecret = "yudaoyuanma";
}

View File

@ -18,7 +18,6 @@ public class SmsSendSingleToUserReqDTO {
/**
*
*/
@NotNull(message = "用户编号不能为空")
private Long userId;
/**
*

View File

@ -28,7 +28,7 @@ public class SmsChannelBaseVO {
@NotNull(message = "短信 API 的账号不能为空")
private String apiKey;
@ApiModelProperty(value = "短信 API 的钥", example = "yuanma")
@ApiModelProperty(value = "短信 API 的钥", example = "yuanma")
private String apiSecret;
@ApiModelProperty(value = "短信发送回调 URL", example = "http://www.iocoder.cn")

View File

@ -49,7 +49,7 @@ public class SmsChannelDO extends BaseDO {
*/
private String apiKey;
/**
* API
* API
*/
private String apiSecret;
/**

File diff suppressed because one or more lines are too long

View File

@ -29,14 +29,14 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label-width="180px" label="商户钥" prop="weChatConfig.mchKey"
<el-form-item label-width="180px" label="商户钥" prop="weChatConfig.mchKey"
v-if="form.weChatConfig.apiVersion === 'v2'">
<el-input v-model="form.weChatConfig.mchKey" placeholder="请输入商户钥" clearable
<el-input v-model="form.weChatConfig.mchKey" placeholder="请输入商户钥" clearable
:style="{width: '100%'}" type="textarea" :autosize="{minRows: 8, maxRows: 8}"></el-input>
</el-form-item>
<div v-if="form.weChatConfig.apiVersion === 'v3'">
<el-form-item label-width="180px" label="API V3钥" prop="weChatConfig.apiV3Key">
<el-input v-model="form.weChatConfig.apiV3Key" placeholder="请输入API V3钥" clearable
<el-form-item label-width="180px" label="API V3钥" prop="weChatConfig.apiV3Key">
<el-input v-model="form.weChatConfig.apiV3Key" placeholder="请输入API V3钥" clearable
:style="{width: '100%'}" type="textarea" :autosize="{minRows: 8, maxRows: 8}"></el-input>
</el-form-item>
<el-form-item label-width="180px" label="apiclient_key.perm证书" prop="weChatConfig.privateKeyContent">
@ -164,7 +164,7 @@ export default {
}],
'weChatConfig.mchKey': [{
required: true,
message: '请输入商户钥',
message: '请输入商户钥',
trigger: 'blur'
}],
'weChatConfig.privateKeyContent': [{
@ -179,7 +179,7 @@ export default {
}],
'weChatConfig.apiV3Key': [{
required: true,
message: '请上传apiV3钥值',
message: '请上传apiV3钥值',
trigger: 'blur'
}],
},

View File

@ -39,7 +39,7 @@
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE" :value="scope.row.code"/>
</template>
</el-table-column>>
</el-table-column>
<el-table-column label="启用状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>
@ -47,7 +47,7 @@
</el-table-column>>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="短信 API 的账号" align="center" prop="apiKey" />
<el-table-column label="短信 API 的钥" align="center" prop="apiSecret" />
<el-table-column label="短信 API 的钥" align="center" prop="apiSecret" />
<el-table-column label="短信发送回调 URL" align="center" prop="callbackUrl" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@ -68,13 +68,16 @@
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="130px">
<el-form-item label="短信签名" prop="signature">
<el-input v-model="form.signature" placeholder="请输入短信签名" />
</el-form-item>
<el-form-item label="渠道编码" prop="code">
<el-input v-model="form.code" placeholder="请输入渠道编码" />
<el-select v-model="form.code" placeholder="请选择渠道编码" clearable>
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_SMS_CHANNEL_CODE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="启用状态">
<el-radio-group v-model="form.status">
@ -88,8 +91,8 @@
<el-form-item label="短信 API 的账号" prop="apiKey">
<el-input v-model="form.apiKey" placeholder="请输入短信 API 的账号" />
</el-form-item>
<el-form-item label="短信 API 的钥" prop="apiSecret">
<el-input v-model="form.apiSecret" placeholder="请输入短信 API 的钥" />
<el-form-item label="短信 API 的钥" prop="apiSecret">
<el-input v-model="form.apiSecret" placeholder="请输入短信 API 的钥" />
</el-form-item>
<el-form-item label="短信发送回调 URL" prop="callbackUrl">
<el-input v-model="form.callbackUrl" placeholder="请输入短信发送回调 URL" />