using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XYY.Core.Standard.Mvc;
using XYY.Service.Standard.KnowledgeBase;

namespace XYY.Api.KnowledgeBase.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class FileListController : ControllerBase
    {
        IKnowledgeSevice knowledgeSevice;

        public FileListController(IKnowledgeSevice knowledgeSevice)
        {
            this.knowledgeSevice = knowledgeSevice;
        }
        /// <summary>
        /// 获取部门文件列表
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiJsonModel<List<Service.Standard.KnowledgeBase.Model.KnowledgeBase>>> Get(string id)
        {
            return ApiJsonModel<List<Service.Standard.KnowledgeBase.Model.KnowledgeBase>>
                .OK(await this.knowledgeSevice.GetFiles(id));
        }
    }
}
