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 { /// /// 商品评价控制器Api /// /// @author admin /// @date 2023-07-17 /// //[Verify] [Route("api/[controller]")] public class GoodsCommentApiController : BaseController { private readonly IGoodsCommentServiceApi _GoodsCommentServiceApi; /// /// 依赖注入 /// /// 商品评价商品评价Api服务 public GoodsCommentApiController(IGoodsCommentServiceApi GoodsCommentServiceApi) { _GoodsCommentServiceApi = GoodsCommentServiceApi; } /// /// 获取商品评价列表(Api) /// /// 查询参数 /// [HttpGet("getGoodsCommentList")] public async Task GetGoodsCommentListApi([FromQuery] GoodsCommentQueryDtoApi parm) { var res = await _GoodsCommentServiceApi.GetGoodsCommentListApi(parm); return SUCCESS(res); } /// /// 获取商品详情页评论(Api) /// /// 查询参数 /// [HttpGet("getGoodsDetailsComments")] public async Task GetGoodsDetailsComments([FromQuery] GoodsCommentDtoApi parm) { //if (parm == null) throw new CustomException("参数错误!"); var res = await _GoodsCommentServiceApi.GetGoodsDetailsComments(parm); return SUCCESS(res); } /// /// 获取商品详情页评论数(Api) /// /// 查询参数 /// [HttpGet("getGoodsDetailsCommentsCount")] public async Task GetGoodsDetailsCommentsCount([FromQuery] GoodsCommentDtoApi parm) { var res = await _GoodsCommentServiceApi.GetGoodsDetailsCommentsCount(parm); return SUCCESS(res); } } }