82 lines
2.6 KiB
C#
82 lines
2.6 KiB
C#
using Infrastructure;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Enums;
|
|
using Infrastructure.Model;
|
|
using Mapster;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using ARW.Admin.WebApi.Extensions;
|
|
using ARW.Admin.WebApi.Filters;
|
|
using ARW.Common;
|
|
using ARW.Admin.WebApi.Controllers;
|
|
using ARW.Model.Dto.Api.Advertisement.SearchRecommends;
|
|
using ARW.Service.Api.IBusinessService.Advertisement.SearchRecommends;
|
|
using ARW.Model.Models.Business.Advertisement.SearchRecommends;
|
|
using ARW.Model.Vo.Api.Advertisement.SearchRecommends;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Geocoding;
|
|
|
|
namespace ARW.WebApi.Controllers.Api.Advertisement.SearchRecommends
|
|
{
|
|
/// <summary>
|
|
/// 搜索推荐控制器Api
|
|
///
|
|
/// @author lwh
|
|
/// @date 2023-10-25
|
|
/// </summary>
|
|
//[Verify]
|
|
[Route("api/[controller]")]
|
|
public class SearchRecommendApiController : BaseController
|
|
{
|
|
private readonly ISearchRecommendServiceApi _SearchRecommendServiceApi;
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
/// <param name="SearchRecommendServiceApi">搜索推荐搜索推荐Api服务</param>
|
|
public SearchRecommendApiController(ISearchRecommendServiceApi SearchRecommendServiceApi)
|
|
{
|
|
_SearchRecommendServiceApi = SearchRecommendServiceApi;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取搜索推荐列表(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getSearchRecommendList")]
|
|
public async Task<IActionResult> GetSearchRecommendListApi([FromQuery] SearchRecommendQueryDtoApi parm)
|
|
{
|
|
var res = await _SearchRecommendServiceApi.GetSearchRecommendListApi(parm);
|
|
return SUCCESS(res);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取SearchRecommend详情(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getSearchRecommendDetails")]
|
|
public async Task<IActionResult> GetSearchRecommendDetails([FromQuery] SearchRecommendDtoApi parm)
|
|
{
|
|
//if (parm == null) throw new CustomException("参数错误!");
|
|
|
|
var res = await _SearchRecommendServiceApi.GetSearchRecommendDetails(parm);
|
|
|
|
if (res != "[]")
|
|
{
|
|
res = res.Remove(0, 1);
|
|
res = res.Substring(0, res.Length - 1);
|
|
var data = res.FromJSON<SearchRecommendApiDetailsVo>();
|
|
return SUCCESS(data);
|
|
}
|
|
else
|
|
{
|
|
return SUCCESS(res);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|