Swagger
前台可以解析注释<summary>
,这个注释是支持markdown
的,这里记录下
/// <summary> /// 工令单 /// </summary> /// <remarks> /// 用例 ///[<see cref="CP_InData"/>](#model-GD_InData) ///``` ///{ /// GUID:"202312071659001", /// data:{ /// "TA002":"000168", /// "DB":"HD" /// } ///} ///``` /// </remarks> /// <param name="data"></param> /// <returns></returns> [HttpPost("GetGD")] public async Task<IActionResult> GetGD([FromBody] GD_InMessage data) { var DefaultOut = (GD_InMessage _data) => new GD_OutMessage() { GUID = data.GUID, Code = "-99", Message = "操作失败", Result = new List<MsGD>() }; GD_OutMessage result = DefaultOut(data); try { result = await @event.Send(new GD_Event(data)); } catch (Exception ex) { log?.Error(this, "GetGD", ex); } result ??= DefaultOut(data); return new JsonResult(result); }
这样写,前台就有示例了,而且可以点击超连接到下面的Schemas
,vs也能快速看到
本文作者:没想好
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!