commit e56802a575f796e20746b7a4272f8434e48e50c9 Author: athena-demo <> Date: Wed Apr 26 18:53:58 2023 +0800 Initial commit diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..83048ab --- /dev/null +++ b/.drone.yml @@ -0,0 +1,105 @@ +kind: pipeline +type: docker +name: CI Process +steps: + ### 打包应用代码和资源 + - name: Maven Package + image: maven:3.5.3-jdk-8 + environment: + # 应用专案名称(需手动修改) + backendName: app-code_backend + # 平台API版本号(需手动修改) + apiVersion: 5.2.0.1005 + commands: + # 在开发根目录下执行 maven package 指令以构建运行包 + - mvn -f $backendName/pom.xml package -Dapi.version=$apiVersion -Dnexus.ip=https://repo.digiwincloud.com.cn/maven + - mkdir -p $backendName/running + # 将构建出来的文件复制到用于放置运行包的 running 目录下 + # 注意:此处将运行包放到 running 目录只是暂存,还需要在 Dockerfile-drone 中再把 running 下的文件复制到 Docker 容器的工作目录下 + - cp -r $backendName/develop/target/$backendName/* $backendName/running + volumes: + - name: cache # The Volume's name + path: /root/.m2 # The path in the container + when: + status: [ success ] + branch: + # - develop + # - master + - release/S1 + event: + - push + ### 应用版本控制:检查版本文件,若不存在则自动创建,并自动递增版本号 + - name: Version Control + image: registry.digiwincloud.com.cn/base/base_vc + environment: + # 应用专案名称(需手动修改) + backendName: app-code_backend + commands: + - sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories + - apk add tree --no-cache + - tree ./$backendName + - make branch=release/S1 vc + # - make branch=master vc + when: + status: [ success ] + branch: + # - develop + # - master + - release/S1 + event: + - push + ### 打包镜像并推送到镜像仓库 + - name: Package Docker Image & Push + image: plugins/docker:20.10.9 + environment: + # 应用专案名称(需手动修改) + backendName: app-code_backend + ## Docker 插件的设置 + settings: + insecure: true + username: + from_secret: dockerUsername + password: + from_secret: dockerPassword + # 注意:此处不支持用取值符号获取参数,需要手动修改。${appId} 表示应用ID,${projectName} 表示仓库项目名称,${platformVersion} 表示平台版本号 + # 例如:registry.digiwincloud.com.cn/sampleapp1/sampleapp1backend-5.0.1 注意APPID和backend中间没有下划线 + # repo: registry.digiwincloud.com.cn/${projectName}/${appId}backend-${platformVersion} + repo: registry.digiwincloud.com.cn/athenaopt/app-codebackend-5.2.0 + registry: registry.digiwincloud.com.cn + experimental: true + # 打包镜像时会用到的 Dockerfile 文件(此处使用自定义 Dockerfile 文件名,避免跟其他 Dockerfile 冲突) + dockerfile: Dockerfile + # 将环境变量传递给 Docker 镜像 + build_args_from_env: backendName + when: + status: [ success ] + branch: + # - develop + # - master + - release/S1 + ### 应用版本控制:提交版本文件的修改记录,并为代码分支创建版本号标签 + - name: Upload Version + image: registry.digiwincloud.com.cn/base/base_vc + commands: + # - make branch=develop to_git + # - make branch=master to_git + - make branch=release/S1 to_git + when: + status: [ success ] + branch: + # - develop + # - master + - release/S1 + event: + - push +trigger: + branch: + # - develop + # - master + - release/S1 + event: + - push +volumes: + - name: cache + host: + path: /data/drone/var/lib/cache/maven \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..514592c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/.idea/ +*.iml +*.pid +/platform/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dc063fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# syntax=docker/dockerfile:experimental +# 全局參數 +#ENV WORKSPACE=TheValueWillPassFromJenkinsDockerBuild +# 从 Drone 传递过来即可,不需要手动修改 +# backendName對應到POM中的artifactId +ARG backendName=app-code_backend +ARG runningPath=${backendName}/running +# ***** 打包docker image ***** +FROM registry.digiwincloud.com.cn/dwsidecar/dwsidecar-1.0.0.0:1.0.0.33 +ARG backendName +ARG runningPath +# 把運行文件夾下的所有文件複製到 image 中 +# Drone 已将运行包复制到 running 目录下,此处将 running 目录下的文件复制到 Docker 容器的工作目录下 +COPY ${runningPath} /${backendName} +WORKDIR /${backendName} +RUN pwd +RUN ls +RUN chmod +x ./platform/bin/run.sh \ + && chmod +x ./platform/bin/stop.sh \ + && chmod +x ./platform/bin/docker/dockerEnv.sh \ + && chmod +x ./platform/bin/docker/dockerEnvReplace.sh \ + && chmod +x ./platform/bin/docker/dockerRun.sh +EXPOSE 22620 +ENTRYPOINT ["/app-code_backend/platform/bin/docker/dockerRun.sh"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7a4e7d7 --- /dev/null +++ b/Makefile @@ -0,0 +1,56 @@ +# 需修改的參數 +# registry group 名稱 +GROUP_ID=athenaopt +## app id +APP_ID=app-code +## app 名稱 +APP_NAME=app-code +## 平台版本 +PLATFORM_VERSION=5.2.0 +## dap 平台類別,前端就是 frontend, 後端就是 backend +DAP_TYPE=backend +## registry 位置 +DOCKER_REGISTRY_URL=registry.digiwincloud.com.cn + + +SHELL=/bin/bash + +# make 指令 +MAKE=make +# maven 指令 +MAVEN=mvn +MAVEN_CLEAN=$(MAVEN) clean +MAVEN_PACKAGE=$(MAVEN) -f pom.xml package + +#docker +DOCKER_CMD=docker +DOCKER_BUILD=$(DOCKER_CMD) build +DOCKER_RM_IMAGE=$(DOCKER_CMD) rmi +DOCKER_PUSH=$(DOCKER_CMD) push +DOCKER_IMAGE_REGISTRY=$(DOCKER_REGISTRY_URL)/$(GROUP_ID)/ +DOCKER_IMAGE_NAME=$(APP_NAME)$(DAP_TYPE)-$(PLATFORM_VERSION) +DOCKER_FULL_IMAGE=$(DOCKER_IMAGE_REGISTRY)$(DOCKER_IMAGE_NAME):$(VERSION).$(shell cat $(SUB_VERSION_FILE)) +#打包 +VERSION:=$(shell cat VERSION) +#版本控制 +SUB_VERSION_FILE=./version_control/BUILD + +all: docker_ci +clean: + $(MAVEN_CLEAN) -f pom.xml +package: + $(MAVEN_PACKAGE) -f pom.xml +docker_build: + @echo "開始打包 Docker Image - $(DOCKER_FULL_IMAGE)" + DOCKER_BUILDKIT=1 $(DOCKER_BUILD) -t $(DOCKER_FULL_IMAGE) . +docker_push: + @echo "開始 push docker image - $(DOCKER_FULL_IMAGE)" + $(DOCKER_PUSH) $(DOCKER_FULL_IMAGE) +docker_clean: + $(DOCKER_RM_IMAGE) $(DOCKER_FULL_IMAGE) +docker_ci: vc docker_build docker_push docker_clean to_git +vc: + @make -C version_control branch=$$branch +to_git: + @make -C version_control branch=$$branch commit_record + @make -C version_control branch=$$branch add_tag diff --git a/README.md b/README.md new file mode 100644 index 0000000..4f87ebe --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# app-code + diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/app-code_backend/.gitignore b/app-code_backend/.gitignore new file mode 100644 index 0000000..a76f2b4 --- /dev/null +++ b/app-code_backend/.gitignore @@ -0,0 +1,9 @@ +/.idea/ +/develop/jdk/ +/running/ +/tool/ +/develop/conf_dev/ +/develop/conf-dev/ +/develop/target/ +/develop/src/test/reqJson/ +*.iml diff --git a/app-code_backend/develop/conf/application.properties b/app-code_backend/develop/conf/application.properties new file mode 100644 index 0000000..ac0597d --- /dev/null +++ b/app-code_backend/develop/conf/application.properties @@ -0,0 +1,95 @@ +appId=app-code +configCenterUrl=@configCenterUrl@ +configPolicy=@configPolicy@ +isRemoteConfigOn=@isRemoteConfigOn@ +isGroupConfigOn=@isGroupConfigOn@ +configGroup=@configGroup@ +#APPIMAGENAME=@APPIMAGENAME@ +#PLATFORM=@PLATFORM@ +#SMALLVERSION=@SMALLVERSION@ +#springConfigFileNames=xxx.xml,xxx.xml +iamApToken=@iamApToken@ +dmcUserName=@dmcUserName@ +dmcPwd=@dmcPwd@ +dmcBucketName=@dmcBucketName@ +eaiRestfulUrl=@eaiRestfulUrl@ +eaiExceptionHandler=@eaiExceptionHandler@ +eaiUrl=@eaiUrl@ +eaiHostProdIsStandardProduct=@eaiHostProdIsStandardProduct@ +eaiAutoRegistrationEnable=true +eaiHostUid=@eaiHostUid@ +eaiHostProd=@eaiHostProd@ +eaiHostId=@eaiHostId@ +eaiRestfulCustomId=@eaiRestfulCustomId@ +dbUrl=@dbUrl@ +dbUsername=@dbUsername@ +dbPassword=@dbPassword@ +scheduleEmailUsername=@scheduleEmailUsername@ +scheduleEmailPassword=@scheduleEmailPassword@ +scheduleEmailPort=@scheduleEmailPort@ +scheduleEmailSmtpHost=@scheduleEmailSmtpHost@ +scheduleRemoteInvocation=@scheduleRemoteInvocation@ +isScheduleJsonOutput=@isScheduleJsonOutput@ +thisDapUrl=@thisDapUrl@ +serverPort=@serverPort@ +tenantColumnname=@tenantColumnname@ +hybridCloudSaasUrl=@hybridCloudSaasUrl@ +#hybridCloudUrlSaas{apName} +#OtherDapUrl{apName} +#dao setting +dwdaoCalculateMaxSeqFieldName=@dwdaoCalculateMaxSeqFieldName@ +dwdaoCalculateMaxSeqEnabled=@dwdaoCalculateMaxSeqEnabled@ +dwdaoSelectVersionFieldEnabled=@dwdaoSelectVersionFieldEnabled@ +#custom sql filter chain +#example - false:com.digiwin.app.dao.filter.DWSQLManagementFieldFilter, +dwsqlFilterChianCustom=@dwsqlFilterChianCustom@ +#management field enabled +mgmtFieldEnabled=false +#management field resolver class name +#dap default resolver = com.digiwin.app.dao.filter.DWProfileManagementFieldResolver +mgmtFieldResolver=com.digiwin.app.dao.filter.DWProfileManagementFieldResolver +#management fields mappings +#example - DATA_CREATED_BY:userId,DATA_MODIFY_BY:userId +mgmtFieldInsertMappings=create_by:userId,create_date:$DATETIME +mgmtFieldUpdateMappings=modified_by:userId,modified_date:$DATETIME +mgmtFieldIgnoreCustomValue=false +#Log file name id: Ex. Windows:_${env:COMPUTERNAME} Linux:_${env:HOSTNAME} +logFileIdentifier=@logFileIdentifier@ +#\u9810\u8a2d\u503c\u5c07\u5728\u7570\u5e38\u56de\u61c9\u88e1\u8f38\u51faDebugInfo\u5b57\u6bb5\uff0c\u8a2d\u5b9a\u70bafalse\u503c\u8868\u793a\u4e0d\u8f38\u51fa\u8a72\u5b57\u6bb5 +dwExceptionOutputDebugInfo=@dwExceptionOutputDebugInfo@ +#\u662f\u5426\u555f\u7528\u670d\u52d9\u8abf\u7528\u934aSession Id\u8a18\u9304\u529f\u80fd\uff0c\u8a2d\u5b9atrue\u8868\u793a\u555f\u7528 +dwServiceChainEnabled=@dwServiceChainEnabled@ +#\u670d\u52d9\u8abf\u7528\u934a\u81ea\u8a02Id +dwServiceChainCustomId=@dwServiceChainCustomId@ +#\u670d\u52d9\u8abf\u7528\u934a\u63a5\u6536\u4fe1\u606f\u6642\u6253\u5370\u5668\u985e\u578b +dwServiceChainReceivedPrinterType=@dwServiceChainReceivedPrinterType@ +#DWJson enable empty string to null +dwJsonEmptyStrToNullEnabled=@dwJsonEmptyStrToNullEnabled@ +#DWDao underscore-to-camel-case setting +dwDaoUnderScoreToCamelCase=@dwDaoUnderScoreToCamelCase@ +#DWMq +dwMqEnabled=@dwMqEnabled@ +dwMqProtocol=@dwMqProtocol@ +dwMqHost=@dwMqHost@ +dwMqPort=@dwMqPort@ +dap.json.date-time-format=@dapJsonDateTimeFormat@ +dap.json.number-processor-name=default +dap.container.local.matcher.one-param=true +spring.servlet.multipart.max-file-size=5Mb +spring.servlet.multipart.max-request-size=5Mb +#spring.rabbitmq.uri=amqp://athena:athena@192.168.137.10/athena +spring.rabbitmq.uri=@spring.rabbitmq.uri@ +# ESP-SDk +#domain.km=https://knowledgemaps-test.apps.digiwincloud.com.cn +domain.km=@domain.km@ +#domain.esp=https://esp-test.apps.digiwincloud.com.cn +domain.esp=@domain.esp@ +#domain.mdc=https://esp-test.apps.digiwincloud.com.cn +domain.mdc=@domain.mdc@ +#domain.eoc=https://eoc-test.digiwincloud.com.cn +domain.eoc=@domain.eoc@ +#domain.lmc=https://lmc-test.digiwincloud.com.cn +domain.lmc=@lmcUrl@ + +opt.mybatisPlus.enable=true + diff --git a/app-code_backend/develop/conf/log4j2.xml b/app-code_backend/develop/conf/log4j2.xml new file mode 100644 index 0000000..f8454c8 --- /dev/null +++ b/app-code_backend/develop/conf/log4j2.xml @@ -0,0 +1,72 @@ + + + + %d{yyyy/MM/dd HH:mm:ss} %-5p [%X{traceId}] %m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app-code_backend/develop/conf/platform.properties b/app-code_backend/develop/conf/platform.properties new file mode 100644 index 0000000..7832d49 --- /dev/null +++ b/app-code_backend/develop/conf/platform.properties @@ -0,0 +1,182 @@ +#Compatible Parameter +appName=${appId} +spring.application.name=${appId} +spring.profiles.active=${httpRequestFilters:} + +#IAM +iamUrl=@iamUrl@ +iamContentType=application/json +iamCharset=UTF-8 +iamSoTimeout=@iamSoTimeout@ +iamHttpConnectionPoolRequestTimeout=@iamHttpConnectionPoolRequestTimeout@ +iamEncode=UTF-8 +iamHttpConnectionTimeout=@iamHttpConnectionTimeout@ +iamUrlUsertokenAnalyze=/api/iam/v2/identity/token/analyze +iamHttpMaxConnections=@iamHttpMaxConnections@ +iamKeepAliveTimeout=@iamKeepAliveTimeout@ +iamUrlLogin=/api/iam/v2/identity/login +iamUrlUser=/api/iam/v2/user +iamUrlPathPermissionRootTarget=drn:iam:app:{appId}:webmodule:menu:{appId} +iamUrlAppRootTarget=drn:iam:app:{appId} +iamUrlUpdateModule=/api/iam/v2/app/module/update +iamUrlUserPermission=/api/iam/v2/permission/user/all +iamUrlUpdateAction=/api/iam/v2/app/action/update +iamUrlGetApp=/api/iam/v2/app +iamUrlUpdateCondition=/api/iam/v2/app/condition/update +iamUrlRemoveCondition=/api/iam/v2/app/condition/remove +iamUrlDisableAction=/api/iam/v2/app/action/disable +iamUrlOrgAspect=/api/iam/v2/org/aspect +iamUrlOrgUserinorg=/api/iam/v2/org/userinorg +iamUrlUserTenantApplication=/api/iam/v2/user/tenant/application +iamUrlUserAllInfo=/api/iam/v2/query/user/allinfo +#CAC +cacUrl=@cacUrl@ + +#LMC +lmcUrl=@lmcUrl@ + +#DMC +dmcUrl=@dmcUrl@ + +#DWMq +dwMqBasic=ZGlnaXdpbjpkaWdpd2lu + +#Queue 1.0 +queueTenantProcessorHost=@queueTenantProcessorHost@ +queueTenantTlsOn=@queueTenantTlsOn@ +#queueSaasRabbitmqIsHttps=@queueSaasRabbitmqIsHttps@ +queueSaasRabbitmqHost=@queueSaasRabbitmqHost@ +queueSaasRabbitmqAmqpPort=@queueSaasRabbitmqAmqpPort@ +queueSaasRabbitmqHttpPort=@queueSaasRabbitmqHttpPort@ +queueSaasRabbitmqUsername=@queueSaasRabbitmqUsername@ +queueSaasRabbitmqPassword=@queueSaasRabbitmqPassword@ +queueSaasTlsOn=@queueSaasTlsOn@ + +#MQTT +mqttSrvHost=@mqttSrvHost@ +mqttSrvUsername=@mqttSrvUsername@ +mqttSrvPassword=@mqttSrvPassword@ +mqttSrvClientId=@mqttSrvClientId@ +mqttSrvCleanSession=@mqttSrvCleanSession@ +mqttSrvReconnect=@mqttSrvReconnect@ +mqttTopicQos=@mqttTopicQos@ +mqttTopicRetained=@mqttTopicRetained@ +mqttSrvConnectTimeout=@mqttSrvConnectTimeout@ +mqttWaitForCompletion=@mqttWaitForCompletion@ + +#EAI +eaiHostRetrytimes=@eaiHostRetrytimes@ +eaiHostVer=@eaiHostVer@ +eaiHostRetryinterval=@eaiHostRetryinterval@ +eaiHostConcurrence=@eaiHostConcurrence@ +eaiUrlRegSrv=/CROSS/RESTful/regSrv + +#database +dbEnabled=@dbEnabled@ +jdbcDriverClassName=@jdbcDriverClassName@ +dbConnectionMaxWaitMillis=@dbConnectionMaxWaitMillis@ +dbConnectionInitialSize=@dbConnectionInitialSize@ +dbConnectionMaxTotal=@dbConnectionMaxTotal@ +dbConnectionMinIdle=@dbConnectionMinIdle@ + +#Servlet container +httpRequestFilters=@httpRequestFilters@ +serverHttpControllerIo=@serverHttpControllerIo@ +serverType=tomcat +serverAsyncTimeout=@serverAsyncTimeout@ +serverTomcatAcceptCount=@serverTomcatAcceptCount@ +serverTomcatMaxConnections=@serverTomcatMaxConnections@ +serverTomcatMinSpareThreads=@serverTomcatMinSpareThreads@ +serverTomcatMaxThreads=@serverTomcatMaxThreads@ +serverHttpTokenmode=@serverHttpTokenmode@ +accessControlAllowOrigin=* +accessControlAllowMethods=POST,PUT,GET,DELETE +accessControlMaxAge=@accessControlMaxAge@ +accessControlAllowHeaders=Content-Type,token,accesstoken,digi-middleware-auth-app,Program-Code,Module-Name,origin-iam-url-key,locale,Accept-Language,routerKey +serverTokenExpiredTime=@serverTokenExpiredTime@ + + +#DAP Spring config +platformSpringConfigFileNames= + + +#Spring boot setting +spring.mvc.throw-exception-if-no-handler-found=true +spring.resources.add-mappings=false + +#Spring boot server +server.tomcat.additional-tld-skip-patterns=*mchange-commons-java*.jar +server.max-http-header-size=@server.max-http-header-size@ + +#Spring boot log +logging.config=classpath:log4j2.xml + +#Spring boot cache +spring.redis.database=@spring.redis.database@ +spring.redis.host=@spring.redis.host@ +spring.redis.port=@spring.redis.port@ +spring.redis.password=@spring.redis.password@ +spring.redis.timeout=@spring.redis.timeout@ + +spring.redis.pool.max-active=@spring.redis.pool.max-active@ +spring.redis.pool.max-wait=@spring.redis.pool.max-wait@ +spring.redis.pool.max-idle=@spring.redis.pool.max-idle@ +spring.redis.pool.min-idle=@spring.redis.pool.min-idle@ + +spring.redis.lettuce.pool.max-active=@spring.redis.lettuce.pool.max-active@ +spring.redis.lettuce.pool.max-wait=@spring.redis.lettuce.pool.max-wait@ +spring.redis.lettuce.pool.max-idle=@spring.redis.lettuce.pool.max-idle@ +spring.redis.lettuce.pool.min-idle=@spring.redis.lettuce.pool.min-idle@ +spring.redis.lettuce.shutdown-timeout=@spring.redis.lettuce.shutdown-timeout@ + +#Cache +keyExpiredTime=@keyExpiredTime@ + +#K8S service proxy +k8sProxyUrl=@k8sProxyUrl@ +k8sProxyContentType=application/json +k8sProxyCharset=UTF-8 +k8sProxyEncode=UTF-8 +k8sProxyHttpConnectionPoolRequestTimeout=@k8sProxyHttpConnectionPoolRequestTimeout@ +k8sProxyHttpMaxConnections=@k8sProxyHttpMaxConnections@ +k8sProxyHttpConnectionTimeout=@k8sProxyHttpConnectionTimeout@ +k8sProxySoTimeout=@k8sProxySoTimeout@ + +#Schedule +scheduleEnabled=@scheduleEnabled@ +scheduleEmailTypeOfConnection=0 + +#Quartz +org.quartz.dataSource.quartzDataSource.connectionProvider.class=com.digiwin.app.schedule.quartz.DWQuartzPoolingConnectionProvider +org.quartz.jobStore.useProperties=false +org.quartz.scheduler.instanceId=AUTO +org.quartz.dataSource.quartzDataSource.testConnectionOnCheckout=true +org.quartz.plugin.DWJobInterruptListener.class=com.digiwin.app.schedule.quartz.listener.DWJobInterruptListener +org.quartz.dataSource.quartzDataSource.testConnectionOnCheckin=false +org.quartz.jobStore.tablePrefix=QRTZ_ +org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool +org.quartz.dataSource.quartzDataSource.preferredTestQuery=SELECT 1 +org.quartz.jobStore.dataSource=quartzDataSource +org.quartz.scheduler.instanceName=DigiwinQuartzScheduler +org.quartz.jobStore.isClustered=true +org.quartz.dataSource.quartzDataSource.maxPoolSize=@org.quartz.dataSource.quartzDataSource.maxPoolSize@ +org.quartz.dataSource.quartzDataSource.idleConnectionTestPeriod=@org.quartz.dataSource.quartzDataSource.idleConnectionTestPeriod@ +org.quartz.dataSource.quartzDataSource.maxIdleTimeExcessConnections=@org.quartz.dataSource.quartzDataSource.maxIdleTimeExcessConnections@ +org.quartz.threadPool.threadCount=@org.quartz.threadPool.threadCount@ +org.quartz.dataSource.quartzDataSource.acquireIncrement=@org.quartz.dataSource.quartzDataSource.acquireIncrement@ +org.quartz.threadPool.threadPriority=@org.quartz.threadPool.threadPriority@ +org.quartz.dataSource.quartzDataSource.minPoolSize=@org.quartz.dataSource.quartzDataSource.minPoolSize@ +org.quartz.jobStore.clusterCheckinInterval=@org.quartz.jobStore.clusterCheckinInterval@ + +#Tenant +tenantEnabled=@tenantEnabled@ + +#Fine report +frUrl=@frUrl@ +frUrlKanbanUrlInfo=/digiwin/KanbanUrlInfo +frUrlKanbanUserInfoSyncInit=/digiwin/kanban/view/form?op=fr_base&cmd=evaluate_formula&expression=updateuser10() + +#\u79fb\u52d5\u521d\u59cb\u5316\u793e\u5340 +mobileUrl=@mobileUrl@ +mobileApiInit=@mobileApiInit@ + diff --git a/app-code_backend/develop/conf/readme.md b/app-code_backend/develop/conf/readme.md new file mode 100644 index 0000000..244c204 --- /dev/null +++ b/app-code_backend/develop/conf/readme.md @@ -0,0 +1,22 @@ +[開發工具-簡易式模版-配置資源 有下列文件] +---------------------------------------------------- +A.應用層 + 1.application.properties + 2.spring-application.xml +B.平台層 + 1.platform.properties + 2.log4j2.xml + 3.service-retry-config-platform.json +==================================================== + + +[上述文件在平台打包開發包時, 會從模組化運行包中複製] +---------------------------------------------------- + A.1. 從運行包路徑下 application\conf 複製 + A.2. 從運行包路徑下 application\conf 複製 + B.1. 從運行包路徑下 platform\conf 複製 + B.2. 從運行包路徑下 platform\conf 複製 + B.3. 從運行包路徑下 platform\conf 複製 + service-retry-config.json 更名為 + service-retry-config-platform.json +==================================================== \ No newline at end of file diff --git a/app-code_backend/develop/conf/service-retry-config-platform.json b/app-code_backend/develop/conf/service-retry-config-platform.json new file mode 100644 index 0000000..59785b6 --- /dev/null +++ b/app-code_backend/develop/conf/service-retry-config-platform.json @@ -0,0 +1,23 @@ +[ + { + "appId": "iam", + "enable": true, + "paths": [ + { + "path": "/**/identity/token/analyze", + "enable": true, + "retry": { + "retries": 3, + "statuses": "502", + "methods": "POST", + "backoff": { + "type": "simple", + "firstBackoff": "500", + "maxBackoff": "50000", + "factor": 2 + } + } + } + ] + } +] \ No newline at end of file diff --git a/app-code_backend/develop/conf/spring-application.xml b/app-code_backend/develop/conf/spring-application.xml new file mode 100644 index 0000000..d7992e1 --- /dev/null +++ b/app-code_backend/develop/conf/spring-application.xml @@ -0,0 +1,20 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app-code_backend/develop/lang/message-application.properties b/app-code_backend/develop/lang/message-application.properties new file mode 100644 index 0000000..e69de29 diff --git a/app-code_backend/develop/lang/message-application_zh.properties b/app-code_backend/develop/lang/message-application_zh.properties new file mode 100644 index 0000000..e69de29 diff --git a/app-code_backend/develop/lang/message-application_zh_CN.properties b/app-code_backend/develop/lang/message-application_zh_CN.properties new file mode 100644 index 0000000..e69de29 diff --git a/app-code_backend/develop/lang/message-application_zh_TW.properties b/app-code_backend/develop/lang/message-application_zh_TW.properties new file mode 100644 index 0000000..e69de29 diff --git a/app-code_backend/develop/lib/readme.md b/app-code_backend/develop/lib/readme.md new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/app-code_backend/develop/lib/readme.md @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app-code_backend/develop/platform/bin/docker/dap-config-value-replacer.jar b/app-code_backend/develop/platform/bin/docker/dap-config-value-replacer.jar new file mode 100644 index 0000000..5d4d0ad Binary files /dev/null and b/app-code_backend/develop/platform/bin/docker/dap-config-value-replacer.jar differ diff --git a/app-code_backend/develop/platform/bin/docker/dockerEnv.sh b/app-code_backend/develop/platform/bin/docker/dockerEnv.sh new file mode 100644 index 0000000..7c688f2 --- /dev/null +++ b/app-code_backend/develop/platform/bin/docker/dockerEnv.sh @@ -0,0 +1,69 @@ +#!/bin/sh + +function log_info() +{ + local date=`date` + local para=$1 + echo "$date $1" + $1 + echo "log info:$date $1" &>> $SYS_LOG +} +SYS_LOG=dockerEnv.log + +if [ "$isSidecarEnable" != "" ]; then + if [ "$isSidecarEnable" != "false" ]; then + + export tsidecarPort=$sidecarPort + export tserverPort=$serverPort + + export sidecarPort=$tserverPort + export serverPort=$tsidecarPort + else + echo "isSidecarEnable=false"> isSidecarEnable.txt + fi +else + echo "isSidecarEnable="> isSidecarEnable.txt +fi + +#程式路徑 +Path=$1 +#檔案類型 +TypeName=$2 +#排除檔案 +removeName=$3 +#排除檔案2 +removeName2=$4 +#排除檔案3 +removeName3=$5 +#排除檔案4 +removeName4=$6 + +#修改方法一 +find $Path/ -name "*.$TypeName" -a ! -name "$removeName1" -a ! -name "$removeName2" -a ! -name "$removeName3" -a ! -name "$removeName4" | xargs grep -r '@' > envSpace.txt + +sed 's/[[:space:]]//g' envSpace.txt > env.txt +envDate=$(cat env.txt) + +#迴圈解析@ +for date in ${envDate}; do + #echo $date + field=2 + env=test + filePath=$(cut -d':' -f1 <<< "$date") + #echo $filePath + while [[ "$env" != "" ]]; do + env=$(cut -d'@' -f$field <<< "$date") + let "field+=2" + if [ "$env" != "" ]; then + #修改方法二 + envReplace=${env//./_} + envReplace=${envReplace//-/DH} + log_info "sed -i s#@"$env"@#"$(eval echo \$$envReplace)"#g $filePath" + fi + done +done + + +rm -f envSpace.txt +rm -f env.txt + diff --git a/app-code_backend/develop/platform/bin/docker/dockerEnvReplace.sh b/app-code_backend/develop/platform/bin/docker/dockerEnvReplace.sh new file mode 100644 index 0000000..806326b --- /dev/null +++ b/app-code_backend/develop/platform/bin/docker/dockerEnvReplace.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# dockerEnv.sh 參數 +## 1. 掃描參數的資料夾 +## 2. 掃描的檔案類型 +## 3. 要排除掃描的檔案名稱 + +jarLocation=./platform/bin/docker/dap-config-value-replacer.jar +java -jar $jarLocation ./platform/bin sh dockerEnvReplace.sh dockerEnv.sh dockerRun.sh +java -jar $jarLocation /jmx properties +java -jar $jarLocation ./conf xml +java -jar $jarLocation ./conf properties +java -jar $jarLocation ./lang properties \ No newline at end of file diff --git a/app-code_backend/develop/platform/bin/docker/dockerRun.sh b/app-code_backend/develop/platform/bin/docker/dockerRun.sh new file mode 100644 index 0000000..3fc4455 --- /dev/null +++ b/app-code_backend/develop/platform/bin/docker/dockerRun.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +bash ./platform/bin/docker/dockerEnvReplace.sh +bash /setup/setup_time.sh +bash /jmx/start_monitor_jmx.sh +cd ./platform/bin/ +sh run.sh diff --git a/app-code_backend/develop/platform/bin/run.bat b/app-code_backend/develop/platform/bin/run.bat new file mode 100644 index 0000000..ad207f0 --- /dev/null +++ b/app-code_backend/develop/platform/bin/run.bat @@ -0,0 +1,8 @@ +cd .. +cd .. +SET CLASSPATH=./*;./lib/*;./conf;./lang +SET PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_131\bin +java -cp %CLASSPATH% com.digiwin.simplified.app.test.DWSimplifiedModeMyApp + +REM java -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:18085 sampleapp1_backend-5.0.1.2000.jar +REM java -jar sampleapp1_backend-5.0.1.2000.jar \ No newline at end of file diff --git a/app-code_backend/develop/platform/bin/run.sh b/app-code_backend/develop/platform/bin/run.sh new file mode 100644 index 0000000..d93c7ac --- /dev/null +++ b/app-code_backend/develop/platform/bin/run.sh @@ -0,0 +1,25 @@ +#!/bin/sh +cd .. +cd .. +#Backend/ +WORKDIR=`pwd` +export WORKDIR + +CLASSPATH=.:$WORKDIR:$WORKDIR/lib/*:$WORKDIR/conf:$WORKDIR/lang +export CLASSPATH + +MAINCLASS=@mainClass@ +export MAINCLASS + +sh /dwsidecar/sidecar/bin/docker/dockerRun.sh & + +if test -z "$pinpoint_appname"; +then + java -cp $CLASSPATH @jvmArgs@ $MAINCLASS +else + export AGENT_PATH=/agent_pinpoint/pinpoint-bootstrap.jar + export AGENT_NAME=$pinpoint_appname + export AGENT_ID=$pinpoint_id + export AGENT_OPTS="-javaagent:$AGENT_PATH -Dpinpoint.agentId=$AGENT_ID -Dpinpoint.applicationName=$AGENT_NAME" + java $AGENT_OPTS -cp $CLASSPATH @jvmArgs@ $MAINCLASS +fi diff --git a/app-code_backend/develop/platform/bin/runEncrypt.bat b/app-code_backend/develop/platform/bin/runEncrypt.bat new file mode 100644 index 0000000..579a408 --- /dev/null +++ b/app-code_backend/develop/platform/bin/runEncrypt.bat @@ -0,0 +1,5 @@ +cd .. +cd .. +SET CLASSPATH=./;./platform/lib/*;./platform/conf;./platform/lang +SET PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_131\bin +java -cp %CLASSPATH% com.digiwin.app.common.launcher.DWXClassLauncher --xclass.mainclass=com.digiwin.gateway.DWApiGatewayApplication --xclass.password=@classPassword@ \ No newline at end of file diff --git a/app-code_backend/develop/platform/bin/runEncrypt.sh b/app-code_backend/develop/platform/bin/runEncrypt.sh new file mode 100644 index 0000000..280a427 --- /dev/null +++ b/app-code_backend/develop/platform/bin/runEncrypt.sh @@ -0,0 +1,22 @@ +#!/bin/sh +cd .. +cd .. +#Backend/ +WORKDIR=`pwd` +export WORKDIR +CLASSPATH=.:$WORKDIR:$WORKDIR/application/lib/*:$WORKDIR/application/conf:$WORKDIR/application/lang +export CLASSPATH + +MAINCLASS=@mainClass@ +export MAINCLASS + +if test -z "$pinpoint_appname"; +then + java -cp $CLASSPATH @jvmArgs@ com.digiwin.app.common.launcher.DWXClassLauncher --xclass.mainclass=com.digiwin.gateway.DWApiGatewayApplication --xclass.password=@classPassword@ +else + export AGENT_PATH=/agent_pinpoint/pinpoint-bootstrap.jar + export AGENT_NAME=$pinpoint_appname + export AGENT_ID=$pinpoint_id + export AGENT_OPTS="-javaagent:$AGENT_PATH -Dpinpoint.agentId=$AGENT_ID -Dpinpoint.applicationName=$AGENT_NAME" + java $AGENT_OPTS -cp $CLASSPATH @jvmArgs@ com.digiwin.app.common.launcher.DWXClassLauncher --xclass.mainclass=$MAINCLASS --xclass.password=@classPassword@ +fi diff --git a/app-code_backend/develop/platform/bin/stop.bat b/app-code_backend/develop/platform/bin/stop.bat new file mode 100644 index 0000000..d224f1a --- /dev/null +++ b/app-code_backend/develop/platform/bin/stop.bat @@ -0,0 +1,4 @@ +cd .. +cd .. +set /p G_PID= + + 4.0.0 + + com.digiwin.athena.opt + athena_parent + 1.0.0.1000 + + app-code_backend + + ${project.build.directory}/${project.name} + + + src/main/java + + + maven-compiler-plugin + 3.8.0 + + 1.8 + 1.8 + + + + maven-jar-plugin + 2.3.1 + + ${backend.output.path}/lib + + + + maven-dependency-plugin + 2.4 + + + copy-dependencies + package + + copy-dependencies + + + ${backend.output.path}/lib + + + + + + maven-resources-plugin + 3.0.2 + + + copy-resource-bin + generate-sources + + copy-resources + + + ${backend.output.path}/platform/bin + + + platform/bin + + + + + + copy-resource-conf + generate-sources + + copy-resources + + + ${backend.output.path}/conf + + + conf + + + + + + copy-resource-lang + generate-sources + + copy-resources + + + ${backend.output.path}/lang + + + lang + + + + + + + + + + + src/main/java + + **/*.xml + + false + + + src/main/resources + + + + diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/ApplicationStartBoot.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/ApplicationStartBoot.java new file mode 100644 index 0000000..68dc508 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/ApplicationStartBoot.java @@ -0,0 +1,34 @@ +/* + * Author: DONGSK + * Datetime: 2023/1/29 16:14 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration; +import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; +import org.springframework.boot.context.ApplicationPidFileWriter; +import org.springframework.context.annotation.ComponentScan; + +/** + * ApplicationStart + * + * @author DONGSK 2023/1/29 16:14 + * @since 1.0.0 + */ +@SpringBootApplication(exclude = {MongoAutoConfiguration.class, MongoDataAutoConfiguration.class}) +@ComponentScan({"com.digiwin.gateway", "com.digiwin.athena"}) +public class ApplicationStartBoot { + public static void main(String[] args) { + SpringApplication springApplication = new SpringApplication(ApplicationStartBoot.class); + springApplication.addListeners(new ApplicationPidFileWriter("DWApiGatewayApplication.pid")); + + springApplication.setMainApplicationClass(ApplicationStartBoot.class); + springApplication.run(args); + } + +} diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java new file mode 100644 index 0000000..9f3a8c7 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/package-info.java @@ -0,0 +1 @@ +package com.digiwin.athena.app.infra.entity; \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java new file mode 100644 index 0000000..cc3fbeb --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/package-info.java @@ -0,0 +1 @@ +package com.digiwin.athena.app.infra.mapper; \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java new file mode 100644 index 0000000..8a323a8 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/package-info.java @@ -0,0 +1,4 @@ +package com.digiwin.athena.app.infra; +/* + *1.基础服务放在此包下:主要是数据持久层,对外面提供基础数据处理 + */ \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java new file mode 100644 index 0000000..448908b --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/infra/repository/package-info.java @@ -0,0 +1 @@ +package com.digiwin.athena.app.infra.repository; \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicApiService.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicApiService.java new file mode 100644 index 0000000..e57a962 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicApiService.java @@ -0,0 +1,35 @@ +/* + * Author: DONGSK + * Datetime: 2023/1/29 16:34 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.provider; + +import com.digiwin.app.service.AllowAnonymous; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.restful.DWPathVariable; +import com.digiwin.app.service.restful.DWRequestMapping; +import com.digiwin.app.service.restful.DWRequestMethod; +import com.digiwin.app.service.restful.DWRestfulService; + +import java.util.Map; + +/** + * BasicApiService + * + * @author DONGSK 2023/1/29 16:34 + * @since 1.0.0 + */ +@DWRestfulService +public interface BasicApiService extends DWService { + + @AllowAnonymous + @DWRequestMapping(path = "/api/hello-word") + String helloWord(String name) throws Exception; + + @DWRequestMapping(path = "/EAIService/{serviceName}", method = DWRequestMethod.POST) + Object mockEAIExecutor(@DWPathVariable String serviceName, Map requestParameter) throws Exception; + +} \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicEAIService.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicEAIService.java new file mode 100644 index 0000000..3232661 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/BasicEAIService.java @@ -0,0 +1,27 @@ +/* + * Author: DONGSK + * Datetime: 2023/1/29 16:34 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.provider; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; + +import java.util.Map; + +/** + * BasicEAIApiService + * + * @author DONGSK 2023/1/29 16:34 + * @since 1.0.0 + */ +public interface BasicEAIService extends DWService { + + @EAIService(id = "opt.service.process") + DWEAIResult serviceProcess(Map headers, String messageBody) throws Exception; + +} \ No newline at end of file diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java new file mode 100644 index 0000000..5d2e172 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java @@ -0,0 +1,50 @@ +/* + * FileName: TestServiceImpl + * Author: DONGSK + * Datetime: 2022/8/24 13:40 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.provider.impl; + +import com.alibaba.fastjson.JSON; +import com.digiwin.app.service.DWServiceContext; +import com.digiwin.athena.app.provider.BasicApiService; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * TestServiceImpl + * + * @author DONGSK 2022/8/24 13:40 + * @since 1.0.0 + */ +public class BasicApiServiceImpl implements BasicApiService { + + @Resource + EAIServiceContext eaiServiceContext; + + @Override + public String helloWord(String name) throws Exception { + return "hello ," + name; + } + + @Override + public Object mockEAIExecutor(String serviceName, Map requestParameter) throws Exception { + Map headers = new HashMap<>(); + DWServiceContext.getContext().getRequestHeader().forEach((k, v) -> { + headers.put(k, String.valueOf(v)); + }); + DWServiceContext.getContext().setStandardResult(false); + /** 直接返回,不再包装,入参可以体现 serviceName + Map eaiResult = new HashMap<>(); + eaiResult.put("service", serviceName); + eaiResult.put("response", eaiServiceContext.execute(serviceName, headers, JSON.toJSONString(requestParameter))); + */ + return eaiServiceContext.execute(serviceName, headers, JSON.toJSONString(requestParameter)); + } +} diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java new file mode 100644 index 0000000..4b51458 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicEAIServiceImpl.java @@ -0,0 +1,46 @@ +/* + * Author: DONGSK + * Datetime: 2023/1/30 10:18 + * Description: + * History: + * 作者姓名 --修改时间 --版本号--描述 + */ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.BasicEAIService; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * BasicEAIApiServiceImpl + * + * @author DONGSK 2023/1/30 10:18 + * @since 1.0.0 + */ +public class BasicEAIServiceImpl implements BasicEAIService { + + @Resource + EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult serviceProcess(Map headers, String messageBody) throws Exception { + + + EAIRequest eaiRequest = EAIRequest.build(messageBody); + + String eaiServiceName = eaiRequest.getString("eai_service_name"); + + if (StringUtils.isBlank(eaiServiceName)) { + + return EAIUtil.buildEAIResultError("EAI service name(eai_service_name) is required!"); + } + + return eaiServiceContext.execute(eaiServiceName, headers, messageBody); + } +} diff --git a/app-code_backend/develop/src/main/java/com/digiwin/athena/app/service/package-info.java b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/service/package-info.java new file mode 100644 index 0000000..7c4e881 --- /dev/null +++ b/app-code_backend/develop/src/main/java/com/digiwin/athena/app/service/package-info.java @@ -0,0 +1,4 @@ +package com.digiwin.athena.app.service; +/** + * 应用核心业务逻辑写在此包下,此包下实现EAI接口服务逻辑及其他业务逻辑 + */ \ No newline at end of file diff --git a/app-code_backend/develop/src/main/resources/META-INF/dap.info b/app-code_backend/develop/src/main/resources/META-INF/dap.info new file mode 100644 index 0000000..e107715 --- /dev/null +++ b/app-code_backend/develop/src/main/resources/META-INF/dap.info @@ -0,0 +1,4 @@ +#save dap.info +#Sun Jan 29 14:54:12 CST 2023 +group.name=cim +business.extension.layer= diff --git a/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/impl/temp.txt b/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/impl/temp.txt new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/impl/temp.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/temp.txt b/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/temp.txt new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/app-code_backend/develop/src/test/java/com/digiwin/athena/app/provider/temp.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app-code_backend/develop/src/test/resources/temp.txt b/app-code_backend/develop/src/test/resources/temp.txt new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/app-code_backend/develop/src/test/resources/temp.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app-code_backend/pom.xml b/app-code_backend/pom.xml new file mode 100644 index 0000000..3c111e3 --- /dev/null +++ b/app-code_backend/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.0.1.RELEASE + + com.digiwin.athena.opt + athena_parent + 1.0.0.1000 + pom + + develop + + + + releases + Nexus Release Repository + ${nexus.ip}/content/repositories/releases/ + + + snapshots + Nexus Snapshots Repository + ${nexus.ip}/content/repositories/snapshots/ + + + + UTF-8 + https://repo.digiwincloud.com.cn/maven + 1.1.0.0 + 5.0.5.RELEASE + 5.2.0.1005 + 2.8.6 + 1.05 + + + + + com.digiwin.athena + athena-opt-common + 1.0.103-SNAPSHOT + + + com.digiwin + dwapiplatform-simplified-starter + + + + + + com.digiwin + dwapiplatform-simplified-starter + ${api.version} + + + + junit + junit + 3.8.1 + test + + + + + athena-releases + Nexus Releases Repository athena + https://athena-devops-nexus.digiwincloud.com.cn/content/repositories/releases/ + + + athena-snapshots + Nexus Release Repository athena + https://athena-devops-nexus.digiwincloud.com.cn/content/repositories/snapshots/ + + + releases + Nexus Releases Repository + ${nexus.ip}/content/repositories/releases/ + + + + + + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + -parameters + -parameters + + + + + diff --git a/doc/conf_dev/application.properties b/doc/conf_dev/application.properties new file mode 100644 index 0000000..9198223 --- /dev/null +++ b/doc/conf_dev/application.properties @@ -0,0 +1,104 @@ +appId=app-code +configCenterUrl=@configCenterUrl@ +configPolicy=@configPolicy@ +isRemoteConfigOn=@isRemoteConfigOn@ +isGroupConfigOn=@isGroupConfigOn@ +configGroup=@configGroup@ +#APPIMAGENAME=@APPIMAGENAME@ +#PLATFORM=@PLATFORM@ +#SMALLVERSION=@SMALLVERSION@ + +#springConfigFileNames=xxx.xml,xxx.xml +iamApToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6ImNhLWNpbS1hcCIsImluc2lkZSI6ZmFsc2UsInNpZCI6NTM2NDIzMDcyMjkzNDQwfQ.nry_ZzZrL1Gj6nZ2m2IGESntnWqyLSZtGzGRn2Z_bSw +dmcUserName=@dmcUserName@ +dmcPwd=@dmcPwd@ +dmcBucketName=@dmcBucketName@ +eaiExceptionHandler= +eaiUrl=https://esp-test.apps.digiwincloud.com.cn +# eaiUrl=http://172.16.2.230:9990 +eaiHostProdIsStandardProduct= +eaiAutoRegistrationEnable=false +eaiHostUid=ca-cim-ap +eaiHostProd=ca-cim-ap +eaiHostId=ca-cim-ap +eaiRestfulCustomId=cim + +dbUrl=jdbc:mariadb://172.16.102.34:3306/app-code?allowMultiQueries=true +dbUsername=root +dbPassword=123456 +scheduleEmailUsername= +scheduleEmailPassword= +scheduleEmailPort= +scheduleEmailSmtpHost= +scheduleRemoteInvocation=@scheduleRemoteInvocation@ +isScheduleJsonOutput=@isScheduleJsonOutput@ +thisDapUrl=@thisDapUrl@ +serverPort=8085 +tenantColumnname=tenantsid +hybridCloudSaasUrl= +#hybridCloudUrlSaas{apName} +#OtherDapUrl{apName} + +#dao setting +dwdaoCalculateMaxSeqFieldName=@dwdaoCalculateMaxSeqFieldName@ +dwdaoCalculateMaxSeqEnabled=@dwdaoCalculateMaxSeqEnabled@ +dwdaoSelectVersionFieldEnabled=@dwdaoSelectVersionFieldEnabled@ + +#custom sql filter chain +#example - false:com.digiwin.app.dao.filter.DWSQLManagementFieldFilter, +dwsqlFilterChianCustom=@dwsqlFilterChianCustom@ +#management field enabled +mgmtFieldEnabled=true +#management field resolver class name +#dap default resolver = com.digiwin.app.dao.filter.DWProfileManagementFieldResolver +mgmtFieldResolver=com.digiwin.app.dao.filter.DWProfileManagementFieldResolver +#management fields mappings +#example - DATA_CREATED_BY:userId,DATA_MODIFY_BY:userId +mgmtFieldInsertMappings=create_by:userId,create_date:$DATETIME +mgmtFieldUpdateMappings=modified_by:userId,modified_date:$DATETIME +mgmtFieldIgnoreCustomValue=false + +# log level +logLevel=DEBUG +logFileReservedDay=7d +#Log file name id: Ex. Windows:_${env:COMPUTERNAME} Linux:_${env:HOSTNAME} +logFileIdentifier= + +#\u9810\u8a2d\u503c\u5c07\u5728\u7570\u5e38\u56de\u61c9\u88e1\u8f38\u51faDebugInfo\u5b57\u6bb5\uff0c\u8a2d\u5b9a\u70bafalse\u503c\u8868\u793a\u4e0d\u8f38\u51fa\u8a72\u5b57\u6bb5 +dwExceptionOutputDebugInfo=@dwExceptionOutputDebugInfo@ + +#\u662f\u5426\u555f\u7528\u670d\u52d9\u8abf\u7528\u934aSession Id\u8a18\u9304\u529f\u80fd\uff0c\u8a2d\u5b9atrue\u8868\u793a\u555f\u7528 +dwServiceChainEnabled=@dwServiceChainEnabled@ +#\u670d\u52d9\u8abf\u7528\u934a\u81ea\u8a02Id +dwServiceChainCustomId=@dwServiceChainCustomId@ +#\u670d\u52d9\u8abf\u7528\u934a\u63a5\u6536\u4fe1\u606f\u6642\u6253\u5370\u5668\u985e\u578b +dwServiceChainReceivedPrinterType=@dwServiceChainReceivedPrinterType@ + +#DWJson enable empty string to null +dwJsonEmptyStrToNullEnabled=@dwJsonEmptyStrToNullEnabled@ + +#DWDao underscore-to-camel-case setting +dwDaoUnderScoreToCamelCase=true + +#DWMq +dwMqEnabled=@dwMqEnabled@ +dwMqProtocol=@dwMqProtocol@ +dwMqHost=@dwMqHost@ +dwMqPort=@dwMqPort@ + +dap.json.date-time-format=yyyy/MM/dd HH:mm:ss +dap.json.number-processor-name=default +dap.json.standard-result-null-to-empty-str=false +dap.container.local.matcher.one-param=true +spring.servlet.multipart.max-file-size=5Mb +spring.servlet.multipart.max-request-size=5Mb + +spring.rabbitmq.uri=amqp://athena:athena@192.168.137.10/athena +domain.km=https://knowledgemaps-test.apps.digiwincloud.com.cn +domain.esp=https://esp-test.apps.digiwincloud.com.cn +domain.mdc=https://esp-test.apps.digiwincloud.com.cn +domain.eoc=https://eoc-test.digiwincloud.com.cn +domain.lmc=https://lmc-test.digiwincloud.com.cn + +opt.mybatisPlus.enable=true +opt.mybatisPlus.configuration.log=true diff --git a/doc/conf_dev/log4j2.xml b/doc/conf_dev/log4j2.xml new file mode 100644 index 0000000..f8454c8 --- /dev/null +++ b/doc/conf_dev/log4j2.xml @@ -0,0 +1,72 @@ + + + + %d{yyyy/MM/dd HH:mm:ss} %-5p [%X{traceId}] %m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/conf_dev/platform.properties b/doc/conf_dev/platform.properties new file mode 100644 index 0000000..d69f8ce --- /dev/null +++ b/doc/conf_dev/platform.properties @@ -0,0 +1,182 @@ +#Compatible Parameter +appName=${appId} +spring.application.name=${appId} +spring.profiles.active=${httpRequestFilters:} + +#IAM +iamUrl=https://iam-test.digiwincloud.com.cn +iamContentType=application/json +iamCharset=UTF-8 +iamSoTimeout=30000 +iamHttpConnectionPoolRequestTimeout=20000 +iamEncode=UTF-8 +iamHttpConnectionTimeout=60000 +iamUrlUsertokenAnalyze=/api/iam/v2/identity/token/analyze +iamHttpMaxConnections=200 +iamKeepAliveTimeout=-1 +iamUrlLogin=/api/iam/v2/identity/login +iamUrlUser=/api/iam/v2/user +iamUrlPathPermissionRootTarget=drn:iam:app:{appId}:webmodule:menu:{appId} +iamUrlAppRootTarget=drn:iam:app:{appId} +iamUrlUpdateModule=/api/iam/v2/app/module/update +iamUrlUserPermission=/api/iam/v2/permission/user/all +iamUrlUpdateAction=/api/iam/v2/app/action/update +iamUrlGetApp=/api/iam/v2/app +iamUrlUpdateCondition=/api/iam/v2/app/condition/update +iamUrlRemoveCondition=/api/iam/v2/app/condition/remove +iamUrlDisableAction=/api/iam/v2/app/action/disable +iamUrlOrgAspect=/api/iam/v2/org/aspect +iamUrlOrgUserinorg=/api/iam/v2/org/userinorg +iamUrlUserTenantApplication=/api/iam/v2/user/tenant/application +iamUrlUserAllInfo=/api/iam/v2/query/user/allinfo +#CAC +cacUrl= + +#LMC +lmcUrl=@lmcUrl@ + +#DMC +dmcUrl= + +#DWMq +dwMqBasic=ZGlnaXdpbjpkaWdpd2lu + +#Queue 1.0 +queueTenantProcessorHost=@queueTenantProcessorHost@ +queueTenantTlsOn=@queueTenantTlsOn@ +#queueSaasRabbitmqIsHttps=@queueSaasRabbitmqIsHttps@ +queueSaasRabbitmqHost=@queueSaasRabbitmqHost@ +queueSaasRabbitmqAmqpPort=@queueSaasRabbitmqAmqpPort@ +queueSaasRabbitmqHttpPort=@queueSaasRabbitmqHttpPort@ +queueSaasRabbitmqUsername=@queueSaasRabbitmqUsername@ +queueSaasRabbitmqPassword=@queueSaasRabbitmqPassword@ +queueSaasTlsOn=@queueSaasTlsOn@ + +#MQTT +mqttSrvHost= +mqttSrvUsername= +mqttSrvPassword= +mqttSrvClientId=superman999 +mqttSrvCleanSession=false +mqttSrvReconnect=false +mqttTopicQos=1 +mqttTopicRetained=true +mqttSrvConnectTimeout=5000 +mqttWaitForCompletion=10000 + +#EAI +eaiHostRetrytimes=3 +eaiHostVer=1.0.0 +eaiHostRetryinterval=3000 +eaiHostConcurrence=50 +eaiUrlRegSrv=/CROSS/RESTful/regSrv + +#database +dbEnabled=true +jdbcDriverClassName=org.mariadb.jdbc.Driver +dbConnectionMaxWaitMillis=60000 +dbConnectionInitialSize=3 +dbConnectionMaxTotal=20 +dbConnectionMinIdle=3 + +#Servlet container +httpRequestFilters=RestfulService,RestfulStandard,EAI +serverHttpControllerIo=bio +serverType=tomcat +serverAsyncTimeout=120000 +serverTomcatAcceptCount=1500 +serverTomcatMaxConnections=10000 +serverTomcatMinSpareThreads=64 +serverTomcatMaxThreads=1500 +serverHttpTokenmode=IAM +accessControlAllowOrigin=* +accessControlAllowMethods=POST,PUT,GET,DELETE +accessControlMaxAge=86400 +accessControlAllowHeaders=Content-Type,token,accesstoken,digi-middleware-auth-app,Program-Code,Module-Name,origin-iam-url-key,locale,Accept-Language,routerKey +serverTokenExpiredTime=60000 + + +#DAP Spring config +platformSpringConfigFileNames= + + +#Spring boot setting +spring.mvc.throw-exception-if-no-handler-found=true +spring.resources.add-mappings=false + +#Spring boot server +server.tomcat.additional-tld-skip-patterns=*mchange-commons-java*.jar +server.max-http-header-size=10000 + +#Spring boot log +logging.config=classpath:log4j2.xml + +#Spring boot cache +spring.redis.database=1 +spring.redis.host=172.16.102.34 +spring.redis.port=6379 +spring.redis.password=123456 +spring.redis.timeout=30000 + +spring.redis.pool.max-active=1024 +spring.redis.pool.max-wait=10 +spring.redis.pool.max-idle=20 +spring.redis.pool.min-idle=10 + +spring.redis.lettuce.pool.max-active=1024 +spring.redis.lettuce.pool.max-wait=10 +spring.redis.lettuce.pool.max-idle=20 +spring.redis.lettuce.pool.min-idle=10 +spring.redis.lettuce.shutdown-timeout=30000 + +#Cache +keyExpiredTime=30000 + +#K8S service proxy +k8sProxyUrl= +k8sProxyContentType=application/json +k8sProxyCharset=UTF-8 +k8sProxyEncode=UTF-8 +k8sProxyHttpConnectionPoolRequestTimeout= +k8sProxyHttpMaxConnections= +k8sProxyHttpConnectionTimeout= +k8sProxySoTimeout= + +#Schedule +scheduleEnabled=false +scheduleEmailTypeOfConnection=0 + +#Quartz +org.quartz.dataSource.quartzDataSource.connectionProvider.class=com.digiwin.app.schedule.quartz.DWQuartzPoolingConnectionProvider +org.quartz.jobStore.useProperties=false +org.quartz.scheduler.instanceId=AUTO +org.quartz.dataSource.quartzDataSource.testConnectionOnCheckout=true +org.quartz.plugin.DWJobInterruptListener.class=com.digiwin.app.schedule.quartz.listener.DWJobInterruptListener +org.quartz.dataSource.quartzDataSource.testConnectionOnCheckin=false +org.quartz.jobStore.tablePrefix=QRTZ_ +org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool +org.quartz.dataSource.quartzDataSource.preferredTestQuery=SELECT 1 +org.quartz.jobStore.dataSource=quartzDataSource +org.quartz.scheduler.instanceName=DigiwinQuartzScheduler +org.quartz.jobStore.isClustered=true +org.quartz.dataSource.quartzDataSource.maxPoolSize=50 +org.quartz.dataSource.quartzDataSource.idleConnectionTestPeriod=300 +org.quartz.dataSource.quartzDataSource.maxIdleTimeExcessConnections=240 +org.quartz.threadPool.threadCount=50 +org.quartz.dataSource.quartzDataSource.acquireIncrement=5 +org.quartz.threadPool.threadPriority=5 +org.quartz.dataSource.quartzDataSource.minPoolSize=5 +org.quartz.jobStore.clusterCheckinInterval=20000 + +#Tenant +tenantEnabled=true + +#Fine report +frUrl= +frUrlKanbanUrlInfo=/digiwin/KanbanUrlInfo +frUrlKanbanUserInfoSyncInit=/digiwin/kanban/view/form?op=fr_base&cmd=evaluate_formula&expression=updateuser10() + +#\u79fb\u52d5\u521d\u59cb\u5316\u793e\u5340 +mobileUrl= +mobileApiInit= + diff --git a/doc/conf_dev/readme.md b/doc/conf_dev/readme.md new file mode 100644 index 0000000..244c204 --- /dev/null +++ b/doc/conf_dev/readme.md @@ -0,0 +1,22 @@ +[開發工具-簡易式模版-配置資源 有下列文件] +---------------------------------------------------- +A.應用層 + 1.application.properties + 2.spring-application.xml +B.平台層 + 1.platform.properties + 2.log4j2.xml + 3.service-retry-config-platform.json +==================================================== + + +[上述文件在平台打包開發包時, 會從模組化運行包中複製] +---------------------------------------------------- + A.1. 從運行包路徑下 application\conf 複製 + A.2. 從運行包路徑下 application\conf 複製 + B.1. 從運行包路徑下 platform\conf 複製 + B.2. 從運行包路徑下 platform\conf 複製 + B.3. 從運行包路徑下 platform\conf 複製 + service-retry-config.json 更名為 + service-retry-config-platform.json +==================================================== \ No newline at end of file diff --git a/doc/conf_dev/service-retry-config-platform.json b/doc/conf_dev/service-retry-config-platform.json new file mode 100644 index 0000000..59785b6 --- /dev/null +++ b/doc/conf_dev/service-retry-config-platform.json @@ -0,0 +1,23 @@ +[ + { + "appId": "iam", + "enable": true, + "paths": [ + { + "path": "/**/identity/token/analyze", + "enable": true, + "retry": { + "retries": 3, + "statuses": "502", + "methods": "POST", + "backoff": { + "type": "simple", + "firstBackoff": "500", + "maxBackoff": "50000", + "factor": 2 + } + } + } + ] + } +] \ No newline at end of file diff --git a/doc/conf_dev/spring-application.xml b/doc/conf_dev/spring-application.xml new file mode 100644 index 0000000..42759dd --- /dev/null +++ b/doc/conf_dev/spring-application.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/sql-dap/dap-5.2.0.1002-ddl.sql b/doc/sql-dap/dap-5.2.0.1002-ddl.sql new file mode 100644 index 0000000..73a077a --- /dev/null +++ b/doc/sql-dap/dap-5.2.0.1002-ddl.sql @@ -0,0 +1,562 @@ +-- -------------------------------------------------------- +-- 主机: 172.16.102.34 +-- 服务器版本: 5.7.38 - MySQL Community Server (GPL) +-- 服务器操作系统: Win64 +-- HeidiSQL 版本: 12.3.0.6589 +-- -------------------------------------------------------- + + +-- 导出 表 ca-cim-ap.dw_app_prod 结构 +CREATE TABLE IF NOT EXISTS `dw_app_prod` ( + `app_code` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '應用產品線代碼', + `description` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '說明資料', + PRIMARY KEY (`app_code`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='應用產品線'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_app_release 结构 +CREATE TABLE IF NOT EXISTS `dw_app_release` ( + `app_code` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '應用產品線代碼', + `version` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '版號', + `file_seq` int(10) NOT NULL COMMENT '檔案序號', + `file_id` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '放在文檔中心的檔案id', + `published` varchar(1) COLLATE utf8_bin NOT NULL COMMENT '正式發布', + `file_name` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '放在文檔中心的檔案名稱', + PRIMARY KEY (`app_code`,`version`,`file_seq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='應用版本發布與釋出'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_app_update 结构 +CREATE TABLE IF NOT EXISTS `dw_app_update` ( + `app_code` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '應用產品線代碼', + `version` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '版號', + `allow_upd_version` varchar(2000) COLLATE utf8_bin NOT NULL COMMENT '允許版更的版本列表[分號分隔]', + `allow_upd_expr` varchar(20) COLLATE utf8_bin NOT NULL COMMENT '允許版更的版本表達式', + PRIMARY KEY (`app_code`,`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='應用更新版本對應'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_custom_column 结构 +CREATE TABLE IF NOT EXISTS `dw_custom_column` ( + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + `table_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '表格id', + `userid` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用戶id', + `config` text COLLATE utf8_bin COMMENT '配置內容', + PRIMARY KEY (`tenantsid`,`table_id`,`userid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_log_operation 结构 +CREATE TABLE IF NOT EXISTS `dw_log_operation` ( + `log_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '主键', + `operate_no` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '操作流水號', + `operate_type` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '操作類型(1:pc 2:pda)', + `operate_desc` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '操作名稱', + `menu` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '選單菜單', + `module` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '模組', + `url` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '接口路徑', + `input_value` text COLLATE utf8_bin COMMENT '操作接口入参', + `return_value` text COLLATE utf8_bin COMMENT '操作接口回參', + `client_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '客户端ip', + `time_consume` bigint(20) DEFAULT NULL COMMENT '本次操作耗時(ms)', + `status` tinyint(4) DEFAULT NULL COMMENT '操作狀態', + `remark` text COLLATE utf8_bin COMMENT '備註', + `create_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '創建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '創建時間', + `update_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新時間', + `traceid` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '追蹤鍵', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`log_id`,`tenantsid`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT COMMENT='操作日誌'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_log_operation_error 结构 +CREATE TABLE IF NOT EXISTS `dw_log_operation_error` ( + `log_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '主键', + `operate_no` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '操作流水號', + `operate_type` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '操作類型(1:pc 2:pda)', + `operate_desc` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '操作名稱', + `error_type` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '異常类型(1:系统異常 2:操作異常 3:集成異常)', + `error_message` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '異常資訊', + `menu` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '選單菜單', + `module` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '模組', + `url` varchar(256) COLLATE utf8_bin DEFAULT NULL COMMENT '接口路徑', + `input_value` varchar(5000) COLLATE utf8_bin DEFAULT NULL COMMENT '操作接口入参', + `client_ip` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '客户端ip', + `time_consume` bigint(20) DEFAULT NULL COMMENT '本次操作耗時(ms)', + `create_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '創建人', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '創建時間', + `update_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '更新人', + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新時間', + `traceid` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '追蹤鍵', + `prog_impl` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '代碼方法', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`log_id`,`tenantsid`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT COMMENT='操作異常日誌'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_log_operation_sql 结构 +CREATE TABLE IF NOT EXISTS `dw_log_operation_sql` ( + `log_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '主键', + `operation_log_id` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '關聯日誌表id', + `log_type` tinyint(4) DEFAULT '1' COMMENT '日誌類型(1.操作日誌 2.調度日誌)', + `cmd_table` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '執行表名(预留,還可以加操作)', + `cmd_statement` longtext COLLATE utf8_bin COMMENT '執行語句', + `cmd_parameters` longtext COLLATE utf8_bin COMMENT '執行參數', + `cmd_seq` int(11) DEFAULT NULL COMMENT '執行顺序', + `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '創建時間', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`log_id`,`tenantsid`) USING BTREE, + KEY `SEL_INDEX01` (`operation_log_id`,`tenantsid`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin ROW_FORMAT=COMPACT COMMENT='sql日誌'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_menu 结构 +CREATE TABLE IF NOT EXISTS `dw_menu` ( + `id` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '編號', + `type` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '型態', + `parent_id` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '父層編號', + `code` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '代碼', + `sequence` int(20) NOT NULL DEFAULT '1' COMMENT '順序', + `icon_class` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '圖示class', + `default_expand` bit(1) DEFAULT b'0' COMMENT '默認展開', + `url` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT 'URL', + `open_mode` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT 'open 模式', + `version` int(20) NOT NULL DEFAULT '1' COMMENT '版本', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='菜單主表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_menu_language 结构 +CREATE TABLE IF NOT EXISTS `dw_menu_language` ( + `menu_id` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '菜單編號', + `language` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '語言別', + `name` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '名稱', + PRIMARY KEY (`menu_id`,`language`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='菜單多語言信息表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_menu_parameter 结构 +CREATE TABLE IF NOT EXISTS `dw_menu_parameter` ( + `menu_id` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '菜單編號', + `name` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '參數名稱', + `value` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '值', + PRIMARY KEY (`menu_id`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='菜單參數表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_myhome 结构 +CREATE TABLE IF NOT EXISTS `dw_myhome` ( + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + `level` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '首頁層級,common/user', + `userid` varchar(40) COLLATE utf8_bin NOT NULL COMMENT '用戶id', + `version` int(11) NOT NULL DEFAULT '1' COMMENT '版本', + `type` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '首頁型態,作業/報表/外部連接', + `path` varchar(2000) COLLATE utf8_bin DEFAULT NULL COMMENT '作業/報表/外部連接路徑', + PRIMARY KEY (`tenantsid`,`userid`,`level`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='自定義首頁主表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_myhome_parameter 结构 +CREATE TABLE IF NOT EXISTS `dw_myhome_parameter` ( + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + `level` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '首頁層級,common/user', + `userid` varchar(100) COLLATE utf8_bin NOT NULL COMMENT '用戶id', + `name` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '參數名稱', + `value` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '參數值', + PRIMARY KEY (`tenantsid`,`userid`,`level`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='自定義首頁參數表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_platform_info 结构 +CREATE TABLE IF NOT EXISTS `dw_platform_info` ( + `version` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '版號', + `isTenant` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '是否為多租戶', + `versionDate` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '版本日期', + `updateDate` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '更新日期' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='微服務平台版本資訊'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_query_info 结构 +CREATE TABLE IF NOT EXISTS `dw_query_info` ( + `query_id` varchar(45) COLLATE utf8_bin NOT NULL COMMENT '查詢編號', + `query_type` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '類型', + `sql_statement` varchar(450) COLLATE utf8_bin DEFAULT NULL COMMENT 'sql', + `publish` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '發佈者', + `owner` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '擁有者', + PRIMARY KEY (`query_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='開窗信息主表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_rdbms_fields 结构 +CREATE TABLE IF NOT EXISTS `dw_rdbms_fields` ( + `TABLE_NAME` varchar(80) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '数据表名称', + `SEQ` smallint(5) unsigned NOT NULL COMMENT '项次', + `FIELD_NAME` varchar(80) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '字段编号', + `IS_KEY` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'N' COMMENT '主键否', + `FIELD_TYPE` varchar(20) COLLATE utf8_bin DEFAULT '' COMMENT '字段型态,备注:1.varchar;2.number;3.date;4.datetime', + `STATUS_CODE` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'Y' COMMENT '状态码:Y.有效;N.无效;', + `FIELD_DISPLAY_NAME` varchar(80) COLLATE utf8_bin DEFAULT '' COMMENT '字段名称', + `SCALE` varchar(20) COLLATE utf8_bin DEFAULT '' COMMENT '字段长度', + `DEFAULT_VALUE` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '默认值', + `NULLABLE` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'N' COMMENT '可否為空', + `IS_VERSION` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'N' COMMENT '是否需要依version進行樂觀鎖', + `SIZE` varchar(20) COLLATE utf8_bin DEFAULT NULL COMMENT '長度', + `IS_AUTO_INCREMENT` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'N' COMMENT '是否為自動產生流水號', + PRIMARY KEY (`FIELD_NAME`,`TABLE_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='数据结构资料表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_rdbms_relations 结构 +CREATE TABLE IF NOT EXISTS `dw_rdbms_relations` ( + `PRIMARY_TABLE_NO` varchar(80) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '来源表号', + `REFERENCE_TABLE_NO` varchar(80) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '参照表号', + `PRIMARY_TABLE_PK` varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '来源表PK', + `REFERENCE_TABLE_PK` varchar(45) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '参照表PK', + `TYPE` enum('Auto','OneToOne','OneToMany','ManyToMany') COLLATE utf8_bin DEFAULT NULL COMMENT '關聯類型', + PRIMARY KEY (`PRIMARY_TABLE_NO`,`REFERENCE_TABLE_NO`,`PRIMARY_TABLE_PK`,`REFERENCE_TABLE_PK`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='资料表关系表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_rdbms_tables 结构 +CREATE TABLE IF NOT EXISTS `dw_rdbms_tables` ( + `table_name` varchar(45) COLLATE utf8_bin NOT NULL COMMENT '资料表名', + `table_display_name` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '资料表外显名称', + `table_description` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '资料表描述', + `delete_constraint` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'N' COMMENT '資料表刪除約束', + `hint_field` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '資料表刪除提示字段', + `insert_default_value` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '新增帶默認值選項', + `update_default_value` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '修改帶默認值選項', + PRIMARY KEY (`table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='数据库资料表描述表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_schedule 结构 +CREATE TABLE IF NOT EXISTS `dw_schedule` ( + `schedule_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '排程編號', + `schedule_name` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '排程名稱', + `job_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '工作名稱', + `schedule_type` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '排程類型 1.指定時間背景執行 2.周期執行', + `enable_status` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'Y' COMMENT '啟用狀態 Y/N', + `description` varchar(100) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', + `effective_time` timestamp NULL DEFAULT NULL COMMENT '排程生效時間', + `expire_time` timestamp NULL DEFAULT NULL COMMENT '排程失效時間', + `max_runtime` int(10) DEFAULT NULL COMMENT '最長執行時間(分鐘)', + `schedule_param` text COLLATE utf8_bin COMMENT '參數', + `recent_status` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '近期狀態', + `last_success_time` timestamp NULL DEFAULT NULL COMMENT '上次成功時間', + `last_period_time` int(10) DEFAULT NULL COMMENT '上次執行時間', + `next_execute_time` timestamp NULL DEFAULT NULL COMMENT '下次執行時間', + `program_code` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '作業編號', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + `module_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '模組名稱', + PRIMARY KEY (`schedule_id`,`tenantsid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='排程表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_schedule_contact 结构 +CREATE TABLE IF NOT EXISTS `dw_schedule_contact` ( + `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '編號', + `schedule_id` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '排程編號', + `mail_type` varchar(10) COLLATE utf8_bin DEFAULT NULL COMMENT '寄件形式', + `mail_subject` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '寄件主題', + `mail_content` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '寄件內容', + `receiver_email` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '收件人email地址', + `send_condition` varchar(50) COLLATE utf8_bin DEFAULT '' COMMENT '寄信條件', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='排程寄信通知表'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_schedule_record 结构 +CREATE TABLE IF NOT EXISTS `dw_schedule_record` ( + `execute_id` varchar(128) COLLATE utf8_bin NOT NULL COMMENT '執行編號', + `schedule_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '排程編號', + `job_name` varchar(50) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '工作名稱', + `execute_status` varchar(10) COLLATE utf8_bin DEFAULT '' COMMENT '執行狀態 ', + `message` text COLLATE utf8_bin COMMENT '訊息id', + `message_detail` text COLLATE utf8_bin COMMENT '詳細訊息', + `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '執行開始時間', + `end_time` timestamp NULL DEFAULT NULL COMMENT '執行結束時間', + `schedule_param` text COLLATE utf8_bin COMMENT '執行參數', + `schedule_type` varchar(1) COLLATE utf8_bin DEFAULT '' COMMENT '排程類型 1.指定時間背景執行 2.周期執行', + `is_misfire` varchar(1) COLLATE utf8_bin DEFAULT 'N' COMMENT '是否為misfire後重試', + `program_code` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '作業編號', + `schedule_name` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '排程名稱', + `executor` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '執行者', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`execute_id`,`tenantsid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='排程執行記錄'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_schedule_time 结构 +CREATE TABLE IF NOT EXISTS `dw_schedule_time` ( + `schedule_id` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '執行編號', + `month` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '月份', + `week_of_month` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '每個月第幾個星期', + `week` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '星期幾', + `day_of_month` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '每個月第幾天', + `assign_time` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '指定時間', + `time` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '週期性指定時間', + `holiday` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '假日處理模式', + `time1` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '時間區間一', + `time2` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '時間區間二', + `time3` varchar(255) COLLATE utf8_bin DEFAULT '' COMMENT '時間區間三', + `is_allow_concurrent` varchar(1) COLLATE utf8_bin DEFAULT '' COMMENT '是否允許併發 Y/N', + `day_radio` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '日頻次', + `month_radio` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '月頻次', + `time_radio` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '時間頻次', + `week_radio` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '周頻次', + `frequency` int(10) DEFAULT NULL COMMENT '週期頻率', + `repeat_type` int(10) DEFAULT NULL COMMENT '區間類型 1.每幾分 2.每幾小時 3.每幾天', + `start_time` timestamp NULL DEFAULT NULL COMMENT '開始日期', + `end_time` timestamp NULL DEFAULT NULL COMMENT '結束日期', + `repeat_count` int(11) DEFAULT NULL COMMENT '執行次數', + `minutely` int(10) DEFAULT NULL COMMENT '每n分', + `hourly` int(10) DEFAULT NULL COMMENT '每n時', + `daily` int(10) DEFAULT NULL COMMENT '每n天', + `weekly` int(10) DEFAULT NULL COMMENT '每n週', + `byday` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '星期n', + `monthly` int(10) DEFAULT NULL COMMENT '每n月', + `bymonthday` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '當月中的第n天', + `byweeklyday` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '當月中的第n個星期m', + `exclude_date` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '例外日期', + `exclude_time` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '例外時間', + `retry_after_misfire_sec` int(10) DEFAULT NULL COMMENT 'misfire幾秒後重試', + `is_retry` varchar(1) COLLATE utf8_bin NOT NULL DEFAULT 'Y' COMMENT '是否在misfire後重試', + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + PRIMARY KEY (`schedule_id`,`tenantsid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='排程執行時間設定檔'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_theme 结构 +CREATE TABLE IF NOT EXISTS `dw_theme` ( + `tenantsid` bigint(20) NOT NULL COMMENT '租戶sid', + `prop` varchar(50) COLLATE utf8_bin NOT NULL COMMENT '屬性key名稱', + `value` varchar(500) COLLATE utf8_bin DEFAULT NULL COMMENT '屬性值', + `userid` varchar(50) COLLATE utf8_bin DEFAULT NULL COMMENT '用戶id', + PRIMARY KEY (`tenantsid`,`prop`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_theme_filelog 结构 +CREATE TABLE IF NOT EXISTS `dw_theme_filelog` ( + `fileid` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '文件ID(DMC)', + `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '創建時間', + `messege` varchar(500) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '描述', + PRIMARY KEY (`fileid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.dw_ui_metadata 结构 +CREATE TABLE IF NOT EXISTS `dw_ui_metadata` ( + `operation_id` varchar(80) COLLATE utf8_bin NOT NULL COMMENT 'ui編號', + `table_name` varchar(45) COLLATE utf8_bin NOT NULL COMMENT '表名稱', + `field_id` varchar(45) COLLATE utf8_bin NOT NULL COMMENT '字段名稱', + `length` int(11) DEFAULT NULL COMMENT '長度', + `nullable` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT '允許為null', + `format` varchar(80) COLLATE utf8_bin DEFAULT NULL COMMENT '格式', + `enum` varchar(80) COLLATE utf8_bin DEFAULT NULL COMMENT '枚舉值', + `resource` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '來源', + PRIMARY KEY (`operation_id`,`table_name`,`field_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='使用者介面元數據'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_job_details 结构 +CREATE TABLE IF NOT EXISTS `qrtz_job_details` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `JOB_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '作业名称', + `JOB_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '作业组', + `DESCRIPTION` varchar(250) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', + `JOB_CLASS_NAME` varchar(250) COLLATE utf8_bin NOT NULL COMMENT '作业程序集名称', + `IS_DURABLE` varchar(1) COLLATE utf8_bin NOT NULL COMMENT '是否持久', + `IS_NONCONCURRENT` varchar(1) COLLATE utf8_bin NOT NULL COMMENT '是否并行', + `IS_UPDATE_DATA` varchar(1) COLLATE utf8_bin NOT NULL COMMENT '是否更新', + `REQUESTS_RECOVERY` varchar(1) COLLATE utf8_bin NOT NULL COMMENT '是否要求唤醒', + `JOB_DATA` blob COMMENT '作业信息', + PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='job詳息信息'; + + +-- 导出 表 ca-cim-ap.qrtz_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `JOB_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '作业名称', + `JOB_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '作业组', + `DESCRIPTION` varchar(250) COLLATE utf8_bin DEFAULT NULL COMMENT '描述', + `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL COMMENT '下次执行时间', + `PREV_FIRE_TIME` bigint(13) DEFAULT NULL COMMENT '前一次执行时间', + `PRIORITY` int(11) DEFAULT NULL COMMENT '优先权', + `TRIGGER_STATE` varchar(16) COLLATE utf8_bin NOT NULL COMMENT '触发器状态', + `TRIGGER_TYPE` varchar(8) COLLATE utf8_bin NOT NULL COMMENT '触发器类型', + `START_TIME` bigint(13) NOT NULL COMMENT '开始时间', + `END_TIME` bigint(13) DEFAULT NULL COMMENT '结束时间', + `CALENDAR_NAME` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '日历名称', + `MISFIRE_INSTR` smallint(2) DEFAULT NULL COMMENT '失败次数', + `JOB_DATA` blob COMMENT '作业数据', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + KEY `SCHED_NAME` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`), + CONSTRAINT `qrtz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `qrtz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='触发器的基本信息'; + + + +-- 导出 表 ca-cim-ap.qrtz_blob_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_blob_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `BLOB_DATA` blob COMMENT '保存triggers一些信息', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `qrtz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='自定义触发器'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_calendars 结构 +CREATE TABLE IF NOT EXISTS `qrtz_calendars` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `CALENDAR_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `CALENDAR` blob NOT NULL COMMENT '日曆信息', + PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='日曆資訊'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_cron_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_cron_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `CRON_EXPRESSION` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '时间表达式', + `TIME_ZONE_ID` varchar(80) COLLATE utf8_bin DEFAULT NULL COMMENT '时区ID', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `qrtz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存储 Cron Trigger,包括Cron表达式和时区信息'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_fired_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_fired_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `ENTRY_ID` varchar(95) COLLATE utf8_bin NOT NULL COMMENT '组标识', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `INSTANCE_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '当前实例的名称', + `FIRED_TIME` bigint(13) NOT NULL COMMENT '当前执行时间', + `SCHED_TIME` decimal(28,0) DEFAULT NULL COMMENT '计划时间', + `PRIORITY` int(11) NOT NULL COMMENT '权重', + `STATE` varchar(16) COLLATE utf8_bin NOT NULL COMMENT '状态', + `JOB_NAME` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '作业名称', + `JOB_GROUP` varchar(200) COLLATE utf8_bin DEFAULT NULL COMMENT '作业组', + `IS_NONCONCURRENT` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '是否并行', + `REQUESTS_RECOVERY` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT '是否要求唤醒', + PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='保存已经触发的触发器状态信息'; + + + +-- 导出 表 ca-cim-ap.qrtz_locks 结构 +CREATE TABLE IF NOT EXISTS `qrtz_locks` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `LOCK_NAME` varchar(40) COLLATE utf8_bin NOT NULL COMMENT '锁名称', + PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存储程序的悲观锁的信息'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_paused_trigger_grps 结构 +CREATE TABLE IF NOT EXISTS `qrtz_paused_trigger_grps` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存放暂停掉的触发器'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_scheduler_state 结构 +CREATE TABLE IF NOT EXISTS `qrtz_scheduler_state` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `INSTANCE_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '实例名称', + `LAST_CHECKIN_TIME` bigint(13) NOT NULL COMMENT '最后的检查时间', + `CHECKIN_INTERVAL` bigint(13) NOT NULL COMMENT '检查间隔', + PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存储少量的有关 Scheduler 的状态信息,和别的Scheduler实例'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_simple_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_simple_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `REPEAT_COUNT` bigint(7) NOT NULL COMMENT '重复次数', + `REPEAT_INTERVAL` bigint(12) NOT NULL COMMENT '重复间隔', + `TIMES_TRIGGERED` bigint(10) NOT NULL COMMENT '触发次数', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `qrtz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存储简单的Trigger,包括重复次数,间隔,以及已触的次数'; + +-- 数据导出被取消选择。 + +-- 导出 表 ca-cim-ap.qrtz_simprop_triggers 结构 +CREATE TABLE IF NOT EXISTS `qrtz_simprop_triggers` ( + `SCHED_NAME` varchar(120) COLLATE utf8_bin NOT NULL COMMENT '计划名称', + `TRIGGER_NAME` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器名称', + `TRIGGER_GROUP` varchar(200) COLLATE utf8_bin NOT NULL COMMENT '触发器组', + `STR_PROP_1` varchar(512) COLLATE utf8_bin DEFAULT NULL COMMENT 'String參數1', + `STR_PROP_2` varchar(512) COLLATE utf8_bin DEFAULT NULL COMMENT 'String參數2', + `STR_PROP_3` varchar(512) COLLATE utf8_bin DEFAULT NULL COMMENT 'String參數3', + `INT_PROP_1` int(11) DEFAULT NULL COMMENT 'Integer參數1', + `INT_PROP_2` int(11) DEFAULT NULL COMMENT 'Integer參數2', + `LONG_PROP_1` bigint(20) DEFAULT NULL COMMENT 'Long參數1', + `LONG_PROP_2` bigint(20) DEFAULT NULL COMMENT 'Long參數2', + `DEC_PROP_1` decimal(13,4) DEFAULT NULL COMMENT 'Decimal參數1', + `DEC_PROP_2` decimal(13,4) DEFAULT NULL COMMENT 'Decimal參數2', + `BOOL_PROP_1` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT 'Boolean參數1', + `BOOL_PROP_2` varchar(1) COLLATE utf8_bin DEFAULT NULL COMMENT 'Boolean參數2', + PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`), + CONSTRAINT `qrtz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `qrtz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='存储简单的Trigger屬性信息'; + +-- 数据导出被取消选择。 +-- 导出 表 ca-cim-ap.undo_log 结构 +CREATE TABLE IF NOT EXISTS `undo_log` ( + `branch_id` bigint(20) NOT NULL COMMENT 'branch transaction id', + `xid` varchar(100) NOT NULL COMMENT 'global transaction id', + `context` varchar(128) NOT NULL COMMENT 'undo_log context,such as serialization', + `rollback_info` longblob NOT NULL COMMENT 'rollback info', + `log_status` int(11) NOT NULL COMMENT '0:normal status,1:defense status', + `log_created` datetime(6) NOT NULL COMMENT 'create datetime', + `log_modified` datetime(6) NOT NULL COMMENT 'modify datetime', + UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='AT transaction mode undo table'; + +-- 数据导出被取消选择。 diff --git a/doc/sql-dap/dap-5.2.0.1002-dml.sql b/doc/sql-dap/dap-5.2.0.1002-dml.sql new file mode 100644 index 0000000..39c3bdd --- /dev/null +++ b/doc/sql-dap/dap-5.2.0.1002-dml.sql @@ -0,0 +1,221 @@ +-- -------------------------------------------------------- +-- 主机: 172.16.102.34 +-- 服务器版本: 5.7.38 - MySQL Community Server (GPL) +-- 服务器操作系统: Win64 +-- HeidiSQL 版本: 12.3.0.6589 +-- -------------------------------------------------------- + +-- 正在导出表 ca-cim-ap.dw_platform_info 的数据:~1 rows (大约) +INSERT INTO `dw_platform_info` (`version`, `isTenant`, `versionDate`, `updateDate`) VALUES + ('5.2.0.1002', 'Y', '2023-01-16', '2023-02-21'); + +-- 正在导出表 ca-cim-ap.dw_query_info 的数据:~0 rows (大约) + +-- 正在导出表 ca-cim-ap.dw_rdbms_fields 的数据:~175 rows (大约) +INSERT INTO `dw_rdbms_fields` (`TABLE_NAME`, `SEQ`, `FIELD_NAME`, `IS_KEY`, `FIELD_TYPE`, `STATUS_CODE`, `FIELD_DISPLAY_NAME`, `SCALE`, `DEFAULT_VALUE`, `NULLABLE`, `IS_VERSION`, `SIZE`, `IS_AUTO_INCREMENT`) VALUES + ('dw_app_update', 4, 'allow_upd_expr', 'N', 'varchar', 'Y', 'allow_upd_expr', '0', '', 'N', 'N', '20', 'N'), + ('dw_app_update', 3, 'allow_upd_version', 'N', 'varchar', 'Y', 'allow_upd_version', '0', '', 'N', 'N', '2000', 'N'), + ('dw_app_prod', 1, 'app_code', 'Y', 'varchar', 'Y', 'app_code', '0', '', 'N', 'N', '20', 'N'), + ('dw_app_release', 1, 'app_code', 'Y', 'varchar', 'Y', 'app_code', '0', '', 'N', 'N', '20', 'N'), + ('dw_app_update', 1, 'app_code', 'Y', 'varchar', 'Y', 'app_code', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_time', 6, 'assign_time', 'N', 'varchar', 'Y', 'assign_time', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 26, 'byday', 'N', 'varchar', 'Y', 'byday', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 28, 'bymonthday', 'N', 'varchar', 'Y', 'bymonthday', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 29, 'byweeklyday', 'N', 'varchar', 'Y', 'byweeklyday', '0', '', 'Y', 'N', '255', 'N'), + ('dw_log_operation', 7, 'client_ip', 'N', 'varchar', 'N', 'client_ip', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 10, 'client_ip', 'N', 'varchar', 'N', 'client_ip', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_sql', 6, 'cmd_parameters', 'N', 'text', 'N', 'cmd_parameters', '0', '', 'Y', 'N', '1000', 'N'), + ('dw_log_operation_sql', 7, 'cmd_seq', 'N', 'INT', 'N', 'cmd_seq', '0', '', 'Y', 'N', '11', 'N'), + ('dw_log_operation_sql', 5, 'cmd_statement', 'N', 'text', 'N', 'cmd_statement', '0', '', 'Y', 'N', '1000', 'N'), + ('dw_log_operation_sql', 4, 'cmd_table', 'N', 'varchar', 'N', 'cmd_table', '0', '', 'Y', 'N', '50', 'N'), + ('dw_menu', 4, 'code', 'N', 'varchar', 'Y', 'code', '0', '', 'Y', 'N', '200', 'N'), + ('dw_custom_column', 4, 'config', 'N', 'varchar', 'Y', 'config', '0', '', 'Y', 'N', '500', 'N'), + ('dw_log_operation', 13, 'create_name', 'N', 'varchar', 'N', 'create_name', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 16, 'create_name', 'N', 'varchar', 'N', 'create_name', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_sql', 8, 'create_name', 'N', 'varchar', 'N', 'create_name', '0', '', 'Y', 'N', '50', 'N'), + ('dw_log_operation', 15, 'create_time', 'N', 'datetime', 'N', 'create_time', '0', '', 'N', 'N', NULL, 'N'), + ('dw_log_operation_error', 15, 'create_time', 'N', 'datetime', 'N', 'create_time', '0', '', 'N', 'N', NULL, 'N'), + ('dw_theme_filelog', 2, 'create_time', 'N', 'timestamp', 'Y', 'create_time', '0', '', 'N', 'N', '0', 'N'), + ('dw_schedule_time', 24, 'daily', 'N', 'INT', 'Y', 'daily', '0', '', 'Y', 'N', '10', 'N'), + ('dw_schedule_time', 5, 'day_of_month', 'N', 'varchar', 'Y', 'day_of_month', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 13, 'day_radio', 'N', 'varchar', 'Y', 'day_radio', '0', '', 'Y', 'N', '1', 'N'), + ('dw_menu', 7, 'default_expand', 'N', 'number', 'Y', 'default_expand', '0', '0', 'Y', 'N', '1', 'N'), + ('dw_app_prod', 2, 'description', 'N', 'varchar', 'Y', 'description', '0', '', 'N', 'N', '200', 'N'), + ('dw_schedule', 6, 'description', 'N', 'varchar', 'Y', 'description', '0', '', 'Y', 'N', '100', 'N'), + ('dw_schedule', 7, 'effective_time', 'N', 'datetime', 'Y', 'effective_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_schedule', 5, 'enable_status', 'N', 'varchar', 'Y', 'enable_status', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_record', 8, 'end_time', 'N', 'datetime', 'Y', 'end_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_schedule_time', 21, 'end_time', 'N', 'datetime', 'Y', 'end_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_log_operation_error', 6, 'error_message', 'N', 'varchar', 'N', 'error_message', '0', '', 'N', 'N', '2000', 'N'), + ('dw_log_operation_error', 5, 'error_type', 'N', 'varchar', 'N', 'error_type', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_time', 31, 'exclude_date', 'N', 'varchar', 'Y', 'exclude_date', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 32, 'exclude_time', 'N', 'varchar', 'Y', 'exclude_time', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_record', 1, 'execute_id', 'Y', 'varchar', 'Y', 'execute_id', '0', '', 'N', 'N', '128', 'N'), + ('dw_schedule_record', 4, 'execute_status', 'N', 'varchar', 'Y', 'execute_status', '0', '', 'Y', 'N', '10', 'N'), + ('dw_schedule_record', 14, 'executor', 'N', 'varchar', 'Y', 'executor', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule', 8, 'expire_time', 'N', 'datetime', 'Y', 'expire_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_app_release', 4, 'file_id', 'N', 'varchar', 'Y', 'file_id', '0', '', 'N', 'N', '200', 'N'), + ('dw_app_release', 6, 'file_name', 'N', 'varchar', 'Y', 'file_name', '0', '', 'N', 'N', '200', 'N'), + ('dw_app_release', 3, 'file_seq', 'Y', 'number', 'Y', 'file_seq', '0', '', 'N', 'N', '10', 'N'), + ('dw_theme_filelog', 1, 'fileid', 'Y', 'varchar', 'Y', 'fileid', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule_time', 17, 'frequency', 'N', 'varchar', 'Y', 'frequency', '0', '', 'Y', 'N', '10', 'N'), + ('dw_schedule_time', 8, 'holiday', 'N', 'varchar', 'Y', 'holiday', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 23, 'hourly', 'N', 'INT', 'Y', 'hourly', '0', '', 'Y', 'N', '10', 'N'), + ('dw_menu', 6, 'icon_class', 'N', 'varchar', 'Y', 'icon_class', '0', '', 'Y', 'N', '200', 'N'), + ('dw_menu', 1, 'id', 'Y', 'varchar', 'Y', 'id', '0', '', 'N', 'N', '100', 'N'), + ('dw_schedule_contact', 1, 'id', 'Y', 'number', 'Y', 'id', '0', '', 'N', 'N', '10', 'N'), + ('dw_log_operation', 9, 'input_value', 'N', 'text', 'N', 'input_value', '0', '', 'N', 'N', '4000', 'N'), + ('dw_log_operation_error', 12, 'input_value', 'N', 'text', 'N', 'input_value', '0', '', 'N', 'N', '4000', 'N'), + ('dw_schedule_time', 12, 'is_allow_concurrent', 'N', 'varchar', 'Y', 'is_allow_concurrent', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_record', 12, 'is_misfire', 'N', 'varchar', 'Y', 'is_misfire', '0', 'N', 'N', 'N', '1', 'N'), + ('dw_schedule_time', 34, 'is_retry', 'N', 'varchar', 'Y', 'is_retry', '0', '', 'N', 'N', '1', 'N'), + ('dw_schedule', 3, 'job_name', 'N', 'varchar', 'Y', 'job_name', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule_record', 3, 'job_name', 'N', 'varchar', 'Y', 'job_name', '0', '', 'N', 'N', '50', 'N'), + ('dw_menu_language', 2, 'language', 'Y', 'varchar', 'Y', 'language', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule', 13, 'last_period_time', 'N', 'number', 'Y', 'last_period_time', '0', '', 'Y', 'N', '10', 'N'), + ('dw_schedule', 12, 'last_success_time', 'N', 'datetime', 'Y', 'last_success_time', '0', '', 'Y', 'N', NULL, 'N'), + ('dw_myhome', 2, 'level', 'Y', 'varchar', 'N', 'level', '', '', 'N', 'N', '255', 'N'), + ('dw_myhome_parameter', 2, 'level', 'Y', 'varchar', 'N', 'level', '', '', 'N', 'N', '255', 'N'), + ('dw_log_operation', 1, 'log_id', 'Y', 'varchar', 'N', 'id', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 1, 'log_id', 'Y', 'varchar', 'N', 'id', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_sql', 1, 'log_id', 'Y', 'varchar', 'N', 'log_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_sql', 3, 'log_type', 'N', 'INT', 'N', 'log_type', '0', '', 'Y', 'N', '4', 'N'), + ('dw_schedule_contact', 5, 'mail_content', 'N', 'number', 'Y', 'mail_content', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_contact', 4, 'mail_subject', 'N', 'number', 'Y', 'mail_subject', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_contact', 3, 'mail_type', 'N', 'number', 'Y', 'mail_type', '0', '', 'Y', 'N', '10', 'N'), + ('dw_schedule', 9, 'max_runtime', 'N', 'number', 'Y', 'max_runtime', '0', '', 'Y', 'N', '10', 'N'), + ('dw_log_operation', 5, 'menu', 'N', 'varchar', 'N', 'menu', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 8, 'menu', 'N', 'varchar', 'N', 'operate_type', '0', '', 'N', 'N', '50', 'N'), + ('dw_menu_language', 1, 'menu_id', 'Y', 'varchar', 'Y', 'menu_id', '0', '', 'N', 'N', '100', 'N'), + ('dw_menu_parameter', 1, 'menu_id', 'Y', 'varchar', 'Y', 'menu_id', '0', '', 'N', 'N', '100', 'N'), + ('dw_schedule_record', 5, 'message', 'N', 'TEXT', 'Y', 'message', '0', '', 'Y', 'N', NULL, 'N'), + ('dw_schedule_record', 6, 'message_detail', 'N', 'varchar', 'Y', 'message_detail', '0', '', 'Y', 'N', '255', 'N'), + ('dw_theme_filelog', 3, 'messege', 'N', 'varchar', 'Y', 'messege', '0', '', 'Y', 'N', '500', 'N'), + ('dw_schedule_time', 22, 'minutely', 'N', 'INT', 'Y', 'minutely', '0', '', 'Y', 'N', '10', 'N'), + ('dw_log_operation', 6, 'module', 'N', 'varchar', 'N', 'module', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 9, 'module', 'N', 'varchar', 'N', 'module', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule', 17, 'module_name', 'N', 'varchar', 'Y', 'module_name', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule_time', 2, 'month', 'N', 'varchar', 'Y', 'month', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 14, 'month_radio', 'N', 'varchar', 'Y', 'month_radio', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_time', 27, 'monthly', 'N', 'INT', 'Y', 'monthly', '0', '', 'Y', 'N', '10', 'N'), + ('dw_menu_language', 3, 'name', 'N', 'varchar', 'Y', 'name', '0', '', 'Y', 'N', '200', 'N'), + ('dw_menu_parameter', 2, 'name', 'Y', 'varchar', 'Y', 'name', '0', '', 'N', 'N', '200', 'N'), + ('dw_myhome_parameter', 3, 'name', 'Y', 'varchar', 'N', 'name', '', '', 'N', 'N', '200', 'N'), + ('dw_schedule', 14, 'next_execute_time', 'N', 'datetime', 'Y', 'next_execute_time', '0', '', 'Y', 'N', NULL, 'N'), + ('dw_menu', 9, 'open_mode', 'N', 'varchar', 'Y', 'open_mode', '0', '', 'Y', 'N', '50', 'N'), + ('dw_log_operation', 4, 'operate_desc', 'N', 'varchar', 'N', 'operate_desc', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 4, 'operate_desc', 'N', 'varchar', 'N', 'operate_desc', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation', 2, 'operate_no', 'N', 'varchar', 'N', 'operate_no', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 2, 'operate_no', 'N', 'varchar', 'N', 'operate_no', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation', 3, 'operate_type', 'N', 'varchar', 'N', 'operate_type', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation_error', 3, 'operate_type', 'N', 'varchar', 'N', 'operate_type', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation_sql', 2, 'operation_log_id', 'Y', 'varchar', 'N', 'operation_log_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_query_info', 5, 'owner', 'N', 'varchar', 'Y', 'owner', '0', '', 'Y', 'N', '45', 'N'), + ('dw_menu', 3, 'parent_id', 'N', 'varchar', 'Y', 'parent_id', '0', '', 'Y', 'N', '100', 'N'), + ('dw_myhome', 4, 'path', 'N', 'varchar', 'N', 'path', '', '', 'Y', 'N', '2000', 'N'), + ('dw_log_operation_error', 18, 'prog_impl', 'N', 'varchar', 'N', 'function', '0', '', 'N', 'N', '200', 'N'), + ('dw_schedule', 16, 'program_code', 'N', 'varchar', 'Y', 'program_code', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule_record', 12, 'program_code', 'N', 'varchar', 'Y', 'program_code', '0', '', 'Y', 'N', '50', 'N'), + ('dw_theme', 2, 'prop', 'Y', 'varchar', 'Y', 'prop', '0', '', 'N', 'N', '50', 'N'), + ('dw_query_info', 4, 'publish', 'N', 'varchar', 'Y', 'publish', '0', '', 'Y', 'N', '45', 'N'), + ('dw_app_release', 5, 'published', 'N', 'varchar', 'Y', 'published', '0', '', 'N', 'N', '1', 'N'), + ('dw_query_info', 1, 'query_id', 'Y', 'varchar', 'Y', 'query_id', '0', '', 'N', 'N', '45', 'N'), + ('dw_query_info', 2, 'query_type', 'N', 'varchar', 'Y', 'query_type', '0', '', 'N', 'N', '45', 'N'), + ('dw_schedule_contact', 6, 'receiver_email', 'N', 'number', 'Y', 'receiver_email', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule', 11, 'recent_status', 'N', 'varchar', 'Y', 'recent_status', '0', '', 'Y', 'N', '255', 'N'), + ('dw_log_operation', 14, 'remark', 'N', 'varchar', 'N', 'remark', '0', '', 'N', 'N', '1000', 'N'), + ('dw_schedule_time', 18, 'repeat_count', 'N', 'number', 'Y', 'repeat_count', '0', '', 'Y', 'N', '65', 'N'), + ('dw_schedule_time', 19, 'repeat_type', 'N', 'varchar', 'Y', 'repeat_type', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_time', 33, 'retry_after_misfire_sec', 'N', 'INT', 'Y', 'retry_after_misfire_sec', '0', '', 'Y', 'N', '10', 'N'), + ('dw_log_operation', 10, 'return_value', 'N', 'text', 'N', 'return_value', '0', '', 'N', 'N', '4000', 'N'), + ('dw_log_operation_error', 13, 'return_value', 'N', 'text', 'N', 'return_value', '0', '', 'N', 'N', '4000', 'N'), + ('dw_schedule', 1, 'schedule_id', 'Y', 'varchar', 'Y', 'schedule_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule_contact', 2, 'schedule_id', 'N', 'number', 'Y', 'schedule_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule_record', 2, 'schedule_id', 'N', 'varchar', 'Y', 'schedule_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule_time', 1, 'schedule_id', 'Y', 'varchar', 'Y', 'schedule_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_schedule', 2, 'schedule_name', 'N', 'varchar', 'Y', 'schedule_name', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule_record', 13, 'schedule_name', 'N', 'varchar', 'Y', 'schedule_name', '0', '', 'Y', 'N', '50', 'N'), + ('dw_schedule', 10, 'schedule_param', 'N', 'TEXT', 'Y', 'schedule_param', '0', '', 'Y', 'N', NULL, 'N'), + ('dw_schedule_record', 9, 'schedule_param', 'N', 'TEXT', 'Y', 'schedule_param', '0', '', 'Y', 'N', NULL, 'N'), + ('dw_schedule', 4, 'schedule_type', 'N', 'varchar', 'Y', 'schedule_type', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_record', 10, 'schedule_type', 'N', 'varchar', 'Y', 'schedule_type', '0', '', 'Y', 'N', '1', 'N'), + ('dw_schedule_contact', 7, 'send_condition', 'N', 'number', 'Y', 'send_condition', '0', '', 'Y', 'N', '50', 'N'), + ('dw_menu', 5, 'sequence', 'N', 'number', 'Y', 'sequence', '0', '', 'N', 'N', '20', 'N'), + ('dw_query_info', 3, 'sql_statement', 'N', 'varchar', 'Y', 'sql_statement', '0', '', 'N', 'N', '450', 'N'), + ('dw_schedule_record', 7, 'start_time', 'N', 'datetime', 'Y', 'start_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_schedule_time', 20, 'start_time', 'N', 'datetime', 'Y', 'start_time', '0', '', 'Y', 'N', '20', 'N'), + ('dw_log_operation', 12, 'status', 'N', 'INT', 'Y', 'status', '0', '', 'N', 'N', '4', 'N'), + ('dw_custom_column', 2, 'table_id', 'Y', 'varchar', 'Y', 'table_id', '0', '', 'N', 'N', '50', 'N'), + ('dw_custom_column', 1, 'tenantsid', 'Y', 'bigint', 'Y', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation', 19, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation_error', 19, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation_sql', 9, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_myhome', 6, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '', '', 'N', 'N', '20', 'N'), + ('dw_myhome_parameter', 5, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '', '', 'N', 'N', '20', 'N'), + ('dw_schedule', 15, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_contact', 8, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_record', 11, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_time', 30, 'tenantsid', 'Y', 'bigint', 'N', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_theme', 1, 'tenantsid', 'Y', 'bigint', 'Y', 'tenantsid', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_time', 7, 'time', 'N', 'varchar', 'Y', 'time', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 9, 'time1', 'N', 'varchar', 'Y', 'time1', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 10, 'time2', 'N', 'varchar', 'Y', 'time2', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 11, 'time3', 'N', 'varchar', 'Y', 'time3', '0', '', 'Y', 'N', '255', 'N'), + ('dw_log_operation', 11, 'time_consume', 'N', 'bigint', 'N', 'time_consume', '0', '', 'N', 'N', '20', 'N'), + ('dw_log_operation_error', 14, 'time_consume', 'N', 'bigint', 'N', 'time_consume', '0', '', 'N', 'N', '20', 'N'), + ('dw_schedule_time', 15, 'time_radio', 'N', 'varchar', 'Y', 'time_radio', '0', '', 'Y', 'N', '1', 'N'), + ('dw_log_operation', 18, 'traceid', 'N', 'varchar', 'N', 'traceid', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation_error', 17, 'traceid', 'N', 'varchar', 'N', 'traceid', '0', '', 'N', 'N', '50', 'N'), + ('dw_menu', 2, 'type', 'N', 'varchar', 'Y', 'type', '0', '', 'N', 'N', '50', 'N'), + ('dw_myhome', 3, 'type', 'N', 'varchar', 'N', 'type', '', '', 'Y', 'N', '20', 'N'), + ('dw_log_operation', 16, 'update_name', 'N', 'varchar', 'N', 'update_name', '0', '', 'N', 'N', '50', 'N'), + ('dw_log_operation', 17, 'update_time', 'N', 'datetime', 'N', 'update_time', '0', '', 'N', 'N', NULL, 'N'), + ('dw_log_operation', 8, 'url', 'N', 'varchar', 'N', 'url', '0', '', 'N', 'N', '1000', 'N'), + ('dw_log_operation_error', 11, 'url', 'N', 'varchar', 'N', 'url', '0', '', 'N', 'N', '1000', 'N'), + ('dw_menu', 8, 'url', 'N', 'varchar', 'Y', 'url', '0', '', 'Y', 'N', '2000', 'N'), + ('dw_custom_column', 3, 'userid', 'Y', 'varchar', 'Y', 'userid', '0', '', 'N', 'N', '50', 'N'), + ('dw_myhome', 1, 'userid', 'Y', 'varchar', 'N', 'userid', '', '', 'N', 'N', '40', 'N'), + ('dw_myhome_parameter', 1, 'userid', 'Y', 'varchar', 'N', 'userid', '', '', 'N', 'N', '40', 'N'), + ('dw_theme', 4, 'userid', 'N', 'varchar', 'Y', 'userid', '0', '', 'Y', 'N', '50', 'N'), + ('dw_menu_parameter', 3, 'value', 'N', 'varchar', 'Y', 'value', '0', '', 'Y', 'N', '200', 'N'), + ('dw_myhome_parameter', 4, 'value', 'N', 'varchar', 'N', 'value', '', '', 'Y', 'N', '200', 'N'), + ('dw_theme', 3, 'value', 'N', 'varchar', 'Y', 'value', '0', '', 'Y', 'N', '500', 'N'), + ('dw_app_release', 2, 'version', 'Y', 'varchar', 'Y', 'version', '0', '', 'N', 'N', '20', 'N'), + ('dw_app_update', 2, 'version', 'Y', 'varchar', 'Y', 'version', '0', '', 'N', 'N', '20', 'N'), + ('dw_menu', 10, 'version', 'N', 'number', 'Y', 'version', '0', '', 'N', 'Y', '20', 'N'), + ('dw_myhome', 5, 'version', 'N', 'int', 'N', 'version', '', '', 'Y', 'Y', '11', 'N'), + ('dw_schedule_time', 4, 'week', 'N', 'varchar', 'Y', 'week', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 3, 'week_of_month', 'N', 'varchar', 'Y', 'week_of_month', '0', '', 'Y', 'N', '255', 'N'), + ('dw_schedule_time', 16, 'week_radio', 'N', 'varchar', 'Y', 'week_radio', '0', '', 'N', 'N', '1', 'N'), + ('dw_schedule_time', 25, 'weekly', 'N', 'INT', 'Y', 'weekly', '0', '', 'Y', 'N', '10', 'N'); + +-- 正在导出表 ca-cim-ap.dw_rdbms_relations 的数据:~6 rows (大约) +INSERT INTO `dw_rdbms_relations` (`PRIMARY_TABLE_NO`, `REFERENCE_TABLE_NO`, `PRIMARY_TABLE_PK`, `REFERENCE_TABLE_PK`, `TYPE`) VALUES + ('dw_app_prod', 'dw_app_release', 'app_code', 'app_code', NULL), + ('dw_app_prod', 'dw_app_update', 'app_code', 'app_code', NULL), + ('dw_log_operation', 'dw_log_operation_sql', 'log_id', 'operation_log_id', NULL), + ('dw_menu', 'dw_menu_language', 'id', 'menu_id', NULL), + ('dw_menu', 'dw_menu_parameter', 'id', 'menu_id', NULL), + ('dw_myhome', 'dw_myhome_parameter', 'tenantsid,userid,level', 'tenantsid,userid,level', NULL); + +-- 正在导出表 ca-cim-ap.dw_rdbms_tables 的数据:~18 rows (大约) +INSERT INTO `dw_rdbms_tables` (`table_name`, `table_display_name`, `table_description`, `delete_constraint`, `hint_field`, `insert_default_value`, `update_default_value`) VALUES + ('dw_app_prod', 'dw_app_prod', '應用產品線', 'N', NULL, 'N', 'N'), + ('dw_app_release', 'dw_app_release', '應用版本發布與釋出', 'N', NULL, 'N', 'N'), + ('dw_app_update', 'dw_app_update', '應用更新版本對應', 'N', NULL, 'N', 'N'), + ('dw_custom_column', '個性化欄位表', '個性化欄位表', 'N', NULL, 'N', 'N'), + ('dw_log_operation', 'dw_log_operation', '操作日誌', 'N', NULL, 'N', 'N'), + ('dw_log_operation_error', 'dw_log_operation_error', '操作異常日誌', 'N', NULL, 'N', 'N'), + ('dw_log_operation_sql', 'dw_log_operation_sql', '操作日誌SQL', 'N', NULL, 'N', 'N'), + ('dw_menu', 'dw_menu', '菜单', 'N', NULL, 'N', 'N'), + ('dw_menu_language', 'dw_menu_language', '菜单多语言', 'N', NULL, 'N', 'N'), + ('dw_menu_parameter', 'dw_menu_parameter', '菜单参数', 'N', NULL, 'N', 'N'), + ('dw_myhome', 'dw_myhome', '自定義首頁主表', 'N', NULL, 'N', 'N'), + ('dw_myhome_parameter', 'dw_myhomedw_parameter', '自定義首頁參數表', 'N', NULL, 'N', 'N'), + ('dw_schedule', '排程表', '排程表', 'N', NULL, 'N', 'N'), + ('dw_schedule_contact', '排程寄信通知表', '排程寄信通知表', 'N', NULL, 'N', 'N'), + ('dw_schedule_record', '排程執行記錄', '排程執行記錄', 'N', NULL, 'N', 'N'), + ('dw_schedule_time', '排程執行時間設定檔', '排程執行時間設定檔', 'N', NULL, 'N', 'N'), + ('dw_theme', '企業主題主表', '企業主題主表', 'N', NULL, 'N', 'N'), + ('dw_theme_filelog', '企業主題文件上傳日誌', '企業主題文件上傳日誌', 'N', NULL, 'N', 'N'); + diff --git a/doc/sql/app-yyyyMMdd-ddl.sql b/doc/sql/app-yyyyMMdd-ddl.sql new file mode 100644 index 0000000..bcb97cf --- /dev/null +++ b/doc/sql/app-yyyyMMdd-ddl.sql @@ -0,0 +1 @@ +-- cim_wo_routing 工单工艺数据 diff --git a/version_control/APP_VERSION b/version_control/APP_VERSION new file mode 100644 index 0000000..3eefcb9 --- /dev/null +++ b/version_control/APP_VERSION @@ -0,0 +1 @@ +1.0.0 diff --git a/version_control/BUILD b/version_control/BUILD new file mode 100644 index 0000000..5ed13cb --- /dev/null +++ b/version_control/BUILD @@ -0,0 +1 @@ +1002 \ No newline at end of file diff --git a/version_control/Makefile b/version_control/Makefile new file mode 100644 index 0000000..f60617b --- /dev/null +++ b/version_control/Makefile @@ -0,0 +1,58 @@ +#版本檔案 +LAST_APP_VERSION_FILE=APP_VERSION +BUILD_VERSION_FILE=BUILD + +#版本變數 +VERSION:=$(shell cat ../VERSION) +#打包起始版本 -1 +INIT_BUILD_VERSION=999 +BUILD_VERSION=$(shell echo $(shell cat $(BUILD_VERSION_FILE))+1 | bc) +export APP_VERSION=$(shell cat $(LAST_APP_VERSION_FILE)) +#Git +GIT_CMD=git +GIT_BRANCH=$(GIT_CMD) branch +GIT_ADD=$(GIT_CMD) add +GIT_COMMIT=$(GIT_CMD) commit +GIT_PUSH=$(GIT_CMD) push -f +GIT_CURRENT_BRANCH=$$branch +GIT_TAG=$(GIT_CMD) tag +# Pure targets. +#.PHONY: all +all: check_version_file_is_exist check_version add_version write_tag_to_file +#初始化 build version 檔案 +init_build_version: + touch $(BUILD_VERSION_FILE) + echo $(INIT_BUILD_VERSION) > $(BUILD_VERSION_FILE) + echo "BUILD_VERSION = " BUILD_VERSION +#初始化 app version +init_app_version: + touch $(LAST_APP_VERSION_FILE) + echo $(VERSION) > $(LAST_APP_VERSION_FILE) + +#檢查版本檔案是否存在 +check_version_file_is_exist: +ifeq "$(wildcard $(BUILD_VERSION_FILE))" "" + @make init_build_version +endif +ifeq "$(wildcard $(LAST_APP_VERSION_FILE))" "" + @make init_app_version +endif + +#檢查版本 +check_version: + @if [ $(shell cat $(LAST_APP_VERSION_FILE)) != $(VERSION) ]; then\ + make init_app_version;\ + make init_build_version;\ + fi +add_version: + echo $(BUILD_VERSION) > $(BUILD_VERSION_FILE) +commit_record: + $(GIT_ADD) $(LAST_APP_VERSION_FILE) + $(GIT_ADD) $(BUILD_VERSION_FILE) + $(GIT_COMMIT) -m "auto increment build version $(shell cat BUILD) [CI SKIP]" + $(GIT_PUSH) origin HEAD:"$(GIT_CURRENT_BRANCH)" +add_tag: + $(GIT_TAG) -a v$(shell cat APP_VERSION).$(shell cat BUILD) -m "auto increment build version v$(shell cat APP_VERSION).$(shell cat BUILD)" + $(GIT_PUSH) origin v$(shell cat APP_VERSION).$(shell cat BUILD) +write_tag_to_file: + echo "$(shell cat APP_VERSION).$(shell cat BUILD)" > ../.tags \ No newline at end of file