LauncherConstant.java 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. /**
  68. * nacos dev 地址 215==172.31.222.127 192.168.0.109 127.0.0.1 210-=-172.30.224.81
  69. * 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
  70. */
  71. //更107服务器时打包的时候要改成192.168.0.109
  72. // 73用这个 127.0.0.1 113要用这个 10.0.0.6
  73. String NACOS_DEV_ADDR = "127.0.0.1:8848";
  74. /**
  75. * nacos prod 地址
  76. */
  77. String NACOS_PROD_ADDR = "172.30.0.48:8848";
  78. /**
  79. * nacos test 地址
  80. */
  81. String NACOS_TEST_ADDR = "172.30.0.48:8848";
  82. /**
  83. * sentinel dev 地址
  84. */
  85. String SENTINEL_DEV_ADDR = "127.0.0.1:8858";
  86. /**
  87. * sentinel prod 地址
  88. */
  89. String SENTINEL_PROD_ADDR = "172.30.0.58:8858";
  90. /**
  91. * sentinel test 地址
  92. */
  93. String SENTINEL_TEST_ADDR = "172.30.0.58:8858";
  94. /**
  95. * seata dev 地址
  96. */
  97. String SEATA_DEV_ADDR = "127.0.0.1:8091";
  98. /**
  99. * seata prod 地址
  100. */
  101. String SEATA_PROD_ADDR = "172.30.0.68:8091";
  102. /**
  103. * seata test 地址
  104. */
  105. String SEATA_TEST_ADDR = "172.30.0.68:8091";
  106. /**
  107. * zipkin dev 地址
  108. */
  109. String ZIPKIN_DEV_ADDR = "http://127.0.0.1:9411";
  110. /**
  111. * zipkin prod 地址
  112. */
  113. String ZIPKIN_PROD_ADDR = "http://172.30.0.71:9411";
  114. /**
  115. * zipkin test 地址
  116. */
  117. String ZIPKIN_TEST_ADDR = "http://172.30.0.71:9411";
  118. /**
  119. * elk dev 地址
  120. */
  121. String ELK_DEV_ADDR = "192.168.0.119:9000";
  122. /**
  123. * elk prod 地址
  124. */
  125. String ELK_PROD_ADDR = "172.30.0.72:9000";
  126. /**
  127. * elk test 地址
  128. */
  129. String ELK_TEST_ADDR = "172.30.0.72:9000";
  130. /**
  131. * seata file模式
  132. */
  133. String FILE_MODE = "file";
  134. /**
  135. * seata nacos模式
  136. */
  137. String NACOS_MODE = "nacos";
  138. /**
  139. * seata default模式
  140. */
  141. String DEFAULT_MODE = "default";
  142. /**
  143. * seata group后缀
  144. */
  145. String GROUP_NAME = "-group";
  146. /**
  147. * seata 服务组格式
  148. *
  149. * @param appName 服务名
  150. * @return group
  151. */
  152. static String seataServiceGroup(String appName) {
  153. return appName.concat(GROUP_NAME);
  154. }
  155. /**
  156. * 动态获取nacos地址
  157. *
  158. * @param profile 环境变量
  159. * @return addr
  160. */
  161. static String nacosAddr(String profile) {
  162. switch (profile) {
  163. case (AppConstant.PROD_CODE):
  164. return NACOS_PROD_ADDR;
  165. case (AppConstant.TEST_CODE):
  166. return NACOS_TEST_ADDR;
  167. default:
  168. return NACOS_DEV_ADDR;
  169. }
  170. }
  171. /**
  172. * 动态获取sentinel地址
  173. *
  174. * @param profile 环境变量
  175. * @return addr
  176. */
  177. static String sentinelAddr(String profile) {
  178. switch (profile) {
  179. case (AppConstant.PROD_CODE):
  180. return SENTINEL_PROD_ADDR;
  181. case (AppConstant.TEST_CODE):
  182. return SENTINEL_TEST_ADDR;
  183. default:
  184. return SENTINEL_DEV_ADDR;
  185. }
  186. }
  187. /**
  188. * 动态获取seata地址
  189. *
  190. * @param profile 环境变量
  191. * @return addr
  192. */
  193. static String seataAddr(String profile) {
  194. switch (profile) {
  195. case (AppConstant.PROD_CODE):
  196. return SEATA_PROD_ADDR;
  197. case (AppConstant.TEST_CODE):
  198. return SEATA_TEST_ADDR;
  199. default:
  200. return SEATA_DEV_ADDR;
  201. }
  202. }
  203. /**
  204. * 动态获取zipkin地址
  205. *
  206. * @param profile 环境变量
  207. * @return addr
  208. */
  209. static String zipkinAddr(String profile) {
  210. switch (profile) {
  211. case (AppConstant.PROD_CODE):
  212. return ZIPKIN_PROD_ADDR;
  213. case (AppConstant.TEST_CODE):
  214. return ZIPKIN_TEST_ADDR;
  215. default:
  216. return ZIPKIN_DEV_ADDR;
  217. }
  218. }
  219. /**
  220. * 动态获取elk地址
  221. *
  222. * @param profile 环境变量
  223. * @return addr
  224. */
  225. static String elkAddr(String profile) {
  226. switch (profile) {
  227. case (AppConstant.PROD_CODE):
  228. return ELK_PROD_ADDR;
  229. case (AppConstant.TEST_CODE):
  230. return ELK_TEST_ADDR;
  231. default:
  232. return ELK_DEV_ADDR;
  233. }
  234. }
  235. }