diff --git a/.gitignore b/.gitignore
index 9154f4c..f67a2b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,26 +1,42 @@
-# ---> Java
-# Compiled class file
-*.class
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
-# Log file
-*.log
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
-# BlueJ files
-*.ctxt
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
-# Package Files #
-*.jar
-*.war
-*.nar
-*.ear
-*.zip
-*.tar.gz
-*.rar
+### VS Code ###
+.vscode/
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-replay_pid*
+### custom ###
+.flattened-pom.xml
+/**/application-local.yml
+/logs/
+
+/log/
+*/log/
diff --git a/admin/pom.xml b/admin/pom.xml
new file mode 100644
index 0000000..498f36c
--- /dev/null
+++ b/admin/pom.xml
@@ -0,0 +1,161 @@
+
+
+
+ marketing-platform
+ com.baiye
+ 1.1.0
+
+ 4.0.0
+
+ admin
+
+
+ 3.0.3
+
+
+
+
+
+ com.baiye
+ security-oauth2-authorization-server
+ 1.1.0
+
+
+
+ com.baiye
+ admin-websocket
+ 1.1.0
+
+
+
+ com.baiye
+ admin-core
+ 1.1.0
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ com.baiye
+ marketing-platform-starter-job
+ 1.1.0
+
+
+ com.baiye
+ common-redis
+ 1.1.0
+
+
+
+
+ com.mysql
+ mysql-connector-j
+
+
+
+
+
+
+
+
+
+ org.springdoc
+ springdoc-openapi-ui
+
+
+ org.springdoc
+ springdoc-openapi-security
+
+
+
+ com.github.xiaoymin
+ knife4j-springdoc-ui
+ ${knife4j.version}
+
+
+
+
+ com.github.whvcse
+ easy-captcha
+
+
+
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+
+
+ org.glassfish.jaxb
+ jaxb-runtime
+
+
+
+
+ cn.hutool
+ hutool-all
+
+
+
+ com.alibaba
+ easyexcel
+
+
+
+
+ org.springframework.boot
+ spring-boot-test
+
+
+
+ org.springframework
+ spring-test
+ test
+
+
+
+ junit
+ junit
+ test
+
+
+
+ com.google.code.gson
+ gson
+
+
+
+ com.baiye
+ marketing-platform-starter-easyexcel
+ 1.1.0
+
+
+
+ com.baiye
+ common-idempotent
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ repackage
+
+
+
+
+
+
+
+
diff --git a/admin/src/main/java/com/baiye/AdminApplication.java b/admin/src/main/java/com/baiye/AdminApplication.java
new file mode 100644
index 0000000..aca2393
--- /dev/null
+++ b/admin/src/main/java/com/baiye/AdminApplication.java
@@ -0,0 +1,24 @@
+package com.baiye;
+
+import org.ballcat.springsecurity.oauth2.server.authorization.annotation.EnableOauth2AuthorizationServer;
+import org.ballcat.springsecurity.oauth2.server.resource.annotation.EnableOauth2ResourceServer;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+/**
+ * @author Hccake
+ */
+@EnableOauth2AuthorizationServer
+@EnableOauth2ResourceServer
+@MapperScan({ "com.baiye.**.mapper" })
+@SpringBootApplication
+@EnableScheduling
+public class AdminApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(AdminApplication.class, args);
+ }
+
+}
diff --git a/admin/src/main/java/com/baiye/aspect/SysUserAspect.java b/admin/src/main/java/com/baiye/aspect/SysUserAspect.java
new file mode 100644
index 0000000..7a9d136
--- /dev/null
+++ b/admin/src/main/java/com/baiye/aspect/SysUserAspect.java
@@ -0,0 +1,118 @@
+//package com.baiye.aspect;
+//
+//import cn.hutool.core.collection.CollUtil;
+//import com.baiye.modules.distribute.entity.*;
+//import com.baiye.modules.distribute.mapper.ClueMapper;
+//import com.baiye.modules.distribute.mapper.ClueStageMapper;
+//import com.baiye.modules.distribute.mapper.LabelMapper;
+//import com.baiye.modules.distribute.mapper.LabelOrganizeMapper;
+//import com.baiye.modules.distribute.service.ClueRecordService;
+//import com.baiye.modules.distribute.service.DistributeTaskService;
+//import com.baiye.security.util.SecurityUtils;
+//import com.baiye.system.mapper.SysUserMapper;
+//import com.baiye.system.model.dto.SysUserDTO;
+//import com.baiye.system.model.entity.SysUser;
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+//import lombok.RequiredArgsConstructor;
+//import lombok.extern.slf4j.Slf4j;
+//import org.aspectj.lang.JoinPoint;
+//import org.aspectj.lang.annotation.AfterReturning;
+//import org.aspectj.lang.annotation.Aspect;
+//import org.aspectj.lang.annotation.Before;
+//import org.aspectj.lang.annotation.Pointcut;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.List;
+//import java.util.stream.Collectors;
+//
+///**
+// * 系统用户方法AOP
+// */
+//@Aspect
+//@Component
+//@Slf4j
+//@RequiredArgsConstructor
+//public class SysUserAspect {
+//
+// private final ClueRecordService clueRecordService;
+//
+// private final ClueMapper clueMapper;
+//
+// private final SysUserMapper sysUserMapper;
+//
+// private final DistributeTaskService distributeTaskService;
+//
+// private final LabelMapper labelMapper;
+//
+// private final LabelOrganizeMapper labelOrganizeMapper;
+//
+// private final ClueStageMapper clueStageMapper;
+//
+// /**
+// * 配置切入点
+// */
+// @Pointcut("execution(* com.baiye.system.service.impl.SysUserServiceImpl.addSysUser(..))")
+// public void asyncAddSysUser() {
+// }
+//
+// /**
+// * 配置切入点
+// */
+// @Pointcut("execution(* com.baiye.system.service.impl.SysUserServiceImpl.deleteByUserId(..))")
+// public void asyncDeleteByUserId() {
+// }
+//
+// @AfterReturning("asyncAddSysUser()")
+// public void beforeAddSysUser(JoinPoint joinPoint) {
+// log.info("==========创建用户开始执行AOP切入业务==========");
+// // 获取目标对象方法参数,添加业务管理员账号的默认上传记录
+// if (SecurityUtils.getCurrentUserId() == 1) {
+// Object[] args = joinPoint.getArgs();
+// if (args[0] != null && args[0] instanceof SysUserDTO) {
+// SysUserDTO sysUserDTO = (SysUserDTO) args[0];
+// String username = sysUserDTO.getUsername();
+// SysUser sysUser = sysUserMapper.selectByUsername(username);
+// if (sysUser != null && sysUser.getUserId() != null) {
+// // 创建默认的文件记录
+// ClueRecordEntity entity = clueRecordService.addDefaultRecordService(sysUser.getUserId(), "资源推送",
+// "资源推送");
+// // 创建默认的执行任务
+// distributeTaskService.addDefaultTask("资源推送", null, entity.getClueRecordId().toString(),
+// sysUser.getUserId(), null);
+// }
+// }
+// }
+// }
+//
+// @Before("asyncDeleteByUserId()")
+// public void beforeDeleteByUserId(JoinPoint joinPoint) {
+// log.info("==========删除用户开始执行AOP切入业务==========");
+// Object[] args = joinPoint.getArgs();
+// Object obj = args[0];
+// if (obj instanceof Long) {
+// // 查询下级是否有子用户
+// List userList = sysUserMapper
+// .selectList(new LambdaQueryWrapper().eq(SysUser::getWhichUserId, obj));
+// if (CollUtil.isNotEmpty(userList)) {
+// List userIdList = userList.stream().map(SysUser::getUserId).collect(Collectors.toList());
+// userIdList.add((Long) obj);
+// clueMapper.delete(new LambdaQueryWrapper().in(ClueEntity::getAssignedBy, userIdList));
+// }
+// clueMapper.delete(new LambdaQueryWrapper().eq(ClueEntity::getAssignedBy, obj));
+//
+// // 删除用户的任务和上传记录
+// BaseMapper taskMapper = distributeTaskService.getBaseMapper();
+// taskMapper
+// .delete(new LambdaQueryWrapper().eq(DistributeTaskEntity::getCreateBy, obj));
+// BaseMapper clueRecordMapper = clueRecordService.getBaseMapper();
+// clueRecordMapper.delete(new LambdaQueryWrapper().eq(ClueRecordEntity::getCreateBy, obj));
+// // 删除用户标签和标签组 - 阶段信息
+// labelMapper.delete(new LambdaQueryWrapper().eq(LabelEntity::getCreateBy, obj));
+// labelOrganizeMapper
+// .delete(new LambdaQueryWrapper().eq(LabelOrganizeEntity::getCreateBy, obj));
+// clueStageMapper.delete(new LambdaQueryWrapper().eq(ClueStageEntity::getCreateBy, obj));
+// }
+// }
+//
+//}
diff --git a/admin/src/main/java/com/baiye/captcha/CaptchaController.java b/admin/src/main/java/com/baiye/captcha/CaptchaController.java
new file mode 100644
index 0000000..fdce238
--- /dev/null
+++ b/admin/src/main/java/com/baiye/captcha/CaptchaController.java
@@ -0,0 +1,37 @@
+package com.baiye.captcha;
+
+import com.baiye.exception.BadRequestException;
+import com.baiye.result.R;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.ballcat.security.captcha.IValidateCodeService;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Map;
+
+/**
+ * 验证码生成
+ */
+@RequiredArgsConstructor
+@RestController
+@RequestMapping("/captcha")
+@Tag(name = "验证码")
+public class CaptchaController {
+
+ private final IValidateCodeService codeService;
+
+ @GetMapping("/code")
+ @Operation(summary = "获取验证码")
+ public R