test
This commit is contained in:
15
Ewide.NbzsZheliban/Service/BaseService.cs
Normal file
15
Ewide.NbzsZheliban/Service/BaseService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Furion.JsonSerialization;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.NbzsZheliban.Service
|
||||
{
|
||||
public class BaseService : Furion.DynamicApiController.IDynamicApiController
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
40
Ewide.NbzsZheliban/Service/DataService.cs
Normal file
40
Ewide.NbzsZheliban/Service/DataService.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using Ewide.NbzsZheliban.Tools;
|
||||
using Furion.JsonSerialization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.NbzsZheliban.Service
|
||||
{
|
||||
[ApiDescriptionSettings(Name = "数据接口")]
|
||||
public class DataService : BaseService
|
||||
{
|
||||
private readonly ISqlSugarRepository repository;
|
||||
private readonly SqlSugarClient db;
|
||||
private readonly IJsonSerializerProvider _jsonSerializer;
|
||||
public DataService(ISqlSugarRepository sqlSugarRepository, IJsonSerializerProvider jsonSerializer)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
db = repository.Context;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
}
|
||||
/// <summary>
|
||||
/// 被征收人关联的项目列表
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("/project/list")]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<dynamic> PrjList([FromBody] JObject args)
|
||||
{
|
||||
var cardno = args.GetJsonIntValue("cardno", isThrowExp: true);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
Ewide.NbzsZheliban/Service/TestService.cs
Normal file
42
Ewide.NbzsZheliban/Service/TestService.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using Furion.DynamicApiController;
|
||||
using Furion.JsonSerialization;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ewide.NbzsZheliban
|
||||
{
|
||||
[ApiDescriptionSettings(Name = "test")]
|
||||
public class TestService : IDynamicApiController
|
||||
{
|
||||
//private readonly IDapperRepository _dapperRep;
|
||||
private readonly ISqlSugarRepository repository;
|
||||
private readonly SqlSugarClient db;
|
||||
private readonly IJsonSerializerProvider _jsonSerializer;
|
||||
//public TestService(ISqlSugarRepository sqlSugarRepository, IDapperRepository dapperRep, IJsonSerializerProvider jsonSerializer)
|
||||
// { //_dapperRep = dapperRep;
|
||||
public TestService(ISqlSugarRepository sqlSugarRepository, IJsonSerializerProvider jsonSerializer)
|
||||
{
|
||||
repository = sqlSugarRepository;
|
||||
db = repository.Context;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
}
|
||||
//[HttpGet("/test/list")]
|
||||
//[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
//public async Task<dynamic> List([FromQuery] JObject args)
|
||||
//{
|
||||
// var asd = _jsonSerializer.Serialize(new { Id = "1", Name = "ASD", dt = DateTime.Now });
|
||||
// return await db.Queryable<Entity.TCodeScore>().ToListAsync();
|
||||
// //return null;
|
||||
//}
|
||||
[HttpGet("/test/list2")]
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<dynamic> List2([FromQuery] JObject args)
|
||||
{
|
||||
return await repository.Ado.GetDataTableAsync("select * from TCodeScore"); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user