Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
别团等shy哥发育
Yygh Parent
提交
57e7c771
Y
Yygh Parent
项目概览
别团等shy哥发育
/
Yygh Parent
9 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
Yygh Parent
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
57e7c771
编写于
1月 06, 2022
作者:
别团等shy哥发育
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
短信微服务搭建
上级
a9405fdd
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
139 addition
and
0 deletion
+139
-0
service/pom.xml
service/pom.xml
+1
-0
service/service_msm/pom.xml
service/service_msm/pom.xml
+21
-0
service/service_msm/src/main/java/com/atguigu/yygh/msm/ServiceMsmApplication.java
...main/java/com/atguigu/yygh/msm/ServiceMsmApplication.java
+15
-0
service/service_msm/src/main/java/com/atguigu/yygh/msm/controller/MsmApiController.java
...ava/com/atguigu/yygh/msm/controller/MsmApiController.java
+27
-0
service/service_msm/src/main/java/com/atguigu/yygh/msm/service/MsmService.java
...rc/main/java/com/atguigu/yygh/msm/service/MsmService.java
+4
-0
service/service_msm/src/main/java/com/atguigu/yygh/msm/service/impl/MsmServiceImpl.java
...ava/com/atguigu/yygh/msm/service/impl/MsmServiceImpl.java
+8
-0
service/service_msm/src/main/java/com/atguigu/yygh/msm/utils/ConstantPropertiesUtils.java
...a/com/atguigu/yygh/msm/utils/ConstantPropertiesUtils.java
+31
-0
service/service_msm/src/main/resources/application.properties
...ice/service_msm/src/main/resources/application.properties
+25
-0
service_gateway/src/main/resources/application.properties
service_gateway/src/main/resources/application.properties
+7
-0
未找到文件。
service/pom.xml
浏览文件 @
57e7c771
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
<module>
service_user
</module>
<module>
service_user
</module>
<module>
service_hosp
</module>
<module>
service_hosp
</module>
<module>
service_cmn
</module>
<module>
service_cmn
</module>
<module>
service_msm
</module>
</modules>
</modules>
<dependencies>
<dependencies>
<dependency>
<dependency>
...
...
service/service_msm/pom.xml
0 → 100644
浏览文件 @
57e7c771
<?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"
>
<parent>
<artifactId>
service
</artifactId>
<groupId>
com.atguigu
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
service_msm
</artifactId>
<dependencies>
<dependency>
<groupId>
com.aliyun
</groupId>
<artifactId>
aliyun-java-sdk-core
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
service/service_msm/src/main/java/com/atguigu/yygh/msm/ServiceMsmApplication.java
0 → 100644
浏览文件 @
57e7c771
package
com.atguigu.yygh.msm
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
@SpringBootApplication
(
exclude
=
DataSourceAutoConfiguration
.
class
)
//取消数据源自动配置
@EnableDiscoveryClient
public
class
ServiceMsmApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ServiceMsmApplication
.
class
,
args
);
}
}
service/service_msm/src/main/java/com/atguigu/yygh/msm/controller/MsmApiController.java
0 → 100644
浏览文件 @
57e7c771
package
com.atguigu.yygh.msm.controller
;
import
com.atguigu.yygh.msm.service.MsmService
;
import
com.atguigu.yygu.common.result.Result
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Api
(
tags
=
"短信发送控制器"
)
@RestController
@RequestMapping
(
"/api/msm"
)
public
class
MsmApiController
{
@Autowired
private
MsmService
msmService
;
//发送手机验证码
@ApiOperation
(
value
=
"发送手机验证码"
)
@GetMapping
(
"send/{phone}"
)
public
Result
sendCode
(){
}
}
service/service_msm/src/main/java/com/atguigu/yygh/msm/service/MsmService.java
0 → 100644
浏览文件 @
57e7c771
package
com.atguigu.yygh.msm.service
;
public
interface
MsmService
{
}
service/service_msm/src/main/java/com/atguigu/yygh/msm/service/impl/MsmServiceImpl.java
0 → 100644
浏览文件 @
57e7c771
package
com.atguigu.yygh.msm.service.impl
;
import
com.atguigu.yygh.msm.service.MsmService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
MsmServiceImpl
implements
MsmService
{
}
service/service_msm/src/main/java/com/atguigu/yygh/msm/utils/ConstantPropertiesUtils.java
0 → 100644
浏览文件 @
57e7c771
package
com.atguigu.yygh.msm.utils
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
ConstantPropertiesUtils
implements
InitializingBean
{
//从配置文件中读取三个值
@Value
(
"${aliyun.sms.regionId}"
)
private
String
regionId
;
@Value
(
"${aliyun.sms.accessKeyId}"
)
private
String
accessKeyId
;
@Value
(
"${aliyun.sms.secret}"
)
private
String
secret
;
public
static
String
REGION_Id
;
public
static
String
ACCESS_KEY_ID
;
public
static
String
SECRECT
;
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
REGION_Id
=
regionId
;
ACCESS_KEY_ID
=
accessKeyId
;
SECRECT
=
secret
;
}
}
service/service_msm/src/main/resources/application.properties
0 → 100644
浏览文件 @
57e7c771
# 服务端口
server.port
=
8204
# 服务名
spring.application.name
=
service-msm
#返回json的全局时间格式
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone
=
GMT+8
spring.redis.host
=
192.168.44.165
spring.redis.port
=
6379
spring.redis.database
=
0
spring.redis.timeout
=
1800000
spring.redis.lettuce.pool.max-active
=
20
spring.redis.lettuce.pool.max-wait
=
-1
#最大阻塞等待时间(负数表示没限制)
spring.redis.lettuce.pool.max-idle
=
5
spring.redis.lettuce.pool.min-idle
=
0
# nacos服务地址
spring.cloud.nacos.discovery.server-addr
=
127.0.0.1:8848
aliyun.sms.regionId
=
default
aliyun.sms.accessKeyId
=
LT6I0Y5633pX89qC
aliyun.sms.secret
=
jX8D04Dm12I3gGKj345FYSzu0fq8mT
service_gateway/src/main/resources/application.properties
浏览文件 @
57e7c771
...
@@ -29,3 +29,10 @@ spring.cloud.gateway.routes[2].id=service-user
...
@@ -29,3 +29,10 @@ spring.cloud.gateway.routes[2].id=service-user
spring.cloud.gateway.routes[2]
.uri
=
lb://service-user
spring.cloud.gateway.routes[2]
.uri
=
lb://service-user
#设置路由断言,代理servicerId为auth-service的/auth/路径
#设置路由断言,代理servicerId为auth-service的/auth/路径
spring.cloud.gateway.routes[2]
.predicates
=
Path=/*/user/**
spring.cloud.gateway.routes[2]
.predicates
=
Path=/*/user/**
#设置路由id
spring.cloud.gateway.routes[3]
.id
=
service-msm
#设置路由的uri
spring.cloud.gateway.routes[3]
.uri
=
lb://service-msm
#设置路由断言,代理servicerId为auth-service的/auth/路径
spring.cloud.gateway.routes[3]
.predicates
=
Path=/*/msm/**
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录