You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
69 lines
2.1 KiB
3 years ago
|
using learun.iapplication;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System.Collections.Generic;
|
||
|
using System.Threading.Tasks;
|
||
|
|
||
|
namespace learun.webapi.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 版 本 Learun-ADMS-Core 力软管理后台
|
||
|
/// Copyright (c) 2019-present 力软信息技术(苏州)有限公司
|
||
|
/// 创建人:tobin
|
||
|
/// 日 期:2020.04.22
|
||
|
/// 描 述:移动应用
|
||
|
/// </summary>
|
||
|
public class FunctionController : MvcControllerBase
|
||
|
{
|
||
|
private readonly MyFunctionIBLL _myFunctionIBLL;
|
||
|
private readonly FunctionIBLL _functionIBLL;
|
||
|
|
||
|
/// <summary>
|
||
|
/// 初始化
|
||
|
/// </summary>
|
||
|
/// <param name="myFunctionIBLL">我的功能</param>
|
||
|
/// <param name="functionIBLL">移动端功能</param>
|
||
|
public FunctionController(MyFunctionIBLL myFunctionIBLL, FunctionIBLL functionIBLL) {
|
||
|
_myFunctionIBLL = myFunctionIBLL;
|
||
|
_functionIBLL = functionIBLL;
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取全部移动功能数据
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public async Task<IActionResult> List()
|
||
|
{
|
||
|
var list =await _functionIBLL.GetList();
|
||
|
return Success(list);
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 获取我的常用应用数据
|
||
|
/// </summary>
|
||
|
/// <returns></returns>
|
||
|
[HttpGet]
|
||
|
public async Task<IActionResult> MyList()
|
||
|
{
|
||
|
|
||
|
var list = await _myFunctionIBLL.GetList(this.GetUserId());
|
||
|
List<string> res = new List<string>();
|
||
|
foreach (var item in list)
|
||
|
{
|
||
|
res.Add(item.F_FunctionId);
|
||
|
}
|
||
|
return Success(res);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 更新我的常用应用
|
||
|
/// </summary>
|
||
|
/// <param name="ids">功能id集合字串</param>
|
||
|
/// <returns></returns>
|
||
|
[HttpPost]
|
||
|
public async Task<IActionResult> UpdateMyList([FromForm]string ids)
|
||
|
{
|
||
|
await _myFunctionIBLL.SaveEntity(this.GetUserId(), ids);
|
||
|
return SuccessInfo("保存成功");
|
||
|
}
|
||
|
}
|
||
|
}
|