huawei
4 天以前 63d047db30e03608479ab3d340e925bc3366357c
Controllers/Simple/SimpleController.cs
@@ -4,123 +4,26 @@
namespace NewPdaSqlServer.Controllers.Simple;
/// <summary>
///     看板目录接口控制器
///     路由前缀: /simple (与Java版本完全一致)
///     实现与Java SimpleController完全相同的接口
/// </summary>
[Route("simple")]
[ApiController]
public class SimpleController : ControllerBase
{
    private readonly SimpleManager _simpleManager = new();
    /// <summary>
    ///     获取树形菜单
    ///     对应Java: @PostMapping("/getTree")
    /// </summary>
    /// <returns>树形菜单数据</returns>
    /// <remarks>
    ///     请求示例:
    ///     POST /simple/getTree
    ///     Content-Type: application/json
    ///
    ///     返回数据结构:
    ///     {
    ///         "code": 0,
    ///         "msg": "请求成功",
    ///         "count": 2,
    ///         "data": [
    ///             {
    ///                 "id": 1,
    ///                 "title": "生产看板",
    ///                 "field": "production",
    ///                 "spread": true,
    ///                 "children": [...]
    ///             }
    ///         ]
    ///     }
    /// </remarks>
    /// <response code="200">成功获取树形菜单</response>
    [HttpPost("getTree")]
    public ResultDto<List<TreeViewDto>> GetTree()
    {
        return _simpleManager.GetTree();
    }
    /// <summary>
    ///     获取菜单列表
    ///     对应Java: @PostMapping("/list")
    ///     注意: 此接口已基本废弃,前端改用树形菜单方式展示
    /// </summary>
    /// <returns>菜单列表数据</returns>
    /// <remarks>
    ///     请求示例:
    ///     POST /simple/list
    ///     Content-Type: application/json
    ///
    ///     返回数据结构:
    ///     {
    ///         "code": 0,
    ///         "msg": "请求成功",
    ///         "count": 5,
    ///         "data": [
    ///             {
    ///                 "id": 1,
    ///                 "isTop": 1,
    ///                 "fid": 0,
    ///                 "title": "生产效率看板",
    ///                 "field": "efficiency",
    ///                 "href": "http://bi.example.com/dashboard1",
    ///                 "spread": 0,
    ///                 "disabled": 0,
    ///                 "lbtime": 10
    ///             }
    ///         ]
    ///     }
    /// </remarks>
    /// <response code="200">成功获取菜单列表</response>
    [HttpPost("list")]
    public ResultDto<List<MesSimpleDto>> GetList()
    {
        return _simpleManager.GetMenuList();
    }
    /// <summary>
    ///     根据菜单ID获取BI视图列表
    ///     对应Java: @GetMapping("/listByMenuId/{menuId}")
    ///     核心接口:用于获取轮播页面的BI看板链接列表
    /// </summary>
    /// <param name="menuId">菜单ID (路径参数)</param>
    /// <returns>BI视图列表</returns>
    /// <remarks>
    ///     请求示例:
    ///     GET /simple/listByMenuId/102
    ///
    ///     返回数据结构:
    ///     {
    ///         "code": 0,
    ///         "msg": "请求成功",
    ///         "count": 3,
    ///         "data": [
    ///             {
    ///                 "id": 1001,
    ///                 "pid": 102,
    ///                 "name": "质量趋势分析",
    ///                 "href": "http://bi.example.com/quality/trend",
    ///                 "lbtime": 10
    ///             }
    ///         ]
    ///     }
    ///
    ///     业务说明:
    ///     - 返回指定菜单下所有的BI看板链接
    ///     - lbtime字段从父菜单继承(MES_SIMPLE表)
    ///     - 前端使用此数据创建iframe进行轮播展示
    /// </remarks>
    /// <response code="200">成功获取BI视图列表</response>
    [HttpGet("listByMenuId/{menuId}")]
    public ResultDto<List<BiViewDto>> GetBiViews(int menuId)
    public ResultDto<List<BiViewDto>> GetBiViews(long menuId)
    {
        return _simpleManager.GetBiViewsByMenuId(menuId);
    }