LauncherConstant.java 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.common.constant;
  18. import org.springblade.core.launch.constant.AppConstant;
  19. import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
  20. /**
  21. * 启动常量
  22. *
  23. * @author Chill
  24. */
  25. public interface LauncherConstant {
  26. /**
  27. * 后管
  28. */
  29. String APPLICATION_MANAGER_NAME = APPLICATION_NAME_PREFIX + "manager";
  30. /**
  31. * 计量
  32. */
  33. String APPLICATION_METER_NAME = APPLICATION_NAME_PREFIX + "meter";
  34. /**
  35. * 档案
  36. */
  37. String APPLICATION_ARCHIVE_NAME = APPLICATION_NAME_PREFIX + "archive";
  38. /**
  39. * 大屏
  40. */
  41. String APPLICATION_VISUAL_NAME = APPLICATION_NAME_PREFIX + "visual";
  42. /**
  43. * 征拆
  44. */
  45. String APPLICATION_LAND_NAME = APPLICATION_NAME_PREFIX + "land";
  46. /**
  47. * websocket
  48. */
  49. String APPLICATION_WEBSOCKET_NAME = APPLICATION_NAME_PREFIX + "websocket";
  50. /**
  51. * MQ生产者
  52. */
  53. String APPLICATION_MQ_PRODUCER = APPLICATION_NAME_PREFIX + "rabbitmq-producer";
  54. /**
  55. * MQ消费者
  56. */
  57. String APPLICATION_MQ_CONSUMER = APPLICATION_NAME_PREFIX + "rabbitmq-consumer";
  58. /**
  59. * xxljob
  60. */
  61. String APPLICATION_XXLJOB_NAME = APPLICATION_NAME_PREFIX + "xxljob";
  62. /**
  63. * xxljob
  64. */
  65. String APPLICATION_XXLJOB_ADMIN_NAME = APPLICATION_NAME_PREFIX + "xxljob-admin";
  66. String APPLICATION_REPAIR_NAME = APPLICATION_NAME_PREFIX + "repair";
  67. String APPLICATION_DingDing_NAME = APPLICATION_NAME_PREFIX + "dingding";
  68. /**
  69. * nacos dev 地址 215==172.31.222.127 192.168.0.109 127.0.0.1 210-=-172.30.224.81
  70. * nacos dev 地址 172.31.222.127 192.168.0.109 127.0.0.1 172.30.224.81(39.108.216.210) 152.168.2.11
  71. */
  72. //更107服务器时打包的时候要改成192.168.0.109
  73. // 73用这个 127.0.0.1 113要用这个 10.0.0.6
  74. String NACOS_DEV_ADDR = "127.0.0.1:8848";
  75. /**
  76. * nacos prod 地址
  77. */
  78. String NACOS_PROD_ADDR = "172.30.0.48:8848";
  79. /**
  80. * nacos test 地址
  81. */
  82. String NACOS_TEST_ADDR = "172.30.0.48:8848";
  83. /**
  84. * sentinel dev 地址
  85. */
  86. String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
  87. /**
  88. * sentinel prod 地址
  89. */
  90. String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
  91. /**
  92. * sentinel test 地址
  93. */
  94. String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
  95. /**
  96. * seata dev 地址
  97. */
  98. String SEATA_DEV_ADDR = "127.0.0.1:8091";
  99. /**
  100. * seata prod 地址
  101. */
  102. String SEATA_PROD_ADDR = "172.30.0.68:8091";
  103. /**
  104. * seata test 地址
  105. */
  106. String SEATA_TEST_ADDR = "172.30.0.68:8091";
  107. /**
  108. * zipkin dev 地址
  109. */
  110. String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
  111. /**
  112. * zipkin prod 地址
  113. */
  114. String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411";
  115. /**
  116. * zipkin test 地址
  117. */
  118. String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411";
  119. /**
  120. * elk dev 地址
  121. */
  122. String ELK_DEV_ADDR = "192.168.0.119:9000";
  123. /**
  124. * elk prod 地址
  125. */
  126. String ELK_PROD_ADDR = "172.30.0.72:9000";
  127. /**
  128. * elk test 地址
  129. */
  130. String ELK_TEST_ADDR = "172.30.0.72:9000";
  131. /**
  132. * seata file模式
  133. */
  134. String FILE_MODE = "file";
  135. /**
  136. * seata nacos模式
  137. */
  138. String NACOS_MODE = "nacos";
  139. /**
  140. * seata default模式
  141. */
  142. String DEFAULT_MODE = "default";
  143. /**
  144. * seata group后缀
  145. */
  146. String GROUP_NAME = "-group";
  147. /**
  148. * seata 服务组格式
  149. *
  150. * @param appName 服务名
  151. * @return group
  152. */
  153. static String seataServiceGroup(String appName) {
  154. return appName.concat(GROUP_NAME);
  155. }
  156. /**
  157. * 动态获取nacos地址
  158. *
  159. * @param profile 环境变量
  160. * @return addr
  161. */
  162. static String nacosAddr(String profile) {
  163. switch (profile) {
  164. case (AppConstant.PROD_CODE):
  165. return NACOS_PROD_ADDR;
  166. case (AppConstant.TEST_CODE):
  167. return NACOS_TEST_ADDR;
  168. default:
  169. return NACOS_DEV_ADDR;
  170. }
  171. }
  172. /**
  173. * 动态获取sentinel地址
  174. *
  175. * @param profile 环境变量
  176. * @return addr
  177. */
  178. static String sentinelAddr(String profile) {
  179. switch (profile) {
  180. case (AppConstant.PROD_CODE):
  181. return SENTINEL_PROD_ADDR;
  182. case (AppConstant.TEST_CODE):
  183. return SENTINEL_TEST_ADDR;
  184. default:
  185. return SENTINEL_DEV_ADDR;
  186. }
  187. }
  188. /**
  189. * 动态获取seata地址
  190. *
  191. * @param profile 环境变量
  192. * @return addr
  193. */
  194. static String seataAddr(String profile) {
  195. switch (profile) {
  196. case (AppConstant.PROD_CODE):
  197. return SEATA_PROD_ADDR;
  198. case (AppConstant.TEST_CODE):
  199. return SEATA_TEST_ADDR;
  200. default:
  201. return SEATA_DEV_ADDR;
  202. }
  203. }
  204. /**
  205. * 动态获取zipkin地址
  206. *
  207. * @param profile 环境变量
  208. * @return addr
  209. */
  210. static String zipkinAddr(String profile) {
  211. switch (profile) {
  212. case (AppConstant.PROD_CODE):
  213. return ZIPKIN_PROD_ADDR;
  214. case (AppConstant.TEST_CODE):
  215. return ZIPKIN_TEST_ADDR;
  216. default:
  217. return ZIPKIN_DEV_ADDR;
  218. }
  219. }
  220. /**
  221. * 动态获取elk地址
  222. *
  223. * @param profile 环境变量
  224. * @return addr
  225. */
  226. static String elkAddr(String profile) {
  227. switch (profile) {
  228. case (AppConstant.PROD_CODE):
  229. return ELK_PROD_ADDR;
  230. case (AppConstant.TEST_CODE):
  231. return ELK_TEST_ADDR;
  232. default:
  233. return ELK_DEV_ADDR;
  234. }
  235. }
  236. }