diff --git a/maf-mis/maf-mis-biz/pom.xml b/maf-mis/maf-mis-biz/pom.xml new file mode 100644 index 00000000..7186728b --- /dev/null +++ b/maf-mis/maf-mis-biz/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + maf-mis-biz + Muscle and Fitness Server :: MAF MIS - Biz + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + + + + com.jmsoftware.maf + maf-mis-domain + + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java similarity index 77% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java rename to maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java index 9b022096..145b2bf2 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java +++ b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/controller/ExerciseController.java @@ -2,8 +2,8 @@ import cn.hutool.core.bean.BeanUtil; import com.jmsoftware.maf.common.bean.ResponseBodyBean; -import com.jmsoftware.maf.mafmis.exercise.domain.ExercisePo; -import com.jmsoftware.maf.mafmis.exercise.domain.GetPageListPayload; +import com.jmsoftware.maf.mafmis.exercise.persistence.Exercise; +import com.jmsoftware.maf.mafmis.exercise.payload.GetPageListPayload; import com.jmsoftware.maf.mafmis.exercise.service.ExerciseService; import lombok.RequiredArgsConstructor; import lombok.val; @@ -29,13 +29,13 @@ public class ExerciseController { private final ExerciseService exerciseService; @GetMapping("/get-by-id") - public ResponseBodyBean selectOne(Long id) { + public ResponseBodyBean selectOne(Long id) { return ResponseBodyBean.ofSuccess(this.exerciseService.queryById(id)); } @GetMapping("/get-page-list") - public ResponseBodyBean> getPageList(@Valid GetPageListPayload payload) { - val exercisePo = new ExercisePo(); + public ResponseBodyBean> getPageList(@Valid GetPageListPayload payload) { + val exercisePo = new Exercise(); BeanUtil.copyProperties(payload, exercisePo); return ResponseBodyBean.ofSuccess(this.exerciseService.getPageList(exercisePo)); } diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java similarity index 78% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java rename to maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java index c650e522..734b275e 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java +++ b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/ExerciseService.java @@ -1,6 +1,6 @@ package com.jmsoftware.maf.mafmis.exercise.service; -import com.jmsoftware.maf.mafmis.exercise.domain.ExercisePo; +import com.jmsoftware.maf.mafmis.exercise.persistence.Exercise; import java.util.List; @@ -19,7 +19,7 @@ public interface ExerciseService { * @param id the id * @return the exercise po */ - ExercisePo queryById(Long id); + Exercise queryById(Long id); /** * Gets page list. @@ -27,7 +27,7 @@ public interface ExerciseService { * @param exercisePo the exercise po * @return the page list */ - List getPageList(ExercisePo exercisePo); + List getPageList(Exercise exercisePo); /** * Insert exercise po. @@ -35,7 +35,7 @@ public interface ExerciseService { * @param exercisePo the exercise po * @return the exercise po */ - ExercisePo insert(ExercisePo exercisePo); + Exercise insert(Exercise exercisePo); /** * Update exercise po. @@ -43,7 +43,7 @@ public interface ExerciseService { * @param exercisePo the exercise po * @return the exercise po */ - ExercisePo update(ExercisePo exercisePo); + Exercise update(Exercise exercisePo); /** * Delete by id boolean. diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java similarity index 80% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java rename to maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java index 1e401b5b..0e719c02 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java +++ b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/exercise/service/impl/ExerciseServiceImpl.java @@ -3,7 +3,7 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jmsoftware.maf.common.exception.BizException; -import com.jmsoftware.maf.mafmis.exercise.domain.ExercisePo; +import com.jmsoftware.maf.mafmis.exercise.persistence.Exercise; import com.jmsoftware.maf.mafmis.exercise.mapper.ExerciseMapper; import com.jmsoftware.maf.mafmis.exercise.service.ExerciseService; import lombok.RequiredArgsConstructor; @@ -29,7 +29,7 @@ public class ExerciseServiceImpl implements ExerciseService { @Override @SneakyThrows - public ExercisePo queryById(Long id) { + public Exercise queryById(Long id) { if (ObjectUtil.isNull(id)) { throw new BizException("Cannot execute the query! Cause: the ID is null."); } @@ -37,21 +37,21 @@ public ExercisePo queryById(Long id) { } @Override - public List getPageList(ExercisePo exercisePo) { - var page = new Page(exercisePo.getCurrentPage(), exercisePo.getPageSize()); + public List getPageList(Exercise exercisePo) { + var page = new Page(exercisePo.getCurrentPage(), exercisePo.getPageSize()); this.exerciseMapper.selectAll(exercisePo, page); log.info("Total pages: {}", page.getPages()); return page.getRecords(); } @Override - public ExercisePo insert(ExercisePo exercisePo) { + public Exercise insert(Exercise exercisePo) { this.exerciseMapper.insert(exercisePo); return exercisePo; } @Override - public ExercisePo update(ExercisePo exercisePo) { + public Exercise update(Exercise exercisePo) { this.exerciseMapper.update(exercisePo); return this.queryById(exercisePo.getId()); } diff --git a/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/package-info.java b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/package-info.java new file mode 100644 index 00000000..7acc0501 --- /dev/null +++ b/maf-mis/maf-mis-biz/src/main/java/com/jmsoftware/maf/mafmis/package-info.java @@ -0,0 +1 @@ +package com.jmsoftware.maf.mafmis; diff --git a/maf-mis/maf-mis-bootstrap/pom.xml b/maf-mis/maf-mis-bootstrap/pom.xml new file mode 100644 index 00000000..ceaf46cf --- /dev/null +++ b/maf-mis/maf-mis-bootstrap/pom.xml @@ -0,0 +1,185 @@ + + + 4.0.0 + + + maf-mis-bootstrap + Muscle and Fitness Server :: MAF MIS - Bootstrap + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-info + compile + + build-info + + + + + + + org.apache.maven.plugins + maven-pmd-plugin + ${maven-pmd-plugin.version} + + ${project.build.sourceEncoding} + ${java.version} + true + + rulesets/java/ali-comment.xml + rulesets/java/ali-concurrent.xml + rulesets/java/ali-constant.xml + rulesets/java/ali-exception.xml + rulesets/java/ali-flowcontrol.xml + rulesets/java/ali-naming.xml + rulesets/java/ali-oop.xml + rulesets/java/ali-orm.xml + rulesets/java/ali-other.xml + rulesets/java/ali-set.xml + + + + + verify + + check + + + + + + com.alibaba.p3c + p3c-pmd + ${p3c-pmd.version} + + + + + + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin.version} + + + com.google.cloud.tools + jib-spring-boot-extension-maven + ${jib-spring-boot-extension-maven.version} + + + + + + + buildAndPushDockerImagePhase + install + + build + + + + + + + adoptopenjdk/openjdk11:${adoptopenjdk11.tag} + + + docker.io/ijohnnymiller/${project.parent.artifactId}.${project.artifactId} + + ${git.commit.id.abbrev}-${project.version} + + + + + /${project.artifactId} + + -Dfile.encoding=${project.build.sourceEncoding} + + + ${maf-mis.port} + + USE_CURRENT_TIMESTAMP + + + + + com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension + + + true + + + + + + + + + io.github.git-commit-id + git-commit-id-maven-plugin + 5.0.0 + + + get-the-git-info + + revision + + initialize + + + + true + ${project.build.outputDirectory}/git.properties + + ^git.build.(time|version)$ + ^git.commit.id.(abbrev|full)$ + + full + + + + + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + + + + + + com.jmsoftware.maf + maf-mis-web + + + com.jmsoftware.maf + maf-mis-message + + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java b/maf-mis/maf-mis-bootstrap/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java similarity index 92% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java rename to maf-mis/maf-mis-bootstrap/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java index 08bb0ca4..b43bfa18 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java +++ b/maf-mis/maf-mis-bootstrap/src/main/java/com/jmsoftware/maf/mafmis/MafMisApplication.java @@ -20,6 +20,7 @@ @EnableFeignClients @EnableDiscoveryClient @SpringBootApplication +@SuppressWarnings("scwjava_Createprivateconstructorforutilityclassallfieldsmethodsarestatic") public class MafMisApplication { public static void main(String[] args) { val stopWatch = new StopWatch(); diff --git a/maf-mis/maf-mis-bootstrap/src/main/resources/application.yml b/maf-mis/maf-mis-bootstrap/src/main/resources/application.yml new file mode 100644 index 00000000..20d94648 --- /dev/null +++ b/maf-mis/maf-mis-bootstrap/src/main/resources/application.yml @@ -0,0 +1,87 @@ +server: + port: @maf-mis.port@ + tomcat: + uri-encoding: @project.build.sourceEncoding@ + shutdown: GRACEFUL + servlet: + context-path: + +spring: + application: + name: @project.parent.artifactId@ + profiles: + active: @environment@ + config: + import: consul:${spring.cloud.consul.host}:${spring.cloud.consul.port} + cloud: + # https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/index.html#spring-cloud-consul-config + consul: + host: "should-be-passed-by-java-opts" + port: 8500 + config: + # `default-context` should not be modified, keeps "application" for common configuration. + # Properties in the config/application folder are applicable to all applications using consul for configuration. + profile-separator: "::" + format: YAML + data-key: "data" + watch: + enabled: true + delay: 1000 + prefixes: + - config + discovery: + register: true + instance-id: ${spring.application.name}-${spring.cloud.client.hostname}-${vcap.application.instance_id:${spring.application.instance_id:${random.value}}} + service-name: ${spring.application.name} + port: ${server.port} + prefer-ip-address: true + ip-address: ${spring.cloud.client.ip-address} + health-check-critical-timeout: 15s + servlet: + multipart: + # `location` specifies the directory where uploaded files will be stored. When not specified, + # a temporary directory will be used. ATTENTION: it may differ due to OS. + location: @project.parent.artifactId@/${spring.application.name}/temprary-file + # `max-file-size` specifies the maximum size permitted for uploaded files. The default is 1MB. We set it as 64 MB. + max-file-size: 64MB + # `max-request-size` specifies the maximum size allowed for multipart/form-data requests. The default is 10MB. + max-request-size: 70MB + # `file-size-threshold` specifies the size threshold after which files will be written to disk. + # The default is 0. We set it as 0 too. + file-size-threshold: 0 + +logging: + config: classpath:logback-configuration/logback-${spring.profiles.active}.xml + +maf: + project-properties: + base-package: @project.groupId@ + context-path: ${server.servlet.context-path} + group-id: @project.groupId@ + project-parent-artifact-id: @project.parent.artifactId@ + project-artifact-id: @project.artifactId@ + version: @project.version@ + description: @project.description@ + jdk-version: @java.version@ + environment: ${spring.profiles.active} + url: @project.url@ + inception-year: @inceptionYear@ + organization-name: @project.organization.name@ + organization-url: @project.organization.url@ + issue-management-system: @project.issueManagement.system@ + issue-management-url: @project.issueManagement.url@ + developer-name: @developerName@ + developer-email: @developerEmail@ + developer-url: @developerUrl@ + configuration: + ignored-url: + pattern: + - "/static/**" + - "/actuator/**" + - "/druid/**" + - "/swagger-resources/**" + - "/v2/api-docs/**" + - "/*/v2/api-docs/**" + - "/webjars/**" + - "/doc.html" + included-package-for-http-api-scan: ${maf.project-properties.base-package} diff --git a/maf-mis/src/main/resources/banner.txt b/maf-mis/maf-mis-bootstrap/src/main/resources/banner.txt similarity index 100% rename from maf-mis/src/main/resources/banner.txt rename to maf-mis/maf-mis-bootstrap/src/main/resources/banner.txt diff --git a/maf-mis/src/main/resources/logback-configuration/logback-base.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-base.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-base.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-base.xml diff --git a/maf-mis/src/main/resources/logback-configuration/logback-development-docker.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-development-docker.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-development-docker.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-development-docker.xml diff --git a/maf-mis/src/main/resources/logback-configuration/logback-development-local.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-development-local.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-development-local.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-development-local.xml diff --git a/maf-mis/src/main/resources/logback-configuration/logback-production.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-production.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-production.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-production.xml diff --git a/maf-mis/src/main/resources/logback-configuration/logback-stage.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-stage.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-stage.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-stage.xml diff --git a/maf-mis/src/main/resources/logback-configuration/logback-test.xml b/maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-test.xml similarity index 100% rename from maf-mis/src/main/resources/logback-configuration/logback-test.xml rename to maf-mis/maf-mis-bootstrap/src/main/resources/logback-configuration/logback-test.xml diff --git a/maf-mis/src/test/java/com/jmsoftware/maf/mafmis/ExercisePoMisApplicationTests.java b/maf-mis/maf-mis-bootstrap/src/test/java/com/jmsoftware/maf/mafmis/ExercisePoMisApplicationTests.java similarity index 100% rename from maf-mis/src/test/java/com/jmsoftware/maf/mafmis/ExercisePoMisApplicationTests.java rename to maf-mis/maf-mis-bootstrap/src/test/java/com/jmsoftware/maf/mafmis/ExercisePoMisApplicationTests.java diff --git a/maf-mis/maf-mis-domain/pom.xml b/maf-mis/maf-mis-domain/pom.xml new file mode 100644 index 00000000..7b4c301f --- /dev/null +++ b/maf-mis/maf-mis-domain/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + maf-mis-domain + Muscle and Fitness Server :: MAF MIS - Domain + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + + + + com.jmsoftware.maf + maf-mis-infra + + + diff --git a/maf-mis/maf-mis-domain/src/main/java/com/jmsoftware/maf/mafmis/package-info.java b/maf-mis/maf-mis-domain/src/main/java/com/jmsoftware/maf/mafmis/package-info.java new file mode 100644 index 00000000..7acc0501 --- /dev/null +++ b/maf-mis/maf-mis-domain/src/main/java/com/jmsoftware/maf/mafmis/package-info.java @@ -0,0 +1 @@ +package com.jmsoftware.maf.mafmis; diff --git a/maf-mis/maf-mis-infra/pom.xml b/maf-mis/maf-mis-infra/pom.xml new file mode 100644 index 00000000..12a89daa --- /dev/null +++ b/maf-mis/maf-mis-infra/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + + maf-mis-infra + Muscle and Fitness Server :: MAF MIS - Infra + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/osscenter/OssCenterRemoteApi.java b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/OssCenterRemoteApi.java similarity index 97% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/osscenter/OssCenterRemoteApi.java rename to maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/OssCenterRemoteApi.java index aa508416..3d540bec 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/osscenter/OssCenterRemoteApi.java +++ b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/OssCenterRemoteApi.java @@ -1,4 +1,4 @@ -package com.jmsoftware.maf.mafmis.remoteapi.osscenter; +package com.jmsoftware.maf.mafmis; import com.jmsoftware.maf.common.bean.ResponseBodyBean; import com.jmsoftware.maf.common.domain.osscenter.write.ObjectResponse; diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java similarity index 76% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java rename to maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java index a68cee4f..c7c32d45 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java +++ b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/mapper/ExerciseMapper.java @@ -2,7 +2,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.jmsoftware.maf.mafmis.exercise.domain.ExercisePo; +import com.jmsoftware.maf.mafmis.exercise.persistence.Exercise; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,7 +22,7 @@ public interface ExerciseMapper { * @param id the id * @return the exercise po */ - ExercisePo selectById(Long id); + Exercise selectById(Long id); /** * Select all page. @@ -31,7 +31,7 @@ public interface ExerciseMapper { * @param page the page * @return the page */ - IPage selectAll(@Param("exercise") ExercisePo exercisePo, Page page); + IPage selectAll(@Param("exercise") Exercise exercisePo, Page page); /** * Insert int. @@ -39,15 +39,15 @@ public interface ExerciseMapper { * @param exercisePo the exercise po * @return the int */ - int insert(ExercisePo exercisePo); + int insert(Exercise exercisePo); /** * Update int. * - * @param exercisePo the exercise po + * @param exercise the exercise po * @return the int */ - int update(ExercisePo exercisePo); + int update(Exercise exercise); /** * Delete by id int. diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/GetPageListPayload.java b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/payload/GetPageListPayload.java similarity index 90% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/GetPageListPayload.java rename to maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/payload/GetPageListPayload.java index e7df7944..c51100a0 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/GetPageListPayload.java +++ b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/payload/GetPageListPayload.java @@ -1,4 +1,4 @@ -package com.jmsoftware.maf.mafmis.exercise.domain; +package com.jmsoftware.maf.mafmis.exercise.payload; import com.jmsoftware.maf.common.bean.PaginationBase; import lombok.Data; diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/ExercisePo.java b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/persistence/Exercise.java similarity index 84% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/ExercisePo.java rename to maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/persistence/Exercise.java index 9420fad7..d01f4e1f 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/exercise/domain/ExercisePo.java +++ b/maf-mis/maf-mis-infra/src/main/java/com/jmsoftware/maf/mafmis/exercise/persistence/Exercise.java @@ -1,11 +1,11 @@ -package com.jmsoftware.maf.mafmis.exercise.domain; +package com.jmsoftware.maf.mafmis.exercise.persistence; import com.jmsoftware.maf.common.bean.PaginationBase; import lombok.Data; import lombok.EqualsAndHashCode; /** - *

ExercisePo

+ *

Exercise

*

* https://exrx.net/Lists/Directory * @@ -14,7 +14,7 @@ */ @Data @EqualsAndHashCode(callSuper = false) -public class ExercisePo extends PaginationBase { +public class Exercise extends PaginationBase { /** * The ID of exercise. */ diff --git a/maf-mis/src/main/resources/mapper/ExerciseMapper.xml b/maf-mis/maf-mis-infra/src/main/resources/mapper/ExerciseMapper.xml similarity index 96% rename from maf-mis/src/main/resources/mapper/ExerciseMapper.xml rename to maf-mis/maf-mis-infra/src/main/resources/mapper/ExerciseMapper.xml index fc7877d7..970539aa 100644 --- a/maf-mis/src/main/resources/mapper/ExerciseMapper.xml +++ b/maf-mis/maf-mis-infra/src/main/resources/mapper/ExerciseMapper.xml @@ -1,7 +1,7 @@ - + diff --git a/maf-mis/maf-mis-message/pom.xml b/maf-mis/maf-mis-message/pom.xml new file mode 100644 index 00000000..f618de95 --- /dev/null +++ b/maf-mis/maf-mis-message/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + maf-mis-message + Muscle and Fitness Server :: MAF MIS - Message + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + + + + com.jmsoftware.maf + maf-mis-biz + + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/DelayedMessageListener.java b/maf-mis/maf-mis-message/src/main/java/com/jmsoftware/maf/mafmis/DelayedMessageListener.java similarity index 94% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/DelayedMessageListener.java rename to maf-mis/maf-mis-message/src/main/java/com/jmsoftware/maf/mafmis/DelayedMessageListener.java index d19543ca..a7c398eb 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/DelayedMessageListener.java +++ b/maf-mis/maf-mis-message/src/main/java/com/jmsoftware/maf/mafmis/DelayedMessageListener.java @@ -1,4 +1,4 @@ -package com.jmsoftware.maf.mafmis.configuration; +package com.jmsoftware.maf.mafmis; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/maf-mis/maf-mis-web/pom.xml b/maf-mis/maf-mis-web/pom.xml new file mode 100644 index 00000000..e5bbecc8 --- /dev/null +++ b/maf-mis/maf-mis-web/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + + maf-mis-web + Muscle and Fitness Server :: MAF MIS - Web + Exercise Management Information Service. + + com.jmsoftware.maf + maf-mis + 0.0.8-SNAPSHOT + ../pom.xml + + + + + com.jmsoftware.maf + maf-mis-biz + + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java b/maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java similarity index 94% rename from maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java rename to maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java index d5a45d1c..78bf4af8 100644 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java +++ b/maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/configuration/OssConfiguration.java @@ -1,6 +1,6 @@ package com.jmsoftware.maf.mafmis.configuration; -import com.jmsoftware.maf.mafmis.remoteapi.osscenter.OssCenterRemoteApi; +import com.jmsoftware.maf.mafmis.OssCenterRemoteApi; import com.jmsoftware.maf.springcloudstarter.poi.OssUploader; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/package-info.java b/maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/package-info.java new file mode 100644 index 00000000..7acc0501 --- /dev/null +++ b/maf-mis/maf-mis-web/src/main/java/com/jmsoftware/maf/mafmis/package-info.java @@ -0,0 +1 @@ +package com.jmsoftware.maf.mafmis; diff --git a/maf-mis/pom.xml b/maf-mis/pom.xml index 90123990..48ced2a4 100644 --- a/maf-mis/pom.xml +++ b/maf-mis/pom.xml @@ -12,163 +12,52 @@ muscle-and-fitness-server 0.0.8-SNAPSHOT + pom - - - - - org.springframework.boot - spring-boot-maven-plugin - - - build-info - compile - - build-info - - - - + + + maf-mis-bootstrap + maf-mis-web + maf-mis-message + maf-mis-biz + maf-mis-domain + maf-mis-infra + - - org.apache.maven.plugins - maven-pmd-plugin - ${maven-pmd-plugin.version} - - ${project.build.sourceEncoding} - ${java.version} - true - - rulesets/java/ali-comment.xml - rulesets/java/ali-concurrent.xml - rulesets/java/ali-constant.xml - rulesets/java/ali-exception.xml - rulesets/java/ali-flowcontrol.xml - rulesets/java/ali-naming.xml - rulesets/java/ali-oop.xml - rulesets/java/ali-orm.xml - rulesets/java/ali-other.xml - rulesets/java/ali-set.xml - - - - - verify - - check - - - - - - com.alibaba.p3c - p3c-pmd - ${p3c-pmd.version} - - - - - - - com.google.cloud.tools - jib-maven-plugin - ${jib-maven-plugin.version} - - - com.google.cloud.tools - jib-spring-boot-extension-maven - ${jib-spring-boot-extension-maven.version} - - - - - - - buildAndPushDockerImagePhase - install - - build - - - - - - - adoptopenjdk/openjdk11:${adoptopenjdk11.tag} - - - docker.io/ijohnnymiller/${project.parent.artifactId}.${project.artifactId} - - ${git.commit.id.abbrev}-${project.version} - - - - - /${project.artifactId} - - -Dfile.encoding=${project.build.sourceEncoding} - - - ${maf-mis.port} - - USE_CURRENT_TIMESTAMP - - - - - com.google.cloud.tools.jib.maven.extension.springboot.JibSpringBootExtension - - - true - - - - - - - - - io.github.git-commit-id - git-commit-id-maven-plugin - 5.0.0 - - - get-the-git-info - - revision - - initialize - - - - true - ${project.build.outputDirectory}/git.properties - - ^git.build.(time|version)$ - ^git.commit.id.(abbrev|full)$ - - full - - - - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.3 - - - + + + + com.jmsoftware.maf + maf-mis-bootstrap + ${project.version} + + + com.jmsoftware.maf + maf-mis-web + ${project.version} + + + com.jmsoftware.maf + maf-mis-message + ${project.version} + + + com.jmsoftware.maf + maf-mis-biz + ${project.version} + + + com.jmsoftware.maf + maf-mis-domain + ${project.version} + + + com.jmsoftware.maf + maf-mis-infra + ${project.version} + + + diff --git a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/package-info.java b/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/package-info.java deleted file mode 100644 index 46240c87..00000000 --- a/maf-mis/src/main/java/com/jmsoftware/maf/mafmis/remoteapi/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.jmsoftware.maf.mafmis.remoteapi; diff --git a/maf-mis/src/main/resources/application-development-docker.yml b/maf-mis/src/main/resources/application-development-docker.yml deleted file mode 100644 index c39f8a45..00000000 --- a/maf-mis/src/main/resources/application-development-docker.yml +++ /dev/null @@ -1,38 +0,0 @@ -spring: - zipkin: - base-url: http://maf-zipkin:9411 - devtools: - add-properties: true - datasource: - dynamic: - datasource: - master_1: - url: jdbc:mysql://maf-mysql-server-source:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - slave_1: - url: jdbc:mysql://maf-mysql-server-replica-1:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_r - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - quartz: - url: jdbc:mysql://maf-mysql-server-source:3306/QUARTZ_DB?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - rabbitmq: - host: maf-rabbitmq - port: 5672 - username: maf_rabbitmq_su - password: maf@rabbitmq - -redis: - master: - host: maf-redis-master - port: 6379 - password: maf@redis - slaves: - - host: maf-redis-slave-1 - port: 6379 - password: maf@redis diff --git a/maf-mis/src/main/resources/application-development-local.yml b/maf-mis/src/main/resources/application-development-local.yml deleted file mode 100644 index acba65e6..00000000 --- a/maf-mis/src/main/resources/application-development-local.yml +++ /dev/null @@ -1,38 +0,0 @@ -spring: - zipkin: - base-url: http://localhost:9411 - devtools: - add-properties: true - datasource: - dynamic: - datasource: - master_1: - url: jdbc:mysql://localhost:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - slave_1: - url: jdbc:mysql://localhost:3307/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_r - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - quartz: - url: jdbc:mysql://localhost:3306/QUARTZ_DB?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - rabbitmq: - host: localhost - port: 5672 - username: maf_rabbitmq_su - password: maf@rabbitmq - -redis: - master: - host: localhost - port: 6379 - password: maf@redis - slaves: - - host: localhost - port: 6380 - password: maf@redis diff --git a/maf-mis/src/main/resources/application-production.yml b/maf-mis/src/main/resources/application-production.yml deleted file mode 100644 index 578ec104..00000000 --- a/maf-mis/src/main/resources/application-production.yml +++ /dev/null @@ -1,38 +0,0 @@ -spring: - zipkin: - base-url: http://maf-zipkin:9411 - devtools: - add-properties: false - datasource: - dynamic: - datasource: - master_1: - url: jdbc:mysql://maf-mysql-server-source:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - slave_1: - url: jdbc:mysql://maf-mysql-server-replica-1:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_r - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - quartz: - url: jdbc:mysql://maf-mysql-server-source:3306/QUARTZ_DB?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - rabbitmq: - host: maf-rabbitmq - port: 5672 - username: maf_rabbitmq_su - password: maf@rabbitmq - -redis: - master: - host: maf-redis-master - port: 6379 - password: maf@redis - slaves: - - host: maf-redis-slave-1 - port: 6379 - password: maf@redis diff --git a/maf-mis/src/main/resources/application-stage.yml b/maf-mis/src/main/resources/application-stage.yml deleted file mode 100644 index 578ec104..00000000 --- a/maf-mis/src/main/resources/application-stage.yml +++ /dev/null @@ -1,38 +0,0 @@ -spring: - zipkin: - base-url: http://maf-zipkin:9411 - devtools: - add-properties: false - datasource: - dynamic: - datasource: - master_1: - url: jdbc:mysql://maf-mysql-server-source:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - slave_1: - url: jdbc:mysql://maf-mysql-server-replica-1:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_r - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - quartz: - url: jdbc:mysql://maf-mysql-server-source:3306/QUARTZ_DB?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - rabbitmq: - host: maf-rabbitmq - port: 5672 - username: maf_rabbitmq_su - password: maf@rabbitmq - -redis: - master: - host: maf-redis-master - port: 6379 - password: maf@redis - slaves: - - host: maf-redis-slave-1 - port: 6379 - password: maf@redis diff --git a/maf-mis/src/main/resources/application-test.yml b/maf-mis/src/main/resources/application-test.yml deleted file mode 100644 index 578ec104..00000000 --- a/maf-mis/src/main/resources/application-test.yml +++ /dev/null @@ -1,38 +0,0 @@ -spring: - zipkin: - base-url: http://maf-zipkin:9411 - devtools: - add-properties: false - datasource: - dynamic: - datasource: - master_1: - url: jdbc:mysql://maf-mysql-server-source:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - slave_1: - url: jdbc:mysql://maf-mysql-server-replica-1:3306/muscle_and_fitness?useSSL=true&useUnicode=true - username: maf_mysql_r - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - quartz: - url: jdbc:mysql://maf-mysql-server-source:3306/QUARTZ_DB?useSSL=true&useUnicode=true - username: maf_mysql_rw - password: maf@mysql - driver-class-name: com.mysql.cj.jdbc.Driver - rabbitmq: - host: maf-rabbitmq - port: 5672 - username: maf_rabbitmq_su - password: maf@rabbitmq - -redis: - master: - host: maf-redis-master - port: 6379 - password: maf@redis - slaves: - - host: maf-redis-slave-1 - port: 6379 - password: maf@redis diff --git a/maf-mis/src/main/resources/application.yml b/maf-mis/src/main/resources/application.yml deleted file mode 100644 index 6f29f125..00000000 --- a/maf-mis/src/main/resources/application.yml +++ /dev/null @@ -1,184 +0,0 @@ -server: - port: @maf-mis.port@ - tomcat: - uri-encoding: @project.build.sourceEncoding@ - shutdown: GRACEFUL - servlet: - context-path: - -spring: - application: - name: @project.artifactId@ - profiles: - active: @environment@ - mvc: - throw-exception-if-no-handler-found: true - jackson: - date-format: yyyy-MM-dd HH:mm:ss - time-zone: Asia/Hong_Kong - sleuth: - sampler: - probability: 1.0 - servlet: - multipart: - # `location` specifies the directory where uploaded files will be stored. When not specified, - # a temporary directory will be used. ATTENTION: it may differ due to OS. - location: @project.parent.artifactId@/${spring.application.name}/temprary-file - # `max-file-size` specifies the maximum size permitted for uploaded files. The default is 1MB. We set it as 64 MB. - max-file-size: 64MB - # `max-request-size` specifies the maximum size allowed for multipart/form-data requests. The default is 10MB. - max-request-size: 70MB - # `file-size-threshold` specifies the size threshold after which files will be written to disk. - # The default is 0. We set it as 0 too. - file-size-threshold: 0 - cloud: - consul: - discovery: - register: true - instance-id: ${spring.application.name}-${spring.cloud.client.hostname}-${vcap.application.instance_id:${spring.application.instance_id:${random.value}}} - service-name: ${spring.application.name} - port: ${server.port} - prefer-ip-address: true - ip-address: ${spring.cloud.client.ip-address} - health-check-critical-timeout: 15s - datasource: - type: com.alibaba.druid.pool.DruidDataSource - dynamic: - primary: master_1 - druid: - # connection pool size will be determined by DruidDataSourceCreatorPostProcessor.java - max-wait: 60000 - min-evictable-idle-time-millis: 600000 - max-evictable-idle-time-millis: 900000 - validation-query: SELECT 1 - test-while-idle: true - test-on-borrow: false - test-on-return: false - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 20 - keep-alive: true - druid: - driver-class-name: com.mysql.cj.jdbc.Driver - filters: stat,wall,log4j2 - filter: - stat: - enabled: true - db-type: mysql - log-slow-sql: true - slow-sql-millis: 2000 - slf4j: - enabled: true - statement-log-error-enabled: true - statement-create-after-log-enabled: false - statement-close-after-log-enabled: false - result-set-open-after-log-enabled: false - result-set-close-after-log-enabled: false - web-stat-filter: - enabled: true - url-pattern: /* - exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*" - session-stat-enable: true - session-stat-max-count: 1000 - stat-view-servlet: - enabled: true - url-pattern: /druid/* - reset-enable: false - login-username: root - login-password: maf_druid_password - allow: - redis: - database: 0 - timeout: 10000ms - client-type: LETTUCE - lettuce: - pool: - max-active: 20 - max-idle: 10 - max-wait: -1ms - min-idle: 0 - quartz: - job-store-type: JDBC - jdbc: - initialize-schema: NEVER - properties: - org: - quartz: - scheduler: - instanceId: AUTO - jobStore: - tablePrefix: QRTZ_ - isClustered: true - clusterCheckinInterval: 3000 - useProperties: false - -feign: - circuitbreaker: - enabled: true - httpclient: - enabled: false - okhttp: - enabled: true - client: - config: - default: - connectTimeout: 5000 - readTimeout: 10000 - loggerLevel: full - compression: - request: - enabled: true - response: - enabled: true - -management: - endpoints: - web: - exposure: - include: "*" - endpoint: - health: - show-details: ALWAYS - -mybatis-plus: - configuration: - map-underscore-to-camel-case: true - log-impl: org.apache.ibatis.logging.stdout.StdOutImpl - # mapper-locations should start with `classpath*` prefix - # when project is based on Maven multi-module to load XML mapper in different jar - mapper-locations: classpath*:/mapper/**/*Mapper.xml - -logging: - config: classpath:logback-configuration/logback-${spring.profiles.active}.xml - -maf: - project-properties: - base-package: @project.groupId@ - context-path: ${server.servlet.context-path} - group-id: @project.groupId@ - project-parent-artifact-id: @project.parent.artifactId@ - project-artifact-id: @project.artifactId@ - version: @project.version@ - description: @project.description@ - jdk-version: @java.version@ - environment: ${spring.profiles.active} - url: @project.url@ - inception-year: @inceptionYear@ - organization-name: @project.organization.name@ - organization-url: @project.organization.url@ - issue-management-system: @project.issueManagement.system@ - issue-management-url: @project.issueManagement.url@ - developer-name: @developerName@ - developer-email: @developerEmail@ - developer-url: @developerUrl@ - configuration: - ignored-url: - pattern: - - "/static/**" - - "/actuator/**" - - "/druid/**" - - "/swagger-resources/**" - - "/v2/api-docs/**" - - "/*/v2/api-docs/**" - - "/webjars/**" - - "/doc.html" - included-package-for-http-api-scan: ${maf.project-properties.base-package} diff --git a/maf-mis/src/main/resources/bootstrap.yml b/maf-mis/src/main/resources/bootstrap.yml deleted file mode 100644 index 79e3552f..00000000 --- a/maf-mis/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,18 +0,0 @@ -spring: - application: - name: @project.artifactId@ - cloud: - consul: - host: "should-be-passed-by-java-opts" - port: 8500 - config: - enabled: true - prefix: config - # `default-context` should be equal to Spring application name - default-context: @project.artifactId@ - profile-separator: "::" - format: YAML - data-key: "data" - watch: - enabled: true - delay: 1000