diff --git a/mms-zoom/.gitignore b/mms-zoom/.gitignore new file mode 100644 index 0000000..a030e74 --- /dev/null +++ b/mms-zoom/.gitignore @@ -0,0 +1,103 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# Eclipse & IntelliJ IDEA +.classpath +.settings/ +.idea +.idea/ +*.iws +*.iml +*.ipr +.settings +.project +.flattened-pom.xml + +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +.mvn/wrapper/maven-wrapper.jar + +# Gradle +.gradle +.gradle/ +build/ +**/build/ +bin/ +!src/**/build/ +gradle-app.setting +!gradle-wrapper.jar +.gradletasknamecache +gradle/wrapper/gradle-wrapper.properties + +# VS Code +.vscode/ + +# STS +.apt_generated +.factorypath +.springBeans +.sts4-cache + +# NetBeans +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +# DB +/script/db/.back_sxpcwlkj/ +/script/db/.version_sxpcwlkj/ +!/script/db/.back_sxpcwlkj/ + +.DS_Store +node_modules +/dist +package-lock.json +yarn.lock + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/mms-zoom/LICENSE b/mms-zoom/LICENSE new file mode 100644 index 0000000..5d2597d --- /dev/null +++ b/mms-zoom/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 mmsAdmin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/mms-zoom/mms-monitor/.mvn/wrapper/maven-wrapper.properties b/mms-zoom/mms-monitor/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..aeccdfd --- /dev/null +++ b/mms-zoom/mms-monitor/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.1 +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip diff --git a/mms-zoom/mms-monitor/pom.xml b/mms-zoom/mms-monitor/pom.xml new file mode 100644 index 0000000..39c0741 --- /dev/null +++ b/mms-zoom/mms-monitor/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + com.sxpcwlkj + mms-zoom + ${revision} + + jar + mms-monitor + + + + + org.springframework.boot + spring-boot-starter-web + + + de.codecentric + spring-boot-admin-starter-server + + + + + de.codecentric + spring-boot-admin-starter-client + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.projectlombok + lombok + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + + + repackage + + + + + + + + diff --git a/mms-zoom/mms-monitor/src/main/java/com/sxpcwlkj/monitor/MmsMonitorApplication.java b/mms-zoom/mms-monitor/src/main/java/com/sxpcwlkj/monitor/MmsMonitorApplication.java new file mode 100644 index 0000000..f4cc4ad --- /dev/null +++ b/mms-zoom/mms-monitor/src/main/java/com/sxpcwlkj/monitor/MmsMonitorApplication.java @@ -0,0 +1,16 @@ +package com.sxpcwlkj.monitor; + +import de.codecentric.boot.admin.server.config.EnableAdminServer; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + + +@EnableAdminServer +@SpringBootApplication +public class MmsMonitorApplication { + + public static void main(String[] args) { + SpringApplication.run(MmsMonitorApplication.class, args); + } + +} diff --git a/mms-zoom/mms-monitor/src/main/resources/application.yml b/mms-zoom/mms-monitor/src/main/resources/application.yml new file mode 100644 index 0000000..cebe4ee --- /dev/null +++ b/mms-zoom/mms-monitor/src/main/resources/application.yml @@ -0,0 +1,36 @@ +--- # SBA 服务端 +server: + # 端口 + port: 9001 +--- # Spring项目名 +spring: + application: + name: MMS Monitor + +--- # Spring Boot Admin +spring: + boot: + admin: + client: + enabled: true #启用/禁用 + instance: + service-host-type: IP + # Spring Boot Admin + url: http://localhost:9001 #监控服务器端地址 + username: admin #账号 + password: 123456 #密码 + +--- # Actuator 监控端点的配置项 +management: + endpoints: + enabled-by-default: true #暴露所有端点信息 + web: + exposure: + include: '*' #以web方式暴露 + endpoint: + health: + show-details: ALWAYS + logfile: + external-file: ./logs/monitor-console.log + + diff --git a/mms-zoom/mms-powerjob/Dockerfile b/mms-zoom/mms-powerjob/Dockerfile new file mode 100644 index 0000000..cbaca66 --- /dev/null +++ b/mms-zoom/mms-powerjob/Dockerfile @@ -0,0 +1,27 @@ +#FROM findepi/graalvm:java17-native +FROM openjdk:17.0.2-oraclelinux8 + +MAINTAINER SXPCWLKJ + +RUN mkdir -p /sxpcwlkj \ + /sxpcwlkj/mms-powerjob \ + /sxpcwlkj/mms-powerjob/logs \ + /sxpcwlkj/mms-powerjob/files \ + /sxpcwlkj/mms-powerjob/temp \ + /sxpcwlkj/mms-powerjob/skywalking/agent + +WORKDIR /sxpcwlkj/mms-powerjob + +ENV SERVER_PORT=7700 LANG=C.UTF-8 LC_ALL=C.UTF-8 JAVA_OPTS="" + +EXPOSE ${SERVER_PORT} + +ADD ./target/mms-powerjob.jar ./app.jar + +ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \ + # 应用名称 如果想区分集群节点监控 改成不同的名称即可 + #-Dskywalking.agent.service_name=sxpcwlkj-mms \ + #-javaagent:/sxpcwlkj/mms/skywalking/agent/skywalking-agent.jar \ + -jar app.jar \ + -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*,:time,tags,level -XX:+UseZGC ${JAVA_OPTS} + diff --git a/mms-zoom/mms-powerjob/pom.xml b/mms-zoom/mms-powerjob/pom.xml new file mode 100644 index 0000000..d683d45 --- /dev/null +++ b/mms-zoom/mms-powerjob/pom.xml @@ -0,0 +1,91 @@ + + + 4.0.0 + + com.sxpcwlkj + mms-zoom + ${revision} + + jar + mms-powerjob + + + 2.7.18 + 2.7.11 + + + + + org.springframework.boot + spring-boot-starter-parent + ${spring-boot.version} + pom + import + + + + + + + + + tech.powerjob + powerjob-server-starter + ${powerjob.version} + + + + + de.codecentric + spring-boot-admin-starter-client + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.projectlombok + lombok + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + ${spring-boot.version} + + + + repackage + + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar-plugin.version} + + + org.apache.maven.plugins + maven-war-plugin + ${maven-war-plugin.version} + + false + ${project.artifactId} + + + + + + + diff --git a/mms-zoom/mms-powerjob/src/main/java/com/sxpcwlkj/PowerJobServerApplication.java b/mms-zoom/mms-powerjob/src/main/java/com/sxpcwlkj/PowerJobServerApplication.java new file mode 100644 index 0000000..a119562 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/java/com/sxpcwlkj/PowerJobServerApplication.java @@ -0,0 +1,42 @@ +package com.sxpcwlkj; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.core.env.Environment; +import org.springframework.scheduling.annotation.EnableScheduling; +import tech.powerjob.server.common.utils.PropertyUtils; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +/** + * @Description TODO + * @Author sxpcwlkj + * @Version v1.0.0 + */ +@Slf4j +@EnableScheduling +@SpringBootApplication(scanBasePackages = "tech.powerjob.server") +public class PowerJobServerApplication { + public static void main(String[] args) throws UnknownHostException { + PropertyUtils.init(); +// SpringApplication.run(tech.powerjob.server.PowerJobServerApplication.class, args); + ConfigurableApplicationContext applicationContext = SpringApplication.run(tech.powerjob.server.PowerJobServerApplication.class, args); + Environment env = applicationContext.getEnvironment(); + System.out.println("PowerJob启动成功,当前环境为: " + env.getProperty("spring.profiles.active")); + log.info("\n----------------------------------------------------------\n\t" + + "Application PowerJob is running! Access URLs:\n\t" + + "Local: \t\thttp://localhost:{}\n\t" + + "External: \thttp://{}:{}\n\t" + + "Doc: \t\t{}\n" + + "----------------------------------------------------------", + + env.getProperty("server.port"), + InetAddress.getLocalHost().getHostAddress(), + env.getProperty("server.port"), + "https://www.yuque.com/powerjob/guidence/problem"); + + } +} \ No newline at end of file diff --git a/mms-zoom/mms-powerjob/src/main/resources/application-dev.properties b/mms-zoom/mms-powerjob/src/main/resources/application-dev.properties new file mode 100644 index 0000000..d8e4f2b --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/application-dev.properties @@ -0,0 +1,50 @@ +oms.env=dev + +####### Database properties(Configure according to the the environment) ####### +spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.core.jdbc-url=jdbc:mysql://113.141.95.138:3306/sxpcwlkj_mms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.username=sxpcwlkj_mms +spring.datasource.core.password=dkfa7WNTbdDJB8ny +spring.datasource.core.maximum-pool-size=20 +spring.datasource.core.minimum-idle=5 + + + +# ===== Spring Boot Admin Server ===== +spring.boot.admin.client.enabled=true +spring.boot.admin.client.instance.service-host-type=IP +spring.boot.admin.client.url=http://localhost:9001 +spring.boot.admin.client.username=admin +spring.boot.admin.client.password=123456 + +####### MongoDB properties(Non-core configuration properties) ####### +####### delete mongodb config to disable mongodb ####### +oms.mongodb.enable=false +#spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority + +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### +#spring.mail.host=smtp.163.com +#spring.mail.username= +#spring.mail.password= +#spring.mail.properties.mail.smtp.auth=true +#spring.mail.properties.mail.smtp.starttls.enable=true +#spring.mail.properties.mail.smtp.starttls.required=true + +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### +#oms.alarm.ding.app-key=dingauqwkvxxnqskknfv +#oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl +#oms.alarm.ding.agent-id=847044348 + +####### Resource cleaning properties ####### +oms.instanceinfo.retention=1 +oms.container.retention.local=1 +oms.container.retention.remote=-1 + +####### Cache properties ####### +oms.instance.metadata.cache.size=1024 + +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### +oms.accurate.select.server.percentage = 50 diff --git a/mms-zoom/mms-powerjob/src/main/resources/application-local.properties b/mms-zoom/mms-powerjob/src/main/resources/application-local.properties new file mode 100644 index 0000000..4b76ce0 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/application-local.properties @@ -0,0 +1,51 @@ +oms.env=local + +####### ???????????????????????? ####### +spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/mms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.username=root +spring.datasource.core.password=123456 +spring.datasource.core.maximum-pool-size=20 +spring.datasource.core.minimum-idle=5 + + +# ===== Spring Boot Admin Server ===== +spring.boot.admin.client.enabled=true +spring.boot.admin.client.instance.service-host-type=IP +spring.boot.admin.client.url=http://localhost:9001 +spring.boot.admin.client.username=admin +spring.boot.admin.client.password=123456 + +####### mongoDB????????????? oms.mongodb.enable=false ??? ####### +####### delete mongodb config to disable mongodb ####### +oms.mongodb.enable=false +spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-daily + +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### + +####### ?????????????????????????? ####### +#spring.mail.host=smtp.163.com +#spring.mail.username= +#spring.mail.password= +#spring.mail.properties.mail.smtp.auth=true +#spring.mail.properties.mail.smtp.starttls.enable=true +#spring.mail.properties.mail.smtp.starttls.required=true + +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### +#oms.alarm.ding.app-key=dingauqwkvxxnqskknfv +#oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl +#oms.alarm.ding.agent-id=847044348 + +####### Resource cleaning properties ####### +oms.instanceinfo.retention=1 +oms.container.retention.local=1 +oms.container.retention.remote=-1 + +####### Cache properties ####### +oms.instance.metadata.cache.size=1024 + +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### +oms.accurate.select.server.percentage = 50 diff --git a/mms-zoom/mms-powerjob/src/main/resources/application-prod.properties b/mms-zoom/mms-powerjob/src/main/resources/application-prod.properties new file mode 100644 index 0000000..0b00865 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/application-prod.properties @@ -0,0 +1,49 @@ +oms.env=prod + +####### Database properties(Configure according to the the environment) ####### +spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/sxpcwlkj_mms?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +spring.datasource.core.username=sxpcwlkj_mms +spring.datasource.core.password=dkfa7WNTbdDJB8ny +spring.datasource.core.maximum-pool-size=20 +spring.datasource.core.minimum-idle=5 + + +# ===== Spring Boot Admin Server ===== +spring.boot.admin.client.enabled=true +spring.boot.admin.client.instance.service-host-type=IP +spring.boot.admin.client.url=http://localhost:9001 +spring.boot.admin.client.username=admin +spring.boot.admin.client.password=123456 + +####### MongoDB properties(Non-core configuration properties) ####### +####### delete mongodb config to disable mongodb ####### +oms.mongodb.enable=false +#spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority + +####### Email properties(Non-core configuration properties) ####### +####### Delete the following code to disable the mail ####### +#spring.mail.host=smtp.163.com +#spring.mail.username= +#spring.mail.password= +#spring.mail.properties.mail.smtp.auth=true +#spring.mail.properties.mail.smtp.starttls.enable=true +#spring.mail.properties.mail.smtp.starttls.required=true + +####### DingTalk properties(Non-core configuration properties) ####### +####### Delete the following code to disable the DingTalk ####### +#oms.alarm.ding.app-key=dingauqwkvxxnqskknfv +#oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl +#oms.alarm.ding.agent-id=847044348 + +####### Resource cleaning properties ####### +oms.instanceinfo.retention=7 +oms.container.retention.local=7 +oms.container.retention.remote=-1 + +####### Cache properties ####### +oms.instance.metadata.cache.size=2048 + +####### Threshold in precise fetching server(0~100). 100 means full detection of server, in which ####### +####### split-brain could be avoided while performance overhead would increase. ####### +oms.accurate.select.server.percentage = 50 diff --git a/mms-zoom/mms-powerjob/src/main/resources/application.properties b/mms-zoom/mms-powerjob/src/main/resources/application.properties new file mode 100644 index 0000000..be6f7b6 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/application.properties @@ -0,0 +1,30 @@ +# Http server port +server.port=7700 +spring.application.name=MMS PowerJob +spring.profiles.active=@profiles.active@ +spring.main.banner-mode=log +spring.jpa.open-in-view=false +spring.data.mongodb.repositories.type=none +logging.level.org.mongodb=warn +logging.config=classpath:logback-plus.xml + +# Configuration for uploading files. +spring.servlet.multipart.enabled=true +spring.servlet.multipart.file-size-threshold=0 +spring.servlet.multipart.max-file-size=209715200 +spring.servlet.multipart.max-request-size=209715200 + +###### PowerJob transporter configuration ###### +oms.transporter.active.protocols=AKKA,HTTP +oms.transporter.main.protocol=HTTP +oms.akka.port=10086 +oms.http.port=10010 +# Prefix for all tables. Default empty string. Config if you have needs, i.e. pj_ +oms.table-prefix=pj_ + +# Actuator \u76D1\u63A7\u7AEF\u70B9\u7684\u914D\u7F6E\u9879 +management.endpoints.enabled-by-default=true +management.endpoints.web.exposure.include=* +management.endpoint.health.show-details=ALWAYS +management.endpoint.logfile.external-file=./logs/powerjob-console.log +management.health.mongo.enabled=${oms.mongodb.enable} diff --git a/mms-zoom/mms-powerjob/src/main/resources/banner.txt b/mms-zoom/mms-powerjob/src/main/resources/banner.txt new file mode 100644 index 0000000..c0fac79 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/banner.txt @@ -0,0 +1,11 @@ +Application Version: ${revision} +Spring Boot Version: ${spring-boot.version} + _ _ + (_) | | + _ __ _____ _____ _ __ _ ___ | |__ ______ ___ ___ _ ____ _____ _ __ +| '_ \ / _ \ \ /\ / / _ \ '__| |/ _ \| '_ \______/ __|/ _ \ '__\ \ / / _ \ '__| +| |_) | (_) \ V V / __/ | | | (_) | |_) | \__ \ __/ | \ V / __/ | +| .__/ \___/ \_/\_/ \___|_| | |\___/|_.__/ |___/\___|_| \_/ \___|_| +| | _/ | +|_| |__/ + diff --git a/mms-zoom/mms-powerjob/src/main/resources/logback-plus.xml b/mms-zoom/mms-powerjob/src/main/resources/logback-plus.xml new file mode 100644 index 0000000..e78bcf3 --- /dev/null +++ b/mms-zoom/mms-powerjob/src/main/resources/logback-plus.xml @@ -0,0 +1,34 @@ + + + + logback + + + + + + + ${console.log.pattern} + utf-8 + + + + + ${log.path}.log + + ${log.path}.%d{yyyy-MM-dd}.log + + 60 + + + ${log.pattern} + + + + + + + + + diff --git a/mms-zoom/pom.xml b/mms-zoom/pom.xml new file mode 100644 index 0000000..0025084 --- /dev/null +++ b/mms-zoom/pom.xml @@ -0,0 +1,20 @@ + + + 4.0.0 + + com.sxpcwlkj + mms + ${revision} + + pom + mms-zoom + 三方扩展模块 + + mms-powerjob + + mms-monitor + + +