Skip to content

Commit

Permalink
refactor: 优化项目模块命名(简化、分类、统一)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Oct 30, 2024
1 parent 9ecdeb5 commit c276e53
Show file tree
Hide file tree
Showing 346 changed files with 157 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
source: ./continew-admin-webapi/target/app/*
source: ./continew-webapi/target/app/*
target: /docker/continew-admin
strip_components: 3
# 5、启动
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ git clone https://github.com/continew-org/continew-admin.git
```
continew-admin
├─ continew-admin-webapi(API 及打包部署模块)
├─ continew-webapi(API 及打包部署模块)
│ ├─ src
│ │ ├─ main
│ │ │ ├─ java/top/continew/admin
Expand All @@ -305,7 +305,7 @@ continew-admin
│ │ │ └─ logback-spring.xml(日志配置文件)
│ │ └─ test(测试相关代码目录)
│ └─ pom.xml(包含打包相关配置)
├─ continew-admin-system(系统管理模块,存放系统管理相关业务功能,例如:部门管理、角色管理、用户管理等)
├─ continew-module-system(系统管理模块,存放系统管理相关业务功能,例如:部门管理、角色管理、用户管理等)
│ ├─ src
│ │ ├─ main
│ │ │ ├─ java/top/continew/admin
Expand All @@ -329,10 +329,10 @@ continew-admin
│ │ │ └─ mapper(系统管理相关 Mapper XML 文件目录)
│ │ └─ test(测试相关代码目录)
│ └─ pom.xml
├─ continew-admin-plugins(插件模块,存放代码生成、任务调度等扩展模块,后续会进行插件化改造)
│ ├─ continew-admin-job(任务调度插件模块)
├─ continew-plugin(插件模块,存放代码生成、任务调度等扩展模块,后续会进行插件化改造)
│ ├─ continew-plugin-schedule(任务调度插件模块)
│ │ ├─ src
│ │ │ ├─ main/java/top/continew/admin/job
│ │ │ ├─ main/java/top/continew/admin/schedule
│ │ │ │ ├─ api(任务调度中心相关 API)
│ │ │ │ ├─ config(任务调度相关配置)
│ │ │ │ ├─ constant(任务调度相关常量)
Expand All @@ -344,7 +344,7 @@ continew-admin
│ │ │ │ └─ service(代码生成器相关业务接口及实现类)
│ │ │ └─ test(测试相关代码目录)
│ │ └─ pom.xml
│ ├─ continew-admin-generator(代码生成器插件模块)
│ ├─ continew-plugin-generator(代码生成器插件模块)
│ │ ├─ src
│ │ │ ├─ main
│ │ │ │ ├─ java/top/continew/admin/generator
Expand All @@ -364,7 +364,7 @@ continew-admin
│ │ │ └─ test(测试相关代码目录)
│ │ └─ pom.xml
│ └─ pom.xml
├─ continew-admin-common(公共模块,存放公共工具类,公共配置等)
├─ continew-common(公共模块,存放公共工具类,公共配置等)
│ ├─ src
│ │ ├─ main/java/top/continew/admin/common
│ │ │ ├─ config(公共配置)
Expand All @@ -377,12 +377,12 @@ continew-admin
│ │ │ └─ util(公共工具类)
│ │ └─ test(测试相关代码目录)
│ └─ pom.xml
├─ continew-admin-extension(扩展模块)
│ ├─ continew-admin-job-server(任务调度服务模块,实际开发时如果是公司统一提供环境,可直接删除本模块)
├─ continew-extension(扩展模块)
│ ├─ continew-extension-schedule-server(任务调度服务端模块,实际开发时如果是公司统一提供环境,可直接删除本模块)
│ │ ├─ src
│ │ │ ├─ main
│ │ │ │ ├─ java/top/continew/admin/extension/job
│ │ │ │ │ └─ JobServerApplication.java(任务调度服务启动程序
│ │ │ │ ├─ java/top/continew/admin/extension/schedule
│ │ │ │ │ └─ ScheduleServerApplication.java(任务调度服务端启动程序
│ │ │ │ └─ resources
│ │ │ │ ├─ config(核心配置目录)
│ │ │ │ │ ├─ application-dev.yml(开发环境配置文件)
Expand Down
2 changes: 1 addition & 1 deletion continew-admin-common/pom.xml → continew-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>${revision}</version>
</parent>

<artifactId>continew-admin-common</artifactId>
<artifactId>continew-common</artifactId>
<description>公共模块(存放公共工具类,公共配置等)</description>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-admin-extension</artifactId>
<artifactId>continew-extension</artifactId>
<version>${revision}</version>
</parent>

<artifactId>continew-admin-job-server</artifactId>
<description>任务调度服务模块</description>
<artifactId>continew-extension-schedule-server</artifactId>
<description>任务调度服务端</description>

<properties>
<!-- SnailJob 服务端 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
* limitations under the License.
*/

package top.continew.admin.extension.job;
package top.continew.admin.extension.scheduling;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* 任务调度服务启动程序
* 任务调度服务端启动程序
*
* @author KAI
* @since 2024/6/25 22:24
*/
@SpringBootApplication
public class JobServerApplication {
public class ScheduleServerApplication {

public static void main(String[] args) {
SpringApplication.run(com.aizuda.snailjob.server.SnailJobServerApplication.class, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
<version>${revision}</version>
</parent>

<artifactId>continew-admin-extension</artifactId>
<artifactId>continew-extension</artifactId>
<packaging>pom</packaging>
<description>扩展模块(存放其他扩展模块)</description>


<modules>
<module>continew-admin-job-server</module>
<module>continew-extension-schedule-server</module>
</modules>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<version>${revision}</version>
</parent>

<artifactId>continew-admin-system</artifactId>
<artifactId>continew-module-system</artifactId>
<description>系统管理模块(存放系统管理相关业务功能,例如:部门管理、角色管理、用户管理等)</description>

<dependencies>
<!-- 公共模块(存放公共工具类,公共配置等) -->
<dependency>
<groupId>top.continew</groupId>
<artifactId>continew-admin-common</artifactId>
<artifactId>continew-common</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ public void update(UserReq req, Long id) {
CheckUtils.throwIf(StrUtil.isNotBlank(phone) && this.isPhoneExists(phone, id), errorMsgTemplate, phone);
DisEnableStatusEnum newStatus = req.getStatus();
CheckUtils.throwIf(DisEnableStatusEnum.DISABLE.equals(newStatus) && ObjectUtil.equal(id, UserContextHolder
.getUserId()), "不允许禁用当前用户");
.getUserId()), "不允许禁用当前用户");
UserDO oldUser = super.getById(id);
if (Boolean.TRUE.equals(oldUser.getIsSystem())) {
CheckUtils.throwIfEqual(DisEnableStatusEnum.DISABLE, newStatus, "[{}] 是系统内置用户,不允许禁用", oldUser
.getNickname());
.getNickname());
Collection<Long> disjunctionRoleIds = CollUtil.disjunction(req.getRoleIds(), userRoleService
.listRoleIdByUserId(id));
.listRoleIdByUserId(id));
CheckUtils.throwIfNotEmpty(disjunctionRoleIds, "[{}] 是系统内置用户,不允许变更角色", oldUser.getNickname());
}
// 更新信息
Expand Down Expand Up @@ -204,12 +204,12 @@ public void update(UserReq req, Long id) {
public void delete(List<Long> ids) {
CheckUtils.throwIf(CollUtil.contains(ids, UserContextHolder.getUserId()), "不允许删除当前用户");
List<UserDO> list = baseMapper.lambdaQuery()
.select(UserDO::getNickname, UserDO::getIsSystem)
.in(UserDO::getId, ids)
.list();
.select(UserDO::getNickname, UserDO::getIsSystem)
.in(UserDO::getId, ids)
.list();
Optional<UserDO> isSystemData = list.stream().filter(UserDO::getIsSystem).findFirst();
CheckUtils.throwIf(isSystemData::isPresent, "所选用户 [{}] 是系统内置用户,不允许删除", isSystemData.orElseGet(UserDO::new)
.getNickname());
.getNickname());
// 删除用户和角色关联
userRoleService.deleteByUserIds(ids);
// 删除历史密码
Expand All @@ -228,8 +228,7 @@ public Long add(UserDO user) {
@Override
public void downloadImportTemplate(HttpServletResponse response) throws IOException {
try {
FileUploadUtils.download(response, ResourceUtil
.getStream("templates/import/user.xlsx"), "用户导入模板.xlsx");
FileUploadUtils.download(response, ResourceUtil.getStream("templates/import/user.xlsx"), "用户导入模板.xlsx");
} catch (Exception e) {
log.error("下载用户导入模板失败:{}", e.getMessage(), e);
response.setCharacterEncoding(CharsetUtil.UTF_8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-admin-plugins</artifactId>
<artifactId>continew-plugin</artifactId>
<version>${revision}</version>
</parent>

<artifactId>continew-admin-generator</artifactId>
<artifactId>continew-plugin-generator</artifactId>
<description>代码生成器插件</description>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-admin-plugins</artifactId>
<artifactId>continew-plugin</artifactId>
<version>${revision}</version>
</parent>

<artifactId>continew-admin-open</artifactId>
<artifactId>continew-plugin-open</artifactId>
<description>能力开放插件(包括应用管理、API开放授权、API开发等)</description>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>top.continew</groupId>
<artifactId>continew-admin-plugins</artifactId>
<artifactId>continew-plugin</artifactId>
<version>${revision}</version>
</parent>

<artifactId>continew-admin-job</artifactId>
<artifactId>continew-plugin-schedule</artifactId>
<description>任务调度插件</description>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.api;
package top.continew.admin.schedule.api;

import com.aizuda.snailjob.common.core.model.Result;
import org.springframework.http.MediaType;
Expand All @@ -23,10 +23,10 @@
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.*;
import top.continew.admin.job.model.JobPageResult;
import top.continew.admin.job.model.req.JobReq;
import top.continew.admin.job.model.req.JobStatusReq;
import top.continew.admin.job.model.resp.JobResp;
import top.continew.admin.schedule.model.JobPageResult;
import top.continew.admin.schedule.model.req.JobReq;
import top.continew.admin.schedule.model.req.JobStatusReq;
import top.continew.admin.schedule.model.resp.JobResp;

import java.util.List;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.api;
package top.continew.admin.schedule.api;

import com.aizuda.snailjob.common.core.model.Result;
import org.springframework.http.MediaType;
Expand All @@ -24,10 +24,10 @@
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;
import top.continew.admin.job.model.JobInstanceLogPageResult;
import top.continew.admin.job.model.JobPageResult;
import top.continew.admin.job.model.resp.JobInstanceResp;
import top.continew.admin.job.model.resp.JobLogResp;
import top.continew.admin.schedule.model.JobInstanceLogPageResult;
import top.continew.admin.schedule.model.JobPageResult;
import top.continew.admin.schedule.model.resp.JobInstanceResp;
import top.continew.admin.schedule.model.resp.JobLogResp;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.api;
package top.continew.admin.schedule.api;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
Expand All @@ -32,8 +32,8 @@
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import top.continew.admin.job.constant.JobConstants;
import top.continew.admin.job.model.JobPageResult;
import top.continew.admin.schedule.constant.JobConstants;
import top.continew.admin.schedule.model.JobPageResult;
import top.continew.starter.cache.redisson.util.RedisUtils;
import top.continew.starter.extension.crud.model.resp.PageResp;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.config;
package top.continew.admin.schedule.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.netty.channel.ChannelOption;
Expand All @@ -36,10 +36,10 @@
import org.springframework.web.service.invoker.HttpServiceProxyFactory;
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;
import top.continew.admin.job.api.JobApi;
import top.continew.admin.job.api.JobBatchApi;
import top.continew.admin.job.api.JobClient;
import top.continew.admin.job.constant.JobConstants;
import top.continew.admin.schedule.api.JobApi;
import top.continew.admin.schedule.api.JobBatchApi;
import top.continew.admin.schedule.api.JobClient;
import top.continew.admin.schedule.constant.JobConstants;

/**
* HTTP Exchange 配置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.config;
package top.continew.admin.schedule.config;

import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.constant;
package top.continew.admin.schedule.constant;

/**
* 任务调度常量
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.enums;
package top.continew.admin.schedule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.enums;
package top.continew.admin.schedule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.enums;
package top.continew.admin.schedule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.enums;
package top.continew.admin.schedule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package top.continew.admin.job.enums;
package top.continew.admin.schedule.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Loading

0 comments on commit c276e53

Please sign in to comment.