发布 v1.10 #5

Merged
czm merged 147 commits from develop into main 2026-08-20 11:36:27 +08:00
2 changed files with 28 additions and 1 deletions
Showing only changes of commit 0860492446 - Show all commits

View File

@@ -6,6 +6,7 @@ import com.easyagents.flow.core.chain.runtime.ChainExecutor;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import tech.easyflow.approval.annotation.RequirePublishedAccess; import tech.easyflow.approval.annotation.RequirePublishedAccess;
import tech.easyflow.ai.easyagentsflow.entity.ChainInfo; import tech.easyflow.ai.easyagentsflow.entity.ChainInfo;
@@ -38,7 +39,7 @@ import java.util.Map;
/** /**
* 工作流 * 工作流
*/ */
@RequestMapping("/public-api/workflow") @RequestMapping(value = "/public-api/workflow", produces = MediaType.APPLICATION_JSON_VALUE)
@RestController @RestController
public class PublicWorkflowController { public class PublicWorkflowController {

View File

@@ -0,0 +1,26 @@
package tech.easyflow.publicapi.controller;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* {@link PublicWorkflowController} HTTP 响应契约测试。
*/
public class PublicWorkflowControllerContractTest {
/**
* 验证工作流公共 API 明确返回 JSON避免通配 Accept 请求被 CBOR 转换器接管。
*/
@Test
public void shouldDeclareJsonResponseMediaType() {
RequestMapping requestMapping = PublicWorkflowController.class.getAnnotation(RequestMapping.class);
Assert.assertNotNull(requestMapping);
Assert.assertArrayEquals(
new String[]{MediaType.APPLICATION_JSON_VALUE},
requestMapping.produces()
);
}
}