2025-04-24 18:31:27 +08:00

168 lines
5.1 KiB
C#

using MyCode.Project.Domain.Model;
using MyCode.Project.Services;
using System.Collections.Generic;
using System.Web.Http;
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
{
public class SynchronizeDataController : BaseWechatController
{
private ISynchronizeDataService _synchronizeDataService;
public SynchronizeDataController(ISynchronizeDataService synchronizeDataService)
{
_synchronizeDataService = synchronizeDataService;
}
#region GetAllGoods()
/// <summary>
/// 获取所有的商品包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasGoods> GetAllGoods(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllGoods();
else
return new List<BasGoods>();
}
#endregion
#region GetAllServiceSetService()
/// <summary>
/// 获取所有的服务套餐明细
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasServiceSetService> GetAllServiceSetService(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllServiceSetService();
else
return new List<BasServiceSetService>();
}
#endregion
#region GetAllBarcode(SKU包括任何状态)
/// <summary>
/// 获取所有的SKU包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasBarcode> GetAllBarcode(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllBarcode();
else
return new List<BasBarcode>();
}
#endregion
#region GetAllService()
/// <summary>
/// 获取所有的服务包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasService> GetAllService(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllService();
else
return new List<BasService>();
}
#endregion
#region GetAllServiceSet()
/// <summary>
/// 获取所有的服务套餐包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasServiceSet> GetAllServiceSet(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllServiceSet();
else
return new List<BasServiceSet>();
}
#endregion
#region GetAllDept()
/// <summary>
/// 获取所有的商品分类包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasDept> GetAllDept(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllDept();
else
return new List<BasDept>();
}
#endregion
#region GetAllDept()
/// <summary>
/// 获取所有的主题包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasTheme> GetAllTheme(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllTheme();
else
return new List<BasTheme>();
}
#endregion
#region GetAllColor()
/// <summary>
/// 获取所有的色号包括任何状态
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public List<BasColor> GetAllColor(string key)
{
if (key == "DCBD3197-B680-408A-BAF0-8B08611B71CA")
return _synchronizeDataService.GetAllColor();
else
return new List<BasColor>();
}
#endregion
#region SynchronizeData()
/// <summary>
/// 同步商品等数据
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public void SynchronizeData(string key)
{
if (key == "A8DE6EDD-A860-4BD7-AC61-6A728D5FF57F")
_synchronizeDataService.SynchronizeData();
}
#endregion
}
}