InputDataModifyController.cs 998 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Dapper;
  2. using Microsoft.AspNetCore.Mvc;
  3. using MySqlX.XDevAPI.Common;
  4. using Newtonsoft.Json;
  5. using PullChargeData.Entity;
  6. using PullChargeData.Helper;
  7. using System.Data;
  8. namespace DataControlMod.Controllers
  9. {
  10. [ApiController]
  11. [Route("[controller]")]
  12. public class InputDataModifyController : ControllerBase
  13. {
  14. private readonly ILogger<InputDataModifyController> _logger;
  15. public InputDataModifyController(ILogger<InputDataModifyController> logger)
  16. {
  17. _logger = logger;
  18. }
  19. [HttpPost(Name = "newOpenApi/search")]
  20. public dynamic ExamApi(dynamic inputData)
  21. {
  22. using (IDbConnection conn = DapperHelper.MySqlConnection())
  23. {
  24. string sql = "select * from datasourceinfo";
  25. var dynamicParams = new DynamicParameters();
  26. var result = conn.Query<datasourceinfo>(sql, dynamicParams).ToList();
  27. return result;
  28. }
  29. }
  30. }
  31. }