AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
API Abp.net restful 风格 ==================== **HTTP Method** ---- 全部只用 POST **Authorization** ---- Bearer Token 认证方式 **Headers** --- Content-Type:application/json **入参** --- Body 格式 **出参** --- ### 1. 单个实体内容 ``` { "result": {}, "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true } ``` abp 代码写法 ``` public Task<MODetailDto> 方法名(){ var detail; return detail.MapTo<MODetailDto>(); } ``` > 注意:返回的数据理论上直接使用数据库映射的实体类,不构造新的DTO,只有在有特殊需求的情况下才重新构建一个DTO ### 2. 列表内容 ``` { "result": [], "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true } ``` abp 代码写法 ``` public Task<List<MODetailItemDto>> 方法名(){ List<MODetailItemDto> list; return list; } 或 public Task<List<MODetailItemDto>> 方法名(){ List<MODetailItem> list; return list.MapTo<List<MODetailItemDto>>(); } ``` ### 3. 分页列表 ``` { "result": { "totalCount": 1, "items": [ ] }, "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true } ``` abp 代码写法 ``` public Task<PagedResultDto<MODetailItemDto>> 方法名(){ var list; int count; return new PagedResultDto<MODetailItemDto>(count, list); } ``` > PagedResultDto 是abp自带的分页实体