You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

86 lines
2.7 KiB

using EasyBL;
using EasyBL.WebApi.Filters;
using EasyBL.WEBAPP;
using EasyBL.WEBAPP.SYS;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Web.Http;
namespace WebApp.Controllers
{
public class ServiceController : ApiController
{
/// <summary>
/// 获取token
/// </summary>
/// <param name="orgId"></param>
/// <param name="userId"></param>
/// <param name="pasWd"></param>
/// <returns></returns>
[HttpGet]
[ApiSecurityFilter]
public HttpResponseMessage GetToken(string orgId, string userId, string pasWd)
{
return new BaseAuthorizeService().GetToken(orgId, userId, pasWd);
}
/// <summary>
/// 後臺登陸
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
[HttpPost]
[ApiSecurityFilter]
public HttpResponseMessage GetLogin([FromBody]dynamic data)
{
try
{
return new AuthorizeService().GetLogin(data, Request);
}
catch (Exception ex)
{
var sMsg = Util.GetLastExceptionMsg(ex);
LogService.MailSend(sMsg + @"Param:", ex, @"TE", @"apadmin", nameof(ServiceController), @"登陸", @"GetLogin(系統登陸)", @"", @"", @"");
return null;
}
}
//用Filter搜尋服務
[HttpGet]
public HttpResponseMessage GetServiceList(string Lang, string RegionID, string CountryID, string CityID, string SubCategoryID)
{
List<string> rsRegionID = new List<string>();
List<string> rsCountryID = new List<string>();
List<string> rsCityID = new List<string>();
List<string> rsSubCategoryIDs = new List<string>();
if (!string.IsNullOrEmpty(RegionID))
{
rsRegionID = JsonConvert.DeserializeObject<List<string>>(RegionID);
}
if (!string.IsNullOrEmpty(CountryID))
{
rsCountryID = JsonConvert.DeserializeObject<List<string>>(CountryID);
}
if (!string.IsNullOrEmpty(CityID))
{
rsCityID = JsonConvert.DeserializeObject<List<string>>(CityID);
}
if (!string.IsNullOrEmpty(SubCategoryID))
{
rsSubCategoryIDs = JsonConvert.DeserializeObject<List<string>>(SubCategoryID);
}
return new Services2Service().GetServiceList(Lang, rsRegionID, rsCountryID, rsCityID, rsSubCategoryIDs);
//return new ServicesService().GetServiceList(Lang, rsRegionID, rsCountryID, rsCityID, rsSubCategoryIDs);
}
}
}