Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-yunqueyilian
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.wechat
pica-cloud-yunqueyilian
提交
0baa2967
提交
0baa2967
编写于
8月 13, 2018
作者:
chenzhehao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加微信生成菜单逻辑
上级
767c66b8
变更
26
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
1349 行增加
和
18 行删除
+1349
-18
WeChatConstants.java
...wechat/yunqueyilian/common/constants/WeChatConstants.java
+70
-0
CloudPropertiesUtil.java
.../wechat/yunqueyilian/common/util/CloudPropertiesUtil.java
+51
-0
MyX509TrustManager.java
...d/wechat/yunqueyilian/common/util/MyX509TrustManager.java
+24
-0
WeChatToolUtil.java
...cloud/wechat/yunqueyilian/common/util/WeChatToolUtil.java
+230
-0
AccessToken.java
...d/wechat/yunqueyilian/common/wechat/pojo/AccessToken.java
+64
-0
BaseEntity.java
...ud/wechat/yunqueyilian/common/wechat/pojo/BaseEntity.java
+61
-0
Button.java
.../cloud/wechat/yunqueyilian/common/wechat/pojo/Button.java
+19
-0
CommonButton.java
.../wechat/yunqueyilian/common/wechat/pojo/CommonButton.java
+38
-0
ComplexButton.java
...wechat/yunqueyilian/common/wechat/pojo/ComplexButton.java
+20
-0
Industry.java
...loud/wechat/yunqueyilian/common/wechat/pojo/Industry.java
+27
-0
JsapiTicket.java
...d/wechat/yunqueyilian/common/wechat/pojo/JsapiTicket.java
+36
-0
Menu.java
...ca/cloud/wechat/yunqueyilian/common/wechat/pojo/Menu.java
+19
-0
SendTemplate.java
.../wechat/yunqueyilian/common/wechat/pojo/SendTemplate.java
+48
-0
Template.java
...loud/wechat/yunqueyilian/common/wechat/pojo/Template.java
+17
-0
TemplateData.java
.../wechat/yunqueyilian/common/wechat/pojo/TemplateData.java
+77
-0
TemplateKeynote.java
...chat/yunqueyilian/common/wechat/pojo/TemplateKeynote.java
+27
-0
User.java
...ca/cloud/wechat/yunqueyilian/common/wechat/pojo/User.java
+163
-0
WSLocation.java
...ud/wechat/yunqueyilian/common/wechat/pojo/WSLocation.java
+60
-0
WSUser.java
.../cloud/wechat/yunqueyilian/common/wechat/pojo/WSUser.java
+178
-0
pom.xml
pom.xml
+0
-5
IUserServiceClient.java
...wechat/yunqueyilian/server/client/IUserServiceClient.java
+1
-1
CoreServiceImpl.java
...hat/yunqueyilian/server/service/impl/CoreServiceImpl.java
+1
-4
MenuManagerServiceImpl.java
...queyilian/server/service/impl/MenuManagerServiceImpl.java
+92
-0
bootstrap-dev.properties
server/src/main/resources/bootstrap-dev.properties
+5
-8
bootstrap-test1.properties
server/src/main/resources/bootstrap-test1.properties
+11
-0
bootstrap-test2.properties
server/src/main/resources/bootstrap-test2.properties
+10
-0
未找到文件。
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/constants/WeChatConstants.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
constants
;
import
com.pica.cloud.wechat.yunqueyilian.common.util.CloudPropertiesUtil
;
public
class
WeChatConstants
{
public
static
String
WECHAT_URL
=
CloudPropertiesUtil
.
getValue
(
"wechat_url"
);
// 第三方用户唯一凭证
public
static
String
APP_ID
=
CloudPropertiesUtil
.
getValue
(
"AppID"
);
// 第三方用户唯一凭证密钥
public
static
String
APP_SECRET
=
CloudPropertiesUtil
.
getValue
(
"AppSecret"
);
// 与接口配置信息中的Token要一致
public
static
String
TOKEN
=
"tokenPicaHealth"
;
public
static
String
EncodingAESKey
=
"5MXFOzFXcoA4t6tUIOP8C0N19NyWZIDiuKXKBRvUBEN"
;
/** access_token过期时间 */
public
static
int
EXPIRES_PERIOD_DATE
=
7200
;
// 获取access_token的接口地址(GET) 限200(次/天)
public
final
static
String
ACCESS_TOKEN_URL
=
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET"
;
// 菜单创建(POST) 限100(次/天)
public
static
String
MENU_CREATE_URL
=
"https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN"
;
// 通过code获取openid、access_token信息
public
static
String
AUTH_ACCESS_TOKEN_URL
=
"https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"
;
// 检验授权凭证(access_token)是否有效
public
static
String
VERIFY_AUTH_ACCESS_TOKEN_URL
=
"https://api.weixin.qq.com/sns/auth?access_token=ACCESS_TOKEN&openid=OPENID"
;
// 获取用户的基本信息
public
static
String
GET_USER_INFO_URL
=
"https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN"
;
/** 网页授权 拉取用户信息(需scope为 snsapi_userinfo) */
public
static
final
String
GET_SNS_USER_INFO_URL
=
"https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN "
;
// 检验授权凭证(access_token)是否有效
public
static
String
VERIFY_SNS_USER_INFO_URL
=
"https://api.weixin.qq.com/sns/auth?access_token=ACCESS_TOKEN&openid=OPENID"
;
// 获取签名算法
public
static
String
GET_JSAPI_TICKET
=
"https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=ACCESS_TOKEN&type=jsapi"
;
/** 设置模版消息所属行业 */
public
static
String
GET_INDUSTRY
=
"https://api.weixin.qq.com/cgi-bin/template/get_industry?access_token=ACCESS_TOKEN"
;
/** 获取设置的行业信息 */
public
static
String
API_SET_INDUSTRY
=
"https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token=ACCESS_TOKEN"
;
/** 获得模板ID */
public
static
String
API_ADD_TEMPLATE
=
"https://api.weixin.qq.com/cgi-bin/template/api_add_template?access_token=ACCESS_TOKEN"
;
/** 获取模板列表 */
public
static
String
GET_ALL_PRIVATE_TEMPLATE
=
"https://api.weixin.qq.com/cgi-bin/template/get_all_private_template?access_token=ACCESS_TOKEN"
;
/** 发送模版消息 */
public
static
String
SEND_TEMPLATE
=
"https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN"
;
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/util/CloudPropertiesUtil.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
util
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
/**
* @author: zhehao.chen
* @version: V1.0
* @Description:
* @date: 2018/8/13 9:57
*/
public
class
CloudPropertiesUtil
{
private
static
Properties
proper
=
new
Properties
();
public
CloudPropertiesUtil
()
{
}
public
static
void
read
(
String
env
)
throws
IOException
{
if
(
env
.
equals
(
"dev"
))
{
load
(
"bootstrap-dev.properties"
);
}
else
if
(
env
.
equals
(
"test1"
))
{
load
(
"bootstrap-test1.properties"
);
}
else
if
(
env
.
equals
(
"test2"
))
{
load
(
"bootstrap-test2.properties"
);
}
else
if
(
env
.
equals
(
"uat"
))
{
load
(
"bootstrap-uat.properties"
);
}
else
if
(
env
.
equals
(
"pro"
))
{
load
(
"bootstrap-pro.properties"
);
}
}
public
static
void
load
(
String
file
)
throws
IOException
{
InputStream
stream
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
file
);
proper
.
load
(
stream
);
}
public
static
String
getValue
(
String
key
)
{
return
proper
.
getProperty
(
key
);
}
public
static
Integer
getIntValue
(
String
key
)
{
return
Integer
.
valueOf
(
proper
.
getProperty
(
key
));
}
public
static
void
updateProperties
(
String
key
,
String
value
)
{
proper
.
setProperty
(
key
,
value
);
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/util/MyX509TrustManager.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
util
;
import
javax.net.ssl.X509TrustManager
;
import
java.security.cert.CertificateException
;
import
java.security.cert.X509Certificate
;
/**
* 证书信任管理器(用于https请求)
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
MyX509TrustManager
implements
X509TrustManager
{
public
void
checkClientTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
public
void
checkServerTrusted
(
X509Certificate
[]
chain
,
String
authType
)
throws
CertificateException
{
}
public
X509Certificate
[]
getAcceptedIssuers
()
{
return
null
;
}
}
\ No newline at end of file
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/util/WeChatToolUtil.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
util
;
import
com.pica.cloud.foundation.utils.utils.JsonUtil
;
import
com.pica.cloud.foundation.utils.utils.StringUtil
;
import
com.pica.cloud.foundation.utils.utils.date.DateTimeUtils
;
import
com.pica.cloud.wechat.yunqueyilian.common.constants.WeChatConstants
;
import
com.pica.cloud.wechat.yunqueyilian.common.wechat.pojo.AccessToken
;
import
com.pica.cloud.wechat.yunqueyilian.common.wechat.pojo.JsapiTicket
;
import
com.pica.cloud.wechat.yunqueyilian.common.wechat.pojo.Menu
;
import
net.sf.json.JSONException
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
javax.net.ssl.HttpsURLConnection
;
import
javax.net.ssl.SSLContext
;
import
javax.net.ssl.SSLSocketFactory
;
import
javax.net.ssl.TrustManager
;
import
java.io.BufferedReader
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.net.ConnectException
;
import
java.net.URL
;
import
java.util.Date
;
/**
* 公众平台通用接口工具类
*
* @author bo.dang
* @date 2013-08-09
*/
public
class
WeChatToolUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
WeChatToolUtil
.
class
);
/**
* access_token
*/
public
static
String
access_token
;
public
static
AccessToken
accessToken
;
/**
* 获取access_token的时间
*/
public
static
Date
get_access_token_time
;
/**
* 权限签名
*/
public
static
JsapiTicket
jsapiTicket
=
null
;
/**
* 发起https请求并获取结果
*
* @param requestUrl 请求地址
* @param requestMethod 请求方式(GET、POST)
* @param outputStr 提交的数据
* @return JSONObject(通过JSONObject.get ( key)的方式获取json对象的属性值)
*/
public
static
JSONObject
httpRequest
(
String
requestUrl
,
String
requestMethod
,
String
outputStr
)
{
JSONObject
jsonObject
=
null
;
StringBuffer
buffer
=
new
StringBuffer
();
try
{
// 创建SSLContext对象,并使用我们指定的信任管理器初始化
TrustManager
[]
tm
=
{
new
MyX509TrustManager
()};
SSLContext
sslContext
=
SSLContext
.
getInstance
(
"SSL"
,
"SunJSSE"
);
sslContext
.
init
(
null
,
tm
,
new
java
.
security
.
SecureRandom
());
// 从上述SSLContext对象中得到SSLSocketFactory对象
SSLSocketFactory
ssf
=
sslContext
.
getSocketFactory
();
URL
url
=
new
URL
(
requestUrl
);
HttpsURLConnection
httpUrlConn
=
(
HttpsURLConnection
)
url
.
openConnection
();
httpUrlConn
.
setSSLSocketFactory
(
ssf
);
httpUrlConn
.
setDoOutput
(
true
);
httpUrlConn
.
setDoInput
(
true
);
httpUrlConn
.
setUseCaches
(
false
);
// 设置请求方式(GET/POST)
httpUrlConn
.
setRequestMethod
(
requestMethod
);
if
(
"GET"
.
equalsIgnoreCase
(
requestMethod
))
httpUrlConn
.
connect
();
// 当有数据需要提交时
if
(
null
!=
outputStr
)
{
OutputStream
outputStream
=
httpUrlConn
.
getOutputStream
();
// 注意编码格式,防止中文乱码
outputStream
.
write
(
outputStr
.
getBytes
(
"UTF-8"
));
outputStream
.
close
();
}
// 将返回的输入流转换成字符串
InputStream
inputStream
=
httpUrlConn
.
getInputStream
();
InputStreamReader
inputStreamReader
=
new
InputStreamReader
(
inputStream
,
"utf-8"
);
BufferedReader
bufferedReader
=
new
BufferedReader
(
inputStreamReader
);
String
str
=
null
;
while
((
str
=
bufferedReader
.
readLine
())
!=
null
)
{
buffer
.
append
(
str
);
}
bufferedReader
.
close
();
inputStreamReader
.
close
();
// 释放资源
inputStream
.
close
();
inputStream
=
null
;
httpUrlConn
.
disconnect
();
logger
.
info
(
buffer
.
toString
());
jsonObject
=
JSONObject
.
fromObject
(
buffer
.
toString
());
}
catch
(
ConnectException
ce
)
{
logger
.
error
(
"Weixin server connection timed out."
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"https request error:{}"
,
e
);
}
return
jsonObject
;
}
/**
* 获取access_token
*
* @param appid 凭证
* @param appsecret 密钥
* @return
*/
public
static
AccessToken
getAccessToken
(
String
appid
,
String
appsecret
)
{
AccessToken
accessToken
=
null
;
String
requestUrl
=
WeChatConstants
.
ACCESS_TOKEN_URL
.
replace
(
"APPID"
,
appid
).
replace
(
"APPSECRET"
,
appsecret
);
JSONObject
jsonObject
=
httpRequest
(
requestUrl
,
"GET"
,
null
);
// 如果请求成功
if
(
null
!=
jsonObject
)
{
try
{
access_token
=
jsonObject
.
getString
(
"access_token"
);
if
(!
StringUtil
.
isEmpty
(
access_token
))
{
get_access_token_time
=
new
Date
();
accessToken
=
JsonUtil
.
toGsonBean
(
jsonObject
.
toString
(),
AccessToken
.
class
);
logger
.
info
(
"获取token成功 accessToken:{}"
,
jsonObject
.
toString
());
}
else
{
get_access_token_time
=
new
Date
();
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
}
catch
(
JSONException
e
)
{
accessToken
=
null
;
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
}
else
{
// 获取token失败
logger
.
error
(
"获取token失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
WeChatToolUtil
.
accessToken
=
accessToken
;
return
accessToken
;
}
/**
* 校验accessToken是否过期
*
* @param access_token
* @return
*/
public
static
AccessToken
checkAccessToken
(
String
access_token
)
{
AccessToken
accessToken
=
WeChatToolUtil
.
accessToken
;
if
(
WeChatToolUtil
.
isExpired
()
||
StringUtil
.
isEmpty
(
access_token
))
{
logger
.
info
(
"access_token已过期,重新获取 start"
);
accessToken
=
WeChatToolUtil
.
getAccessToken
(
WeChatConstants
.
APP_ID
,
WeChatConstants
.
APP_SECRET
);
}
return
accessToken
;
}
/**
* 获得jsapi_ticket
*
* @return
*/
public
static
JsapiTicket
getJsapi_ticket
()
{
String
requestUrl
=
WeChatConstants
.
GET_JSAPI_TICKET
.
replace
(
"ACCESS_TOKEN"
,
access_token
);
JSONObject
jsonObject
=
httpRequest
(
requestUrl
,
"GET"
,
null
);
JsapiTicket
jsapiTicket
=
null
;
if
(
StringUtil
.
isNotNull
(
jsonObject
))
{
jsapiTicket
=
JsonUtil
.
toGsonBean
(
jsonObject
.
toString
(),
JsapiTicket
.
class
);
}
return
jsapiTicket
;
}
/**
* 创建菜单
*
* @param menu 菜单实例
* @param accessToken 有效的access_token
* @return 0表示成功,其他值表示失败
*/
public
static
Boolean
createMenu
(
Menu
menu
,
String
accessToken
)
{
Boolean
flag
=
true
;
// 拼装创建菜单的url
String
url
=
WeChatConstants
.
MENU_CREATE_URL
.
replace
(
"ACCESS_TOKEN"
,
accessToken
);
// 将菜单对象转换成json字符串
String
jsonMenu
=
JSONObject
.
fromObject
(
menu
).
toString
();
// 调用接口创建菜单
JSONObject
jsonObject
=
httpRequest
(
url
,
"POST"
,
jsonMenu
);
if
(
null
!=
jsonObject
)
{
if
(
0
!=
jsonObject
.
getInt
(
"errcode"
))
{
flag
=
false
;
logger
.
error
(
"创建菜单失败 errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
else
{
logger
.
info
(
"创建菜单成功! errcode:{} errmsg:{}"
,
jsonObject
.
getInt
(
"errcode"
),
jsonObject
.
getString
(
"errmsg"
));
}
}
return
flag
;
}
/**
* 判断access_token是否过期
*/
public
static
Boolean
isExpired
()
{
if
(
null
!=
get_access_token_time
)
{
logger
.
info
(
"判断access_token是否过期 get_access_token_time:{} currentTime:{}"
,
DateTimeUtils
.
DateTimeFormater
.
format
(
get_access_token_time
),
DateTimeUtils
.
currentDateTime
());
return
DateTimeUtils
.
compare2Date
(
new
Date
(),
DateTimeUtils
.
addDateSeconds
(
get_access_token_time
,
(
7200
-
60
)
*
1000
));
}
else
{
return
true
;
}
}
}
\ No newline at end of file
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/AccessToken.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* 微信通用接口凭证
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
AccessToken
{
/** 获取到的凭证 */
private
String
access_token
;
/** 凭证有效时间,单位:秒 */
private
int
expires_in
;
/** 用户刷新access_token */
private
String
refresh_token
;
/** 用户唯一标识,请注意,在未关注公众号时,用户访问公众号的网页,也会产生一个用户和公众号唯一的OpenID */
private
String
openid
;
/** 用户授权的作用域,使用逗号(,)分隔 */
private
String
scope
;
/**
* @return the access_token
*/
public
String
getAccess_token
()
{
return
access_token
;
}
/**
* @param access_token the access_token to set
*/
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
/**
* @return the expires_in
*/
public
int
getExpires_in
()
{
return
expires_in
;
}
/**
* @param expires_in the expires_in to set
*/
public
void
setExpires_in
(
int
expires_in
)
{
this
.
expires_in
=
expires_in
;
}
public
String
getRefresh_token
()
{
return
refresh_token
;
}
public
void
setRefresh_token
(
String
refresh_token
)
{
this
.
refresh_token
=
refresh_token
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getScope
()
{
return
scope
;
}
public
void
setScope
(
String
scope
)
{
this
.
scope
=
scope
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/BaseEntity.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
import
com.pica.cloud.foundation.utils.utils.date.DateAdapter
;
import
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter
;
import
java.util.Date
;
/**
* Created by wangxinxu on 16/9/25.
*/
public
class
BaseEntity
{
private
Integer
delete_flag
;
private
Integer
creat_id
;
@XmlJavaTypeAdapter
(
DateAdapter
.
class
)
protected
Date
creat_time
;
private
Integer
modify_id
;
@XmlJavaTypeAdapter
(
DateAdapter
.
class
)
protected
Date
modify_time
;
public
Integer
getDelete_flag
()
{
return
delete_flag
;
}
public
void
setDelete_flag
(
Integer
delete_flag
)
{
this
.
delete_flag
=
delete_flag
;
}
public
Integer
getCreat_id
()
{
return
creat_id
;
}
public
void
setCreat_id
(
Integer
creat_id
)
{
this
.
creat_id
=
creat_id
;
}
public
Date
getCreat_time
()
{
return
creat_time
;
}
public
void
setCreat_time
(
Date
creat_time
)
{
this
.
creat_time
=
creat_time
;
}
public
Integer
getModify_id
()
{
return
modify_id
;
}
public
void
setModify_id
(
Integer
modify_id
)
{
this
.
modify_id
=
modify_id
;
}
public
Date
getModify_time
()
{
return
modify_time
;
}
public
void
setModify_time
(
Date
modify_time
)
{
this
.
modify_time
=
modify_time
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/Button.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* 按钮的基类
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
Button
{
private
String
name
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/CommonButton.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* 普通按钮(子按钮)
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
CommonButton
extends
Button
{
private
String
type
;
private
String
key
;
private
String
url
;
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/ComplexButton.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* 复杂按钮(父按钮)
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
ComplexButton
extends
Button
{
private
Button
[]
sub_button
;
public
Button
[]
getSub_button
()
{
return
sub_button
;
}
public
void
setSub_button
(
Button
[]
sub_button
)
{
this
.
sub_button
=
sub_button
;
}
}
\ No newline at end of file
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/Industry.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* Created by Vino on 2016/12/22.
*/
public
class
Industry
{
private
String
industry_id1
;
private
String
industry_id2
;
public
String
getIndustry_id1
()
{
return
industry_id1
;
}
public
void
setIndustry_id1
(
String
industry_id1
)
{
this
.
industry_id1
=
industry_id1
;
}
public
String
getIndustry_id2
()
{
return
industry_id2
;
}
public
void
setIndustry_id2
(
String
industry_id2
)
{
this
.
industry_id2
=
industry_id2
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/JsapiTicket.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
public
class
JsapiTicket
{
/** 状态码 */
private
Integer
errcode
;
/** 状态 */
private
String
errmsg
;
/** 签名 */
private
String
ticket
;
/** 有效期 */
private
Integer
expires_in
;
public
Integer
getErrcode
()
{
return
errcode
;
}
public
void
setErrcode
(
Integer
errcode
)
{
this
.
errcode
=
errcode
;
}
public
String
getErrmsg
()
{
return
errmsg
;
}
public
void
setErrmsg
(
String
errmsg
)
{
this
.
errmsg
=
errmsg
;
}
public
String
getTicket
()
{
return
ticket
;
}
public
void
setTicket
(
String
ticket
)
{
this
.
ticket
=
ticket
;
}
public
Integer
getExpires_in
()
{
return
expires_in
;
}
public
void
setExpires_in
(
Integer
expires_in
)
{
this
.
expires_in
=
expires_in
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/Menu.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* 菜单
*
* @author bo.dang
* @date 2014-12-04
*/
public
class
Menu
{
private
Button
[]
button
;
public
Button
[]
getButton
()
{
return
button
;
}
public
void
setButton
(
Button
[]
button
)
{
this
.
button
=
button
;
}
}
\ No newline at end of file
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/SendTemplate.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* Created by Vino on 2016/12/22.
*/
public
class
SendTemplate
{
private
String
touser
;
private
String
template_id
;
private
String
url
;
private
TemplateData
data
;
public
String
getTouser
()
{
return
touser
;
}
public
void
setTouser
(
String
touser
)
{
this
.
touser
=
touser
;
}
public
String
getTemplate_id
()
{
return
template_id
;
}
public
void
setTemplate_id
(
String
template_id
)
{
this
.
template_id
=
template_id
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
TemplateData
getData
()
{
return
data
;
}
public
void
setData
(
TemplateData
data
)
{
this
.
data
=
data
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/Template.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* Created by Vino on 2016/12/22.
*/
public
class
Template
{
private
String
template_id
;
public
String
getTemplate_id
()
{
return
template_id
;
}
public
void
setTemplate_id
(
String
template_id
)
{
this
.
template_id
=
template_id
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/TemplateData.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* Created by Vino on 2016/12/22.
*/
public
class
TemplateData
{
private
TemplateKeynote
first
;
private
TemplateKeynote
keynote1
;
private
TemplateKeynote
keynote2
;
private
TemplateKeynote
keynote3
;
private
TemplateKeynote
subject
;
private
TemplateKeynote
sender
;
private
TemplateKeynote
remark
;
public
TemplateKeynote
getFirst
()
{
return
first
;
}
public
void
setFirst
(
TemplateKeynote
first
)
{
this
.
first
=
first
;
}
public
TemplateKeynote
getKeynote1
()
{
return
keynote1
;
}
public
void
setKeynote1
(
TemplateKeynote
keynote1
)
{
this
.
keynote1
=
keynote1
;
}
public
TemplateKeynote
getKeynote2
()
{
return
keynote2
;
}
public
void
setKeynote2
(
TemplateKeynote
keynote2
)
{
this
.
keynote2
=
keynote2
;
}
public
TemplateKeynote
getKeynote3
()
{
return
keynote3
;
}
public
void
setKeynote3
(
TemplateKeynote
keynote3
)
{
this
.
keynote3
=
keynote3
;
}
public
TemplateKeynote
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
TemplateKeynote
remark
)
{
this
.
remark
=
remark
;
}
public
TemplateKeynote
getSubject
()
{
return
subject
;
}
public
void
setSubject
(
TemplateKeynote
subject
)
{
this
.
subject
=
subject
;
}
public
TemplateKeynote
getSender
()
{
return
sender
;
}
public
void
setSender
(
TemplateKeynote
sender
)
{
this
.
sender
=
sender
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/TemplateKeynote.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
/**
* Created by Vino on 2016/12/22.
*/
public
class
TemplateKeynote
{
private
String
value
;
private
String
color
;
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
String
getColor
()
{
return
color
;
}
public
void
setColor
(
String
color
)
{
this
.
color
=
color
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/User.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
public
class
User
{
/** 是否订阅该公众号标识 */
private
String
subscribe
;
/** 用户标识 */
private
String
openid
;
/** 昵称 */
private
String
nickname
;
/** 性别 */
private
String
sex
;
/** 用户所在城市 */
private
String
city
;
/** 用户所在省份 */
private
String
province
;
/** 用户的语言 */
private
String
language
;
/** 用户头像 */
private
String
headimgrul
;
/** 用户关注时间 */
private
String
subscribe_time
;
/** 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段 */
private
String
unionid
;
/** 纬度 */
private
String
latitude
;
/** 经度 */
private
String
longitude
;
/**
* @return the subscribe
*/
public
String
getSubscribe
()
{
return
subscribe
;
}
/**
* @param subscribe the subscribe to set
*/
public
void
setSubscribe
(
String
subscribe
)
{
this
.
subscribe
=
subscribe
;
}
/**
* @return the openid
*/
public
String
getOpenid
()
{
return
openid
;
}
/**
* @param openid the openid to set
*/
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
/**
* @return the nickname
*/
public
String
getNickname
()
{
return
nickname
;
}
/**
* @param nickname the nickname to set
*/
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
/**
* @return the sex
*/
public
String
getSex
()
{
return
sex
;
}
/**
* @param sex the sex to set
*/
public
void
setSex
(
String
sex
)
{
this
.
sex
=
sex
;
}
/**
* @return the city
*/
public
String
getCity
()
{
return
city
;
}
/**
* @param city the city to set
*/
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
/**
* @return the province
*/
public
String
getProvince
()
{
return
province
;
}
/**
* @param province the province to set
*/
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
/**
* @return the language
*/
public
String
getLanguage
()
{
return
language
;
}
/**
* @param language the language to set
*/
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
/**
* @return the headimgrul
*/
public
String
getHeadimgrul
()
{
return
headimgrul
;
}
/**
* @param headimgrul the headimgrul to set
*/
public
void
setHeadimgrul
(
String
headimgrul
)
{
this
.
headimgrul
=
headimgrul
;
}
/**
* @return the subscribe_time
*/
public
String
getSubscribe_time
()
{
return
subscribe_time
;
}
/**
* @param subscribe_time the subscribe_time to set
*/
public
void
setSubscribe_time
(
String
subscribe_time
)
{
this
.
subscribe_time
=
subscribe_time
;
}
/**
* @return the unionid
*/
public
String
getUnionid
()
{
return
unionid
;
}
/**
* @param unionid the unionid to set
*/
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
public
String
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
}
public
String
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/WSLocation.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
public
class
WSLocation
extends
BaseEntity
{
/** openid */
private
String
openid
;
/** 纬度 */
private
String
latitude
;
/** 经度 */
private
String
longitude
;
/** 精度 */
private
String
precision
;
/**
* @return the latitude
*/
public
String
getLatitude
()
{
return
latitude
;
}
/**
* @param latitude the latitude to set
*/
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
}
/**
* @return the longitude
*/
public
String
getLongitude
()
{
return
longitude
;
}
/**
* @param longitude the longitude to set
*/
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
/**
* @return the openid
*/
public
String
getOpenid
()
{
return
openid
;
}
/**
* @param openid the openid to set
*/
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
/**
* @return the precision
*/
public
String
getPrecision
()
{
return
precision
;
}
/**
* @param precision the precision to set
*/
public
void
setPrecision
(
String
precision
)
{
this
.
precision
=
precision
;
}
}
common/src/main/java/com/pica/cloud/wechat/yunqueyilian/common/wechat/pojo/WSUser.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
common
.
wechat
.
pojo
;
import
java.util.Date
;
public
class
WSUser
extends
BaseEntity
{
/**
* 是否订阅该公众号标识
*/
private
Integer
subscribe
;
/**
* 用户标识
*/
private
String
openid
;
/**
* 昵称
*/
private
String
nickname
;
/**
* 性别
*/
private
String
sex
;
/**
* 用户所在城市
*/
private
String
city
;
/**
* 用户所在省份
*/
private
String
province
;
/**
* 用户的语言
*/
private
String
language
;
/**
* 用户头像
*/
private
String
headimgurl
;
/**
* 用户关注时间
*/
private
Date
subscribe_time
;
/**
* 只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段
*/
private
String
unionid
;
/**
* @return the subscribe
*/
public
Integer
getSubscribe
()
{
return
subscribe
;
}
/**
* @param subscribe the subscribe to set
*/
public
void
setSubscribe
(
Integer
subscribe
)
{
this
.
subscribe
=
subscribe
;
}
/**
* @return the sex
*/
public
String
getSex
()
{
return
sex
;
}
/**
* @param sex the sex to set
*/
public
void
setSex
(
String
sex
)
{
this
.
sex
=
sex
;
}
/**
* @return the city
*/
public
String
getCity
()
{
return
city
;
}
/**
* @param city the city to set
*/
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
/**
* @return the province
*/
public
String
getProvince
()
{
return
province
;
}
/**
* @param province the province to set
*/
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
/**
* @return the language
*/
public
String
getLanguage
()
{
return
language
;
}
/**
* @param language the language to set
*/
public
void
setLanguage
(
String
language
)
{
this
.
language
=
language
;
}
/**
* @return the subscribe_time
*/
public
Date
getSubscribe_time
()
{
return
subscribe_time
;
}
/**
* @param subscribe_time the subscribe_time to set
*/
public
void
setSubscribe_time
(
Date
subscribe_time
)
{
this
.
subscribe_time
=
subscribe_time
;
}
public
String
getOpenid
()
{
return
openid
;
}
public
void
setOpenid
(
String
openid
)
{
this
.
openid
=
openid
;
}
public
String
getNickname
()
{
return
nickname
;
}
public
void
setNickname
(
String
nickname
)
{
this
.
nickname
=
nickname
;
}
/**
* @return the headimgurl
*/
public
String
getHeadimgurl
()
{
return
headimgurl
;
}
/**
* @param headimgurl the headimgurl to set
*/
public
void
setHeadimgurl
(
String
headimgurl
)
{
this
.
headimgurl
=
headimgurl
;
}
/**
* @return the unionid
*/
public
String
getUnionid
()
{
return
unionid
;
}
/**
* @param unionid the unionid to set
*/
public
void
setUnionid
(
String
unionid
)
{
this
.
unionid
=
unionid
;
}
}
pom.xml
浏览文件 @
0baa2967
...
@@ -16,11 +16,6 @@
...
@@ -16,11 +16,6 @@
<version>
1.0.7-SNAPSHOT
</version>
<version>
1.0.7-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.pica.cloud
</groupId>
<artifactId>
pica-common-utils
</artifactId>
<version>
1.0.2-SNAPSHOT
</version>
</dependency>
</dependencies>
</dependencies>
<modules>
<modules>
...
...
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/client/IUserServiceClient.java
浏览文件 @
0baa2967
...
@@ -16,7 +16,7 @@ import java.util.Map;
...
@@ -16,7 +16,7 @@ import java.util.Map;
* @date: 2018/8/9 13:15
* @date: 2018/8/9 13:15
*/
*/
@FeignClient
(
value
=
"10102-PICA-CLOUD-WECHAT"
,
fallbackFactory
=
UserServiceFailFactory
.
class
)
@FeignClient
(
value
=
"10102-PICA-CLOUD-WECHAT"
,
fallbackFactory
=
UserServiceFailFactory
.
class
)
@RequestMapping
(
"/wechats
"
)
@RequestMapping
(
value
=
"/wechats"
,
headers
=
"sysCode=11"
,
produces
=
"application/json;charset=UTF-8
"
)
public
interface
IUserServiceClient
{
public
interface
IUserServiceClient
{
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/users"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/users"
)
PicaResponse
<
Map
<
String
,
Object
>>
users
(
@RequestParam
(
value
=
"wechatName"
)
String
wechatName
,
@RequestParam
(
value
=
"openId"
)
String
openId
);
PicaResponse
<
Map
<
String
,
Object
>>
users
(
@RequestParam
(
value
=
"wechatName"
)
String
wechatName
,
@RequestParam
(
value
=
"openId"
)
String
openId
);
...
...
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/service/impl/CoreServiceImpl.java
浏览文件 @
0baa2967
...
@@ -95,10 +95,7 @@ public class CoreServiceImpl implements CoreService {
...
@@ -95,10 +95,7 @@ public class CoreServiceImpl implements CoreService {
String
eventKey
=
requestMap
.
get
(
"EventKey"
);
String
eventKey
=
requestMap
.
get
(
"EventKey"
);
logger
.
info
(
"eventKey:"
+
eventKey
);
logger
.
info
(
"eventKey:"
+
eventKey
);
if
(
eventKey
.
equals
(
"11"
))
{
if
(
eventKey
.
equals
(
"11"
))
{
}
else
if
(
eventKey
.
equals
(
"12"
))
{
respContent
=
"11客官别急,功能正在升级中..."
;
respContent
=
"12客官别急,功能正在升级中..."
;
}
else
if
(
eventKey
.
equals
(
"13"
))
{
respContent
=
"13客官别急,功能正在升级中..."
;
}
}
}
}
}
}
...
...
server/src/main/java/com/pica/cloud/wechat/yunqueyilian/server/service/impl/MenuManagerServiceImpl.java
0 → 100644
浏览文件 @
0baa2967
package
com
.
pica
.
cloud
.
wechat
.
yunqueyilian
.
server
.
service
.
impl
;
import
com.pica.cloud.wechat.yunqueyilian.common.constants.WeChatConstants
;
import
com.pica.cloud.wechat.yunqueyilian.common.util.CloudPropertiesUtil
;
import
com.pica.cloud.wechat.yunqueyilian.common.util.WeChatToolUtil
;
import
com.pica.cloud.wechat.yunqueyilian.common.wechat.pojo.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
/**
* @author: zhehao.chen
* @version: V1.0
* @Description:菜单管理器类
* @date: 2018/8/10 18:12
*/
public
class
MenuManagerServiceImpl
{
private
static
Logger
log
=
LoggerFactory
.
getLogger
(
MenuManagerServiceImpl
.
class
);
public
static
void
main
(
String
[]
args
)
throws
IOException
{
CloudPropertiesUtil
.
read
(
"dev"
);
AccessToken
accessToken
=
WeChatToolUtil
.
getAccessToken
(
CloudPropertiesUtil
.
getValue
(
"AppID"
),
CloudPropertiesUtil
.
getValue
(
"AppSecret"
));
Boolean
flag
=
WeChatToolUtil
.
createMenu
(
getMenu
(),
accessToken
.
getAccess_token
());
if
(
flag
)
{
System
.
out
.
println
(
"菜单创建成功"
);
}
else
{
System
.
out
.
println
(
"菜单创建失败"
);
}
}
/**
* 组装菜单数据
*
* @return
*/
private
static
Menu
getMenu
()
throws
UnsupportedEncodingException
{
String
utl_end
=
"&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect"
;
CommonButton
btn11
=
new
CommonButton
();
btn11
.
setName
(
"消息"
);
btn11
.
setType
(
"view"
);
String
url11
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
WeChatConstants
.
APP_ID
+
"&redirect_uri="
+
URLEncoder
.
encode
(
"https://test1-yunqueyilian.yunqueyi.com/index.html#/message"
,
"UTF-8"
);
btn11
.
setUrl
(
url11
+
utl_end
);
CommonButton
btn21
=
new
CommonButton
();
btn21
.
setName
(
"健康漫画"
);
btn21
.
setType
(
"view"
);
String
h_knowledge_redirect_uri
=
"http://mp.weixin.qq.com/mp/homepage?__biz=MzIzNjM5NDA1OQ==&hid=2&sn=f52aa8659aa75f32aae5ea62d23e64ca&scene=18#wechat_redirect"
;
btn21
.
setUrl
(
h_knowledge_redirect_uri
);
CommonButton
btn31
=
new
CommonButton
();
btn31
.
setName
(
"绑定个人信息"
);
btn31
.
setType
(
"view"
);
String
url31
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
WeChatConstants
.
APP_ID
+
"&redirect_uri="
+
URLEncoder
.
encode
(
"https://test1-yunqueyilian.yunqueyi.com/index.html#/goBind"
,
"UTF-8"
);
btn31
.
setUrl
(
url31
+
utl_end
);
CommonButton
btn32
=
new
CommonButton
();
btn32
.
setName
(
"门诊预约"
);
btn32
.
setType
(
"view"
);
String
url32
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
WeChatConstants
.
APP_ID
+
"&redirect_uri="
+
URLEncoder
.
encode
(
"https://test1-yunqueyilian.yunqueyi.com/index.html#/applyIndex"
,
"UTF-8"
);
btn32
.
setUrl
(
url32
+
utl_end
);
CommonButton
btn33
=
new
CommonButton
();
btn33
.
setName
(
"随访记录"
);
btn33
.
setType
(
"view"
);
String
url33
=
"https://open.weixin.qq.com/connect/oauth2/authorize?appid="
+
WeChatConstants
.
APP_ID
+
"&redirect_uri="
+
URLEncoder
.
encode
(
"https://test1-yunqueyilian.yunqueyi.com/index.html#/followUp"
,
"UTF-8"
);
btn33
.
setUrl
(
url33
+
utl_end
);
ComplexButton
mainBtn3
=
new
ComplexButton
();
mainBtn3
.
setName
(
"我的"
);
mainBtn3
.
setSub_button
(
new
CommonButton
[]{
btn31
,
btn32
,
btn33
});
/**
* 这是公众号xiaoqrobot目前的菜单结构,每个一级菜单都有二级菜单项<br>
*
* 在某个一级菜单下没有二级菜单的情况,menu该如何定义呢?<br>
* 比如,第三个一级菜单项不是“更多体验”,而直接是“幽默笑话”,那么menu应该这样定义:<br>
* menu.setButton(new Button[] { mainBtn1, mainBtn2, btn33 });
*/
Menu
menu
=
new
Menu
();
menu
.
setButton
(
new
Button
[]{
btn11
,
btn21
,
mainBtn3
});
return
menu
;
}
}
\ No newline at end of file
server/src/main/resources/bootstrap-dev.properties
浏览文件 @
0baa2967
...
@@ -3,14 +3,7 @@ server.context-path=/yunqueyilian
...
@@ -3,14 +3,7 @@ server.context-path=/yunqueyilian
spring.application.name
=
${server.port}-pica-cloud-yunqueyilian
spring.application.name
=
${server.port}-pica-cloud-yunqueyilian
#config server settings
#config server settings
#spring.cloud.config.name=com.pica.cloud.wechat
spring.cloud.config.name
=
com.pica.cloud.wechat
##spring.cloud.config.profile=dev
##spring.cloud.config.label=publish
##spring.cloud.config.discovery.enabled=true
##spring.cloud.config.discovery.service-id=config-server
#config server settings
spring.cloud.config.name
=
com.pica.cloud.exam
spring.cloud.config.profile
=
dev
spring.cloud.config.profile
=
dev
spring.cloud.config.label
=
publish
spring.cloud.config.label
=
publish
spring.cloud.config.discovery.enabled
=
true
spring.cloud.config.discovery.enabled
=
true
...
@@ -31,6 +24,10 @@ spring.rabbitmq.port=5672
...
@@ -31,6 +24,10 @@ spring.rabbitmq.port=5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
#微信登录信息
AppID
=
wx1ee39338694703b0
AppSecret
=
69e2c741d0cf8fd7eb8877ab9f3a236b
#local settings
#local settings
feign.hystrix.enabled
=
true
feign.hystrix.enabled
=
true
#开启hystrix请求超时机制
#开启hystrix请求超时机制
...
...
server/src/main/resources/bootstrap-test1.properties
浏览文件 @
0baa2967
...
@@ -24,8 +24,19 @@ spring.rabbitmq.port=5672
...
@@ -24,8 +24,19 @@ spring.rabbitmq.port=5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
#微信登录信息
AppID
=
wx1ee39338694703b0
AppSecret
=
69e2c741d0cf8fd7eb8877ab9f3a236b
#local settings
#local settings
feign.hystrix.enabled
=
true
feign.hystrix.enabled
=
true
#开启hystrix请求超时机制
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds
=
10000
#请求连接的超时时间
ribbon.ConnectTimeout
=
6000
#请求处理的超时时间
ribbon.ReadTimeout
=
6000
management.security.enabled
=
false
management.security.enabled
=
false
spring.zipkin.base-url
=
http://192.168.110.133:7895
spring.zipkin.base-url
=
http://192.168.110.133:7895
...
...
server/src/main/resources/bootstrap-test2.properties
浏览文件 @
0baa2967
...
@@ -24,8 +24,18 @@ spring.rabbitmq.port=5672
...
@@ -24,8 +24,18 @@ spring.rabbitmq.port=5672
spring.rabbitmq.username
=
appuser
spring.rabbitmq.username
=
appuser
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
spring.rabbitmq.password
=
AqLfvyWOvLQEUzdI
#微信登录信息
AppID
=
wx1ee39338694703b0
AppSecret
=
69e2c741d0cf8fd7eb8877ab9f3a236b
#local settings
#local settings
feign.hystrix.enabled
=
true
feign.hystrix.enabled
=
true
#开启hystrix请求超时机制
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds
=
10000
#请求连接的超时时间
ribbon.ConnectTimeout
=
6000
#请求处理的超时时间
ribbon.ReadTimeout
=
6000
management.security.enabled
=
false
management.security.enabled
=
false
spring.zipkin.base-url
=
http://192.168.110.133:7895
spring.zipkin.base-url
=
http://192.168.110.133:7895
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录