feat: mock功能

This commit is contained in:
2026-01-29 13:19:19 +08:00
parent 4ab79d3afa
commit ff6f8aa303
20 changed files with 909 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
package org.nl.tool.api;
import com.alibaba.fastjson.JSONObject;
import org.nl.tool.core.enums.HttpMethodEnum;
/**
* mock-api提供者接口
* @author: lyd
* @date: 2026/1/28
*/
public interface MockApi {
/**
* 通用的执行请求
* @param url 路径ip:端口号/api地址
* @param method 方法类型GET、POST、PUT、DELETED
* @param body 数据内容JSONObject.toString
* @see JSONObject#toJSONString()
* @return
*/
String executeRequestCommon(String url, HttpMethodEnum method, String body);
}

View File

@@ -0,0 +1,22 @@
package org.nl.tool.core.enums;
import lombok.Getter;
/**
*
* @author: lyd
* @date: 2026/1/29
*/
@Getter
public enum HttpMethodEnum {
GET("GET"),
POST("POST"),
PUT("PUT"),
DELETE("DELETE");
private final String code;
HttpMethodEnum(String code) {
this.code = code;
}
}