WechatAuthProperties.java 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. package com.java110.api.properties;
  2. import com.java110.utils.cache.MappingCache;
  3. import com.java110.utils.cache.UrlCache;
  4. import com.java110.utils.constant.MappingConstant;
  5. import com.java110.utils.constant.WechatConstant;
  6. import com.java110.utils.util.StringUtil;
  7. import org.springframework.boot.context.properties.ConfigurationProperties;
  8. import org.springframework.context.annotation.PropertySource;
  9. import org.springframework.stereotype.Component;
  10. @Component
  11. @ConfigurationProperties(prefix = "java110.auth.wechat")
  12. @PropertySource("classpath:wechatAuth.properties")
  13. public class WechatAuthProperties {
  14. //微信支付类型
  15. //NATIVE--原生支付
  16. //JSAPI--公众号支付-小程序支付
  17. //MWEB--H5支付
  18. //APP -- app支付
  19. public static final String TRADE_TYPE_NATIVE = "NATIVE";
  20. public static final String TRADE_TYPE_JSAPI = "JSAPI";
  21. public static final String TRADE_TYPE_MWEB = "MWEB";
  22. public static final String TRADE_TYPE_APP = "APP";
  23. private String sessionHost;
  24. private String appId;
  25. private String secret;
  26. private String grantType;
  27. private String key;
  28. private String mchId;
  29. private String wxPayUnifiedOrder;
  30. private String wxNotifyUrl;
  31. private String rentingNotifyUrl;
  32. private String goodsNotifyUrl;
  33. private String oweFeeNotifyUrl;
  34. private String tempCarFeeNotifyUrl;
  35. private String wechatAppId;//微信公众号ID
  36. private String wechatAppSecret;//微信公众号秘钥
  37. private String sendMsgUrl;//微信公众号推送模板信息链接
  38. public String getSessionHost() {
  39. return sessionHost;
  40. }
  41. public void setSessionHost(String sessionHost) {
  42. this.sessionHost = sessionHost;
  43. }
  44. public String getAppId() {
  45. String appIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appId");
  46. if (!StringUtil.isEmpty(appIdCache)) {
  47. return appIdCache;
  48. }
  49. return appId;
  50. }
  51. public void setAppId(String appId) {
  52. this.appId = appId;
  53. }
  54. public String getSecret() {
  55. String appSecretCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "appSecret");
  56. if (!StringUtil.isEmpty(appSecretCache)) {
  57. return appSecretCache;
  58. }
  59. return secret;
  60. }
  61. public void setSecret(String secret) {
  62. this.secret = secret;
  63. }
  64. public String getGrantType() {
  65. return grantType;
  66. }
  67. public void setGrantType(String grantType) {
  68. this.grantType = grantType;
  69. }
  70. public String getKey() {
  71. String keyCache = MappingCache.getValue(MappingConstant.WECHAT_STORE_DOMAIN, "key");
  72. if (!StringUtil.isEmpty(keyCache)) {
  73. return keyCache;
  74. }
  75. return key;
  76. }
  77. public void setKey(String key) {
  78. this.key = key;
  79. }
  80. public String getMchId() {
  81. String mchIdCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "mchId");
  82. if (!StringUtil.isEmpty(mchIdCache)) {
  83. return mchIdCache;
  84. }
  85. return mchId;
  86. }
  87. public void setMchId(String mchId) {
  88. this.mchId = mchId;
  89. }
  90. public String getWxPayUnifiedOrder() {
  91. return wxPayUnifiedOrder;
  92. }
  93. public void setWxPayUnifiedOrder(String wxPayUnifiedOrder) {
  94. this.wxPayUnifiedOrder = wxPayUnifiedOrder;
  95. }
  96. public String getWxNotifyUrl() {
  97. String wxNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "wxNotifyUrl");
  98. if (!StringUtil.isEmpty(wxNotifyUrlCache)) {
  99. return UrlCache.getOwnerUrl()+wxNotifyUrlCache;
  100. }
  101. return wxNotifyUrl;
  102. }
  103. public void setWxNotifyUrl(String wxNotifyUrl) {
  104. this.wxNotifyUrl = wxNotifyUrl;
  105. }
  106. public String getWechatAppId() {
  107. String wechatAppIdCache = MappingCache.getValue(MappingConstant.MALL_WECHAT_DOMAIN, "wechatAppId");
  108. if (!StringUtil.isEmpty(wechatAppIdCache)) {
  109. return wechatAppIdCache;
  110. }
  111. return wechatAppId;
  112. }
  113. public void setWechatAppId(String wechatAppId) {
  114. this.wechatAppId = wechatAppId;
  115. }
  116. public String getWechatAppSecret() {
  117. String wechatAppSecretCache = MappingCache.getValue(MappingConstant.MALL_WECHAT_DOMAIN, "wechatAppSecret");
  118. if (!StringUtil.isEmpty(wechatAppSecretCache)) {
  119. return wechatAppSecretCache;
  120. }
  121. return wechatAppSecret;
  122. }
  123. public void setWechatAppSecret(String wechatAppSecret) {
  124. this.wechatAppSecret = wechatAppSecret;
  125. }
  126. public String getSendMsgUrl() {
  127. return sendMsgUrl;
  128. }
  129. public void setSendMsgUrl(String sendMsgUrl) {
  130. this.sendMsgUrl = sendMsgUrl;
  131. }
  132. public String getRentingNotifyUrl() {
  133. String rentingNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "rentingNotifyUrl");
  134. if (!StringUtil.isEmpty(rentingNotifyUrlCache)) {
  135. return UrlCache.getMallAppUrl()+rentingNotifyUrlCache;
  136. }
  137. return rentingNotifyUrl;
  138. }
  139. public void setRentingNotifyUrl(String rentingNotifyUrl) {
  140. this.rentingNotifyUrl = rentingNotifyUrl;
  141. }
  142. public String getOweFeeNotifyUrl() {
  143. String oweFeeNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "oweFeeNotifyUrl");
  144. if (!StringUtil.isEmpty(oweFeeNotifyUrlCache)) {
  145. return UrlCache.getOwnerUrl()+oweFeeNotifyUrlCache;
  146. }
  147. return oweFeeNotifyUrl;
  148. }
  149. public void setOweFeeNotifyUrl(String oweFeeNotifyUrl) {
  150. this.oweFeeNotifyUrl = oweFeeNotifyUrl;
  151. }
  152. public String getGoodsNotifyUrl() {
  153. String goodsNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "goodsNotifyUrl");
  154. if (!StringUtil.isEmpty(goodsNotifyUrlCache)) {
  155. return UrlCache.getMallAppUrl()+goodsNotifyUrlCache;
  156. }
  157. return goodsNotifyUrl;
  158. }
  159. public void setGoodsNotifyUrl(String goodsNotifyUrl) {
  160. this.goodsNotifyUrl = goodsNotifyUrl;
  161. }
  162. public String getTempCarFeeNotifyUrl() {
  163. String tempCarFeeNotifyUrlCache = MappingCache.getValue(WechatConstant.WECHAT_DOMAIN, "tempCarFeeNotifyUrl");
  164. if (!StringUtil.isEmpty(tempCarFeeNotifyUrlCache)) {
  165. return UrlCache.getOwnerUrl()+ tempCarFeeNotifyUrlCache;
  166. }
  167. return tempCarFeeNotifyUrl;
  168. }
  169. public void setTempCarFeeNotifyUrl(String tempCarFeeNotifyUrl) {
  170. this.tempCarFeeNotifyUrl = tempCarFeeNotifyUrl;
  171. }
  172. }