diff --git a/ZR.Admin.WebApi/Controllers/CommonController.cs b/ZR.Admin.WebApi/Controllers/CommonController.cs
index 88e6d40..62184cc 100644
--- a/ZR.Admin.WebApi/Controllers/CommonController.cs
+++ b/ZR.Admin.WebApi/Controllers/CommonController.cs
@@ -217,65 +217,5 @@ namespace ZR.Admin.WebApi.Controllers
string fileName = Path.GetFileName(fullPath);
return DownFile(fullPath, fileName);
}
-
- ///
- /// 初始化种子数据
- ///
- /// 是否清空数据
- ///
- [HttpGet]
- [AllowAnonymous]
- [ActionPermissionFilter(Permission = "common")]
- [Log(BusinessType = BusinessType.INSERT, Title = "初始化数据")]
- public IActionResult InitSeedData(bool clean = false)
- {
- if (!WebHostEnvironment.IsDevelopment())
- {
- return ToResponse(ResultCode.CUSTOM_ERROR, "导入数据失败,请在开发模式下初始化");
- }
- var path = Path.Combine(WebHostEnvironment.WebRootPath, "data.xlsx");
- SeedDataService seedDataService = new();
- var result = seedDataService.InitSeedData(path, clean);
- Console.ForegroundColor = ConsoleColor.Red;
- foreach (var item in result)
- {
- Console.WriteLine(item);
- }
- Console.ForegroundColor = ConsoleColor.White;
- return SUCCESS(new
- {
- result
- });
- }
-
- ///
- ///
- ///
- ///
- [HttpGet]
- [AllowAnonymous]
- [ActionPermissionFilter(Permission = "common")]
- [Log(BusinessType = BusinessType.INSERT, Title = "初始化数据")]
- public IActionResult UpdateSeedData()
- {
- if (!WebHostEnvironment.IsDevelopment())
- {
- return ToResponse(ResultCode.CUSTOM_ERROR, "导入数据失败,请在开发模式下初始化");
- }
- var path = Path.Combine(WebHostEnvironment.WebRootPath, "data.xlsx");
- SeedDataService seedDataService = new();
-
- var sysNotice = MiniExcel.Query(path, sheetName: "notice").ToList();
- var result = seedDataService.InitNoticeData(sysNotice);
-
- var sysMenu = MiniExcel.Query(path, sheetName: "menu").Where(f => f.MenuId >= 1104).ToList();
- var result5 = seedDataService.InitMenuData(sysMenu);
-
- return SUCCESS(new
- {
- result,
- result5
- });
- }
}
}
diff --git a/ZR.Admin.WebApi/Controllers/WebApiController.cs b/ZR.Admin.WebApi/Controllers/WebApiController.cs
index 112e77a..dca21de 100644
--- a/ZR.Admin.WebApi/Controllers/WebApiController.cs
+++ b/ZR.Admin.WebApi/Controllers/WebApiController.cs
@@ -29,17 +29,19 @@ namespace ZR.Admin.WebApi.Controllers
/// 微信用户表接口
///
private readonly IGiftUserService _GiftUserService;
- public WebApiController(WechatApiClient client, IGiftUserService GiftUserService, IGiftClaimService giftClaimService)
+ private ISysFileService SysFileService;
+ public WebApiController(WechatApiClient client, IGiftUserService GiftUserService, IGiftClaimService giftClaimService, ISysFileService sysFileService)
{
_client = client;
_GiftUserService = GiftUserService;
_GiftClaimService = giftClaimService;
+ SysFileService = sysFileService;
}
///
- /// 1
+ ///
///
///
///
@@ -108,6 +110,7 @@ namespace ZR.Admin.WebApi.Controllers
return SUCCESS(list1);
}
public static string domainUrl = AppSettings.GetConfig("ALIYUN_OSS:domainUrl");
+
[HttpPost()]
[Route("/addRecord")]
[AllowAnonymous]
@@ -169,10 +172,24 @@ namespace ZR.Admin.WebApi.Controllers
ProductSerialNumber = giftClaim.ProductSerialNumber,
CreatedAt = DateTime.Now,
ProductImage = finalPath,
- UserWxOpenId= user.Openid
+ UserWxOpenId = user.Openid
};
_GiftClaimService.AddGiftClaim(giftClaim1);
return SUCCESS(new { giftClaim1.Id });
}
+
+ ///
+ ///
+ ///
+ ///
+ [HttpGet()]
+ [Route("/getBannerList")]
+ [AllowAnonymous]
+ public async Task GetBannerList()
+ {
+ var list = await SysFileService.AsQueryable().Where(it => it.ClassifyType == "banner").Select(it =>
+ new { it.AccessUrl, it.RealName }).ToListAsync();
+ return SUCCESS(list);
+ }
}
}