using GDZZ.Core; using Furion.DependencyInjection; using Furion.DynamicApiController; using Mapster; using Microsoft.AspNetCore.Mvc; using SqlSugar; using System.Linq; using System.Threading.Tasks; using GDZZ.Application.Entity; using Microsoft.AspNetCore.Authorization; using System.Collections.Generic; namespace GDZZ.Application { /// /// 地区表服务 /// [ApiDescriptionSettings("Application",Name = "SysRegion", Order = 1)] public class SysRegionService : ISysRegionService, IDynamicApiController, ITransient { private readonly SqlSugarRepository _rep; public SysRegionService(SqlSugarRepository rep) { _rep = rep; } /// /// 查询所有城市列表 /// /// /// [HttpGet("/SysRegion/list")] [AllowAnonymous] public async Task> list() { var entities = await _rep.AsQueryable().Where(x => x.region_level == 2).ToArrayAsync(); return entities.Adapt>(); } } }