using Refit; using System.Threading.Tasks; namespace Microservice.Common { /// /// 通用服务 API 接口定义 /// public interface IServiceApi { /// /// 发送 GET 请求 /// /// 响应数据类型 /// API 端点 /// API 响应 [Get("/{**endpoint}")] Task> GetAsync([AliasAs("endpoint")] string endpoint); /// /// 发送 POST 请求 /// /// 响应数据类型 /// API 端点 /// 请求数据 /// API 响应 [Post("/{**endpoint}")] Task> PostAsync([AliasAs("endpoint")] string endpoint, [Body] object data); /// /// 发送 PUT 请求 /// /// 响应数据类型 /// API 端点 /// 请求数据 /// API 响应 [Put("/{**endpoint}")] Task> PutAsync([AliasAs("endpoint")] string endpoint, [Body] object data); /// /// 发送 DELETE 请求 /// /// 响应数据类型 /// API 端点 /// API 响应 [Delete("/{**endpoint}")] Task> DeleteAsync([AliasAs("endpoint")] string endpoint); } }