This commit is contained in:
shuhongfan
2023-09-04 16:40:17 +08:00
commit cf5ac25c14
8267 changed files with 1305066 additions and 0 deletions

3
sl-express-ms-sms-domain/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
.idea
target/
*.iml

View File

@@ -0,0 +1,13 @@
FROM openjdk:11-jdk
LABEL maintainer="研究院研发组 <research@itcast.cn>"
# 时区修改为东八区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /app
ARG JAR_FILE=target/*.jar
ADD ${JAR_FILE} app.jar
EXPOSE 8080
ENTRYPOINT ["sh","-c","java -Djava.security.egd=file:/dev/./urandom -jar $JAVA_OPTS app.jar"]

View File

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sl-express</groupId>
<artifactId>sl-express-parent</artifactId>
<version>1.4</version>
</parent>
<groupId>com.sl-express.ms.sms</groupId>
<artifactId>sl-express-ms-sms-domain</artifactId>
<version>1.1-SNAPSHOT</version>
<description>短信微服务-实体</description>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<sl-express-common.version>1.2-SNAPSHOT</sl-express-common.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<dependencies>
<dependency>
<groupId>com.sl-express.common</groupId>
<artifactId>sl-express-common</artifactId>
<version>${sl-express-common.version}</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,39 @@
package com.sl.ms.sms.dto;
import com.sl.ms.sms.enums.SendStatusEnum;
import io.swagger.annotations.ApiModel;
import lombok.Data;
/**
* 发送结果
*/
@Data
@ApiModel("发送结果")
public class SendResultDTO {
/**
* 发送记录id
*/
private Long id;
/**
* 手机号
*/
private String mobile;
/**
* 发起发送请求的微服务名称sl-express-ms-work
*/
private String appName;
/**
* 发送批次id用于判断这些数据是同一批次发送的
*/
private Long batchId;
/**
* 发送状态1成功2失败
*/
private SendStatusEnum status;
}

View File

@@ -0,0 +1,45 @@
package com.sl.ms.sms.dto;
import com.sl.ms.sms.enums.SmsContentTypeEnum;
import com.sl.ms.sms.enums.SmsTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@Builder
@ApiModel("短信信息")
@NoArgsConstructor
@AllArgsConstructor
public class SmsInfoDTO {
@ApiModelProperty(value = "短信类型1验证类型短信2通知类型短信")
@NotNull(message = "短信类型不能为空")
private SmsTypeEnum smsType;
@ApiModelProperty("内容类型1文字短信2语音短信")
@NotNull(message = "内容类型不能为空")
private SmsContentTypeEnum contentType;
@ApiModelProperty(value = "手机号")
@NotNull(message = "手机号不能为空")
private List<String> mobiles;
@ApiModelProperty("短信code短信微服务发放的code")
private String smsCode;
@ApiModelProperty(value = "微服务名称", notes = "发起发送请求的微服务名称sl-express-ms-work")
@NotNull(message = "微服务名称不能为空")
private String appName;
@ApiModelProperty(value = "短信内容", notes = "短信内容一般为json格式的参数数据用于填充短信模板中的占位符参数")
@NotNull(message = "短信内容不能为空")
private String smsContent;
}

View File

@@ -0,0 +1,39 @@
package com.sl.ms.sms.enums;
import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.sl.transport.common.enums.BaseEnum;
/**
* 发送状态枚举
*/
public enum SendStatusEnum implements BaseEnum {
SUCCESS(1, "成功"),
FAIL(2, "失败");
@EnumValue
@JsonValue
private Integer code;
private String value;
SendStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
@Override
public Integer getCode() {
return this.code;
}
@Override
public String getValue() {
return this.value;
}
public static SendStatusEnum codeOf(Integer code) {
return EnumUtil.getBy(SendStatusEnum::getCode, code);
}
}

View File

@@ -0,0 +1,39 @@
package com.sl.ms.sms.enums;
import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.sl.transport.common.enums.BaseEnum;
/**
* 短信内容类型枚举
*/
public enum SmsContentTypeEnum implements BaseEnum {
WORD_MESSAGE(1, "文字类型短信"),
VOICE(2, "语音类型短信");
@EnumValue
@JsonValue
private Integer code;
private String value;
SmsContentTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
@Override
public Integer getCode() {
return this.code;
}
@Override
public String getValue() {
return this.value;
}
public static SmsContentTypeEnum codeOf(Integer code) {
return EnumUtil.getBy(SmsContentTypeEnum::getCode, code);
}
}

View File

@@ -0,0 +1,41 @@
package com.sl.ms.sms.enums;
import cn.hutool.core.util.EnumUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import com.sl.transport.common.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 短信类型枚举
*/
public enum SmsTypeEnum implements BaseEnum {
VERIFY(1, "验证类型短信"),
NOTICE(2, "通知类型短信");
@EnumValue
@JsonValue
private Integer code;
private String value;
SmsTypeEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
@Override
public Integer getCode() {
return this.code;
}
@Override
public String getValue() {
return this.value;
}
public static SmsTypeEnum codeOf(Integer code) {
return EnumUtil.getBy(SmsTypeEnum::getCode, code);
}
}