using learun.iapplication;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace learun.webapi.Controllers
{
///
/// 版 本 Learun-ADMS-Core 力软管理后台
/// Copyright (c) 2019-present 力软信息技术(苏州)有限公司
/// 创建人:tobin
/// 日 期:2020.04.22
/// 描 述:移动应用
///
public class FunctionController : MvcControllerBase
{
private readonly MyFunctionIBLL _myFunctionIBLL;
private readonly FunctionIBLL _functionIBLL;
///
/// 初始化
///
/// 我的功能
/// 移动端功能
public FunctionController(MyFunctionIBLL myFunctionIBLL, FunctionIBLL functionIBLL) {
_myFunctionIBLL = myFunctionIBLL;
_functionIBLL = functionIBLL;
}
///
/// 获取全部移动功能数据
///
///
[HttpGet]
public async Task List()
{
var list =await _functionIBLL.GetList();
return Success(list);
}
///
/// 获取我的常用应用数据
///
///
[HttpGet]
public async Task MyList()
{
var list = await _myFunctionIBLL.GetList(this.GetUserId());
List res = new List();
foreach (var item in list)
{
res.Add(item.F_FunctionId);
}
return Success(res);
}
///
/// 更新我的常用应用
///
/// 功能id集合字串
///
[HttpPost]
public async Task UpdateMyList([FromForm]string ids)
{
await _myFunctionIBLL.SaveEntity(this.GetUserId(), ids);
return SuccessInfo("保存成功");
}
}
}