|
1
2
3
4
5
6
7
|
using System;using System.Collections.Generic;using Hh.Mes.Api.Controllers;using Hh.Mes.Common.Json;using Hh.Mes.Service;using Microsoft.AspNetCore.Hosting;using Microsoft.AspNetCore.Http;using Microsoft.AspNetCore.Http.Headers;
using Microsoft.AspNetCore.Mvc;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace Hh.Mes.Api.Controllers{
[Route("api/[controller]/[action]")]
[ApiController]
public class BulletinBoardController : BaseController
{
private readonly BulletinBoardService service;
public BulletinBoardController(BulletinBoardService service, IHttpContextAccessor accessor)
{
this.service = service;
this.context = accessor.HttpContext;
}
/// <summary>
/// 读数据 http://127.0.0.1:6001/api/BulletinBoard/Mes/V1/ReadData
/// </summary>
/// <returns></returns>
[HttpGet]
[ActionName("Mes/V1/ReadData")]
public string ReadData()
{
return Serialize(service.GetData());
}
}}
|