调整项目结构

This commit is contained in:
2026-08-29 14:02:28 +08:00
parent c56aa6e752
commit c13302c0cb
52 changed files with 55270 additions and 124 deletions

View File

@@ -1,6 +1,6 @@
package cn.alphaline.smartfactory;
package tech.easyflow.manuagent;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.config.AppProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -10,7 +10,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
*/
@SpringBootApplication
@EnableConfigurationProperties(AppProperties.class)
public class SmartFactoryApplication {
public class ManuAgentApplication {
/**
* 启动 Spring Boot 应用
@@ -18,7 +18,7 @@ public class SmartFactoryApplication {
* @param args 命令行参数
*/
public static void main(String[] args) {
SpringApplication.run(SmartFactoryApplication.class, args);
SpringApplication.run(ManuAgentApplication.class, args);
}
}

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import com.fasterxml.jackson.databind.JsonNode;
import java.security.Principal;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,8 +1,8 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import cn.alphaline.smartfactory.project.ProjectFileService;
import cn.alphaline.smartfactory.project.ProjectService;
import cn.alphaline.smartfactory.skill.SkillService;
import tech.easyflow.manuagent.project.ProjectFileService;
import tech.easyflow.manuagent.project.ProjectService;
import tech.easyflow.manuagent.skill.SkillService;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;

View File

@@ -1,8 +1,8 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import cn.alphaline.smartfactory.config.AppProperties;
import cn.alphaline.smartfactory.model.ModelService;
import cn.alphaline.smartfactory.project.ProjectFileService;
import tech.easyflow.manuagent.config.AppProperties;
import tech.easyflow.manuagent.model.ModelService;
import tech.easyflow.manuagent.project.ProjectFileService;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.agentscope.core.agui.adapter.AguiAdapterConfig;
import io.agentscope.core.agui.adapter.AguiAgentAdapter;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.project.ProjectFileService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.project.ProjectFileService;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

View File

@@ -1,10 +1,10 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import cn.alphaline.smartfactory.artifact.ArtifactService;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.project.ProjectFileService;
import cn.alphaline.smartfactory.project.ProjectService;
import tech.easyflow.manuagent.artifact.ArtifactService;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.project.ProjectFileService;
import tech.easyflow.manuagent.project.ProjectService;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.project.ProjectService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.project.ProjectService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.artifact;
package tech.easyflow.manuagent.artifact;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.artifact;
package tech.easyflow.manuagent.artifact;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.project.ProjectFileService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.project.ProjectFileService;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException;
import java.io.InputStream;

View File

@@ -1,6 +1,6 @@
package cn.alphaline.smartfactory.artifact;
package tech.easyflow.manuagent.artifact;
import cn.alphaline.smartfactory.common.ApiException;
import tech.easyflow.manuagent.common.ApiException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.auth;
package tech.easyflow.manuagent.auth;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
/**

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.auth;
package tech.easyflow.manuagent.auth;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import java.util.UUID;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.common;
package tech.easyflow.manuagent.common;
import java.time.Instant;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.common;
package tech.easyflow.manuagent.common;
import org.springframework.http.HttpStatus;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.common;
package tech.easyflow.manuagent.common;
import jakarta.validation.ConstraintViolationException;
import java.util.UUID;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.common;
package tech.easyflow.manuagent.common;
import jakarta.servlet.FilterChain;
import jakarta.servlet.ServletException;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.config;
package tech.easyflow.manuagent.config;
import java.nio.file.Path;
import java.time.Duration;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.config;
package tech.easyflow.manuagent.config;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.config;
package tech.easyflow.manuagent.config;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiError;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiError;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.time.Instant;
import java.util.UUID;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.config;
package tech.easyflow.manuagent.config;
import io.agentscope.core.skill.repository.postgresql.PostgresSkillRepository;
import javax.sql.DataSource;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.model;
package tech.easyflow.manuagent.model;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.model;
package tech.easyflow.manuagent.model;
import jakarta.validation.Valid;
import java.security.Principal;

View File

@@ -1,8 +1,8 @@
package cn.alphaline.smartfactory.model;
package tech.easyflow.manuagent.model;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.net.URI;

View File

@@ -1,6 +1,6 @@
package cn.alphaline.smartfactory.project;
package tech.easyflow.manuagent.project;
import cn.alphaline.smartfactory.agent.AgentRunService;
import tech.easyflow.manuagent.agent.AgentRunService;
import com.fasterxml.jackson.databind.JsonNode;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;

View File

@@ -1,8 +1,8 @@
package cn.alphaline.smartfactory.project;
package tech.easyflow.manuagent.project;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

View File

@@ -1,7 +1,7 @@
package cn.alphaline.smartfactory.project;
package tech.easyflow.manuagent.project;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiException;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.skill;
package tech.easyflow.manuagent.skill;
import java.security.Principal;
import java.util.List;

View File

@@ -1,6 +1,6 @@
package cn.alphaline.smartfactory.skill;
package tech.easyflow.manuagent.skill;
import cn.alphaline.smartfactory.common.ApiException;
import tech.easyflow.manuagent.common.ApiException;
import io.agentscope.core.skill.AgentSkill;
import java.io.IOException;
import java.nio.ByteBuffer;
@@ -11,7 +11,6 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HexFormat;

View File

@@ -1,8 +1,8 @@
package cn.alphaline.smartfactory.skill;
package tech.easyflow.manuagent.skill;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.common.ApiException;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import io.agentscope.core.skill.AgentSkill;
import io.agentscope.core.skill.repository.postgresql.PostgresSkillRepository;
import java.io.IOException;

View File

@@ -1,10 +1,10 @@
spring:
application:
name: smart-factory-approval-agent
name: manu-agent
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:54330/smart_factory_agent}
username: ${SPRING_DATASOURCE_USERNAME:smart_factory}
password: ${SPRING_DATASOURCE_PASSWORD:smart_factory}
url: jdbc:postgresql://localhost:54330/smart_factory_agent
username: smart_factory
password: smart_factory
hikari:
maximum-pool-size: 12
minimum-idle: 2
@@ -22,27 +22,27 @@ spring:
default-property-inclusion: non_null
server:
port: ${SERVER_PORT:8080}
port: 8080
servlet:
session:
cookie:
http-only: true
same-site: lax
secure: ${SESSION_COOKIE_SECURE:false}
secure: false
app:
data-root: ${APP_DATA_ROOT:file:../data}
deepseek-key-file: ${DEEPSEEK_KEY_FILE:./deepseek_key.txt}
dashscope-key-file: ${DASHSCOPE_KEY_FILE:./dashscope_key.txt}
master-key: ${APP_MASTER_KEY:smart-factory-local-master-key}
admin-username: ${APP_ADMIN_USERNAME:admin}
admin-password: ${APP_ADMIN_PASSWORD:admin123}
model-base-url: ${APP_MODEL_BASE_URL:https://api.deepseek.com}
model-id: ${APP_MODEL_ID:deepseek-v4-flash}
model-context-window: ${APP_MODEL_CONTEXT_WINDOW:131072}
sandbox-image: ${APP_SANDBOX_IMAGE:smart-factory-agent-runtime:0.1.0}
sandbox-network: ${APP_SANDBOX_NETWORK:bridge}
run-timeout: ${APP_RUN_TIMEOUT:60m}
data-root: file:../data
deepseek-key-file: ./deepseek_key.txt
dashscope-key-file: ./dashscope_key.txt
master-key: smart-factory-local-master-key
admin-username: admin
admin-password: admin123
model-base-url: https://api.deepseek.com
model-id: deepseek-v4-flash
model-context-window: 131072
sandbox-image: smart-factory-agent-runtime:0.1.0
sandbox-network: bridge
run-timeout: 60m
logging:
pattern:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
placeholderReplacement=false

View File

@@ -1,14 +1,15 @@
package cn.alphaline.smartfactory;
package tech.easyflow.manuagent;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import cn.alphaline.smartfactory.agent.AgentEventService;
import cn.alphaline.smartfactory.artifact.ArtifactService;
import cn.alphaline.smartfactory.artifact.DocxValidator;
import cn.alphaline.smartfactory.project.ProjectService;
import cn.alphaline.smartfactory.project.ProjectFileService;
import tech.easyflow.manuagent.agent.AgentEventService;
import tech.easyflow.manuagent.artifact.ArtifactService;
import tech.easyflow.manuagent.artifact.DocxValidator;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.project.ProjectService;
import tech.easyflow.manuagent.project.ProjectFileService;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -212,7 +213,7 @@ class DatabaseAndEventIntegrationTest {
""").param("id", UUID.randomUUID()).param("projectId", projectId).param("runId", runId)
.param("sha", "0".repeat(64)).update();
ProjectService service = new ProjectService(jdbc, mock(cn.alphaline.smartfactory.auth.UserService.class), new ObjectMapper());
ProjectService service = new ProjectService(jdbc, mock(UserService.class), new ObjectMapper());
service.delete(projectId);
for (String table : List.of("agent_event", "artifact", "project_plan", "project_file", "agent_run")) {

View File

@@ -1,9 +1,9 @@
package cn.alphaline.smartfactory;
package tech.easyflow.manuagent;
import static org.assertj.core.api.Assertions.assertThat;
import cn.alphaline.smartfactory.config.AppProperties;
import cn.alphaline.smartfactory.model.KeyCipher;
import tech.easyflow.manuagent.config.AppProperties;
import tech.easyflow.manuagent.model.KeyCipher;
import java.nio.file.Path;
import java.time.Duration;
import org.junit.jupiter.api.Test;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.agent;
package tech.easyflow.manuagent.agent;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;

View File

@@ -1,9 +1,9 @@
package cn.alphaline.smartfactory.artifact;
package tech.easyflow.manuagent.artifact;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import cn.alphaline.smartfactory.common.ApiException;
import tech.easyflow.manuagent.common.ApiException;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.auth;
package tech.easyflow.manuagent.auth;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
@@ -7,7 +7,7 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import cn.alphaline.smartfactory.common.GlobalExceptionHandler;
import tech.easyflow.manuagent.common.GlobalExceptionHandler;
import org.junit.jupiter.api.Test;
import org.springframework.http.MediaType;
import org.springframework.security.authentication.AuthenticationManager;

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.common;
package tech.easyflow.manuagent.common;
import static org.assertj.core.api.Assertions.assertThatCode;

View File

@@ -1,11 +1,12 @@
package cn.alphaline.smartfactory.project;
package tech.easyflow.manuagent.project;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import cn.alphaline.smartfactory.auth.UserService;
import cn.alphaline.smartfactory.config.AppProperties;
import tech.easyflow.manuagent.auth.UserService;
import tech.easyflow.manuagent.common.ApiException;
import tech.easyflow.manuagent.config.AppProperties;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
@@ -66,9 +67,9 @@ class ProjectFileServiceTest {
ProjectFileService service = service();
assertThatThrownBy(() -> service.normalizeUploadPath("../企业材料.pdf", "企业材料.pdf"))
.isInstanceOf(cn.alphaline.smartfactory.common.ApiException.class);
.isInstanceOf(ApiException.class);
assertThatThrownBy(() -> service.normalizeUploadPath("其他文件.pdf", "企业材料.pdf"))
.isInstanceOf(cn.alphaline.smartfactory.common.ApiException.class);
.isInstanceOf(ApiException.class);
}
/**

View File

@@ -1,4 +1,4 @@
package cn.alphaline.smartfactory.skill;
package tech.easyflow.manuagent.skill;
import static org.assertj.core.api.Assertions.assertThat;