84 lines
2.7 KiB
C#
84 lines
2.7 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.GoodsManager.GoodsComments;
|
|
using ARW.Service.Api.IBusinessService.GoodsManager.GoodsComments;
|
|
using ARW.Model.Models.Business.GoodsManager.GoodsComments;
|
|
using ARW.Model.Vo.Api.GoodsManager.GoodsComments;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Geocoding;
|
|
|
|
namespace ARW.WebApi.Controllers.Api.GoodsManager.GoodsComments
|
|
{
|
|
/// <summary>
|
|
/// 商品评价控制器Api
|
|
///
|
|
/// @author admin
|
|
/// @date 2023-07-17
|
|
/// </summary>
|
|
//[Verify]
|
|
[Route("api/[controller]")]
|
|
public class GoodsCommentApiController : BaseController
|
|
{
|
|
private readonly IGoodsCommentServiceApi _GoodsCommentServiceApi;
|
|
|
|
/// <summary>
|
|
/// 依赖注入
|
|
/// </summary>
|
|
/// <param name="GoodsCommentServiceApi">商品评价商品评价Api服务</param>
|
|
public GoodsCommentApiController(IGoodsCommentServiceApi GoodsCommentServiceApi)
|
|
{
|
|
_GoodsCommentServiceApi = GoodsCommentServiceApi;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取商品评价列表(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getGoodsCommentList")]
|
|
public async Task<IActionResult> GetGoodsCommentListApi([FromQuery] GoodsCommentQueryDtoApi parm)
|
|
{
|
|
var res = await _GoodsCommentServiceApi.GetGoodsCommentListApi(parm);
|
|
return SUCCESS(res);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取商品详情页评论(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getGoodsDetailsComments")]
|
|
public async Task<IActionResult> GetGoodsDetailsComments([FromQuery] GoodsCommentDtoApi parm)
|
|
{
|
|
//if (parm == null) throw new CustomException("参数错误!");
|
|
|
|
var res = await _GoodsCommentServiceApi.GetGoodsDetailsComments(parm);
|
|
return SUCCESS(res);
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取商品详情页评论数(Api)
|
|
/// </summary>
|
|
/// <param name="parm">查询参数</param>
|
|
/// <returns></returns>
|
|
[HttpGet("getGoodsDetailsCommentsCount")]
|
|
public async Task<IActionResult> GetGoodsDetailsCommentsCount([FromQuery] GoodsCommentDtoApi parm)
|
|
{
|
|
var res = await _GoodsCommentServiceApi.GetGoodsDetailsCommentsCount(parm);
|
|
return SUCCESS(res);
|
|
}
|
|
|
|
}
|
|
}
|