29 lines
662 B
C#
29 lines
662 B
C#
using Asp.Versioning;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using StoreHub.Framework.Repositorys;
|
|
using System.ComponentModel;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace StoreHub.Controllers
|
|
{
|
|
[ApiController]
|
|
[Description("测试温度")]
|
|
[ApiVersion("1.0")]
|
|
[Route("api/v{version:apiVersion}/[controller]")]
|
|
public class UserController : ControllerBase
|
|
{
|
|
private readonly IUserRepository _userRepository;
|
|
|
|
public UserController(IUserRepository userRepository)
|
|
{
|
|
_userRepository = userRepository;
|
|
}
|
|
[HttpGet]
|
|
public string GetUser()
|
|
{
|
|
return JsonSerializer.Serialize(_userRepository.Select.First());
|
|
}
|
|
}
|
|
}
|