提交 28d6a6e1 作者: 张小凤

ad(add)

上级 3f53e85c
......@@ -63,4 +63,12 @@ public class WebDeviceController {
public ResultBody update(@RequestBody LeaseVo param) {
return webDeviceService.update(param);
}
@ApiOperation("设备广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> ad() {
return webDeviceService.ad();
}
}
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.dto.AppGoodsInfoDetailDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.dto.ProductCategoryDTO;
......@@ -54,4 +55,10 @@ public class WebProductMallController {
public ResultBody<AppGoodsInfoDetailDTO> getAppGoodsInfoDetail(@RequestParam Integer id) {
return miniProgramProductMallService.getAppGoodsInfoDetail(id);
}
@ApiOperation("产品商城广告位")
@GetMapping("/ad")
public ResultBody<AdDTO> ad() {
return webProductMallService.ad();
}
}
package com.mmc.pms.dao;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.*;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -36,4 +38,6 @@ public interface WebDeviceDao {
WareInfoDO getWareInfoById(Integer id);
WareDetailDO getWareDetailById(Integer id);
List<AdDO> ad();
}
package com.mmc.pms.dao;
import com.mmc.pms.entity.AdDO;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.qo.GoodsInfoQO;
......@@ -24,4 +25,6 @@ public interface WebProductMallDao {
List<GoodsInfoDO> listGoodsInfo(GoodsInfoQO param);
Integer findProduct(Integer id);
List<AdDO> ad();
}
package com.mmc.pms.entity;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.dto.DeviceCategoryDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @Author small
* @Date 2023/5/19 14:52
* @Version 1.0
*/
@Data
public class AdDO extends BaseEntity {
@ApiModelProperty(name = "id", value = "类目id", example = "1")
private Integer id;
@ApiModelProperty(name = "imageUrl", value = "广告位图片地址", example = "")
private String imageUrl;
public AdDTO adDTO() {
return AdDTO.builder().id(this.id).imageUrl(this.imageUrl).build();
}
}
package com.mmc.pms.model.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author small
* @Date 2023/5/19 14:49
* @Version 1.0
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AdDTO {
@ApiModelProperty("1")
private Integer id;
@ApiModelProperty("广告位图片地址")
private String imageUrl;
}
......@@ -141,4 +141,17 @@ public class WebDeviceServiceImpl implements WebDeviceService {
}
return wareInfoDO == null ? null : wareInfoDO.buildWareInfoDTO();
}
@Override
public ResultBody<AdDTO> ad() {
List<AdDO> ad = webDeviceDao.ad();
List<AdDTO> collect =
ad.stream()
.map(
t -> {
return t.adDTO();
})
.collect(Collectors.toList());
return ResultBody.success(collect);
}
}
......@@ -2,8 +2,10 @@ package com.mmc.pms.service.Impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.WebProductMallDao;
import com.mmc.pms.entity.AdDO;
import com.mmc.pms.entity.GoodsInfoDO;
import com.mmc.pms.entity.ProductCategory;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.dto.GoodsInfoListDTO;
import com.mmc.pms.model.dto.ProductCategoryDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
......@@ -81,4 +83,17 @@ public class WebProductMallServiceImpl implements WebProductMallService {
goodsInfo.stream().map(GoodsInfoDO::buildGoodsInfoListDTO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
@Override
public ResultBody<AdDTO> ad() {
List<AdDO> ad = webProductMallDao.ad();
List<AdDTO> collect =
ad.stream()
.map(
t -> {
return t.adDTO();
})
.collect(Collectors.toList());
return ResultBody.success(collect);
}
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.dto.ModelDTO;
import com.mmc.pms.model.dto.WareInfoDTO;
import com.mmc.pms.model.qo.WareInfoQO;
import com.mmc.pms.model.vo.LeaseVo;
......@@ -26,4 +28,6 @@ public interface WebDeviceService {
ResultBody listWareInfoPage(WareInfoQO param);
WareInfoDTO getWareInfoById(Integer id);
ResultBody<AdDTO> ad();
}
package com.mmc.pms.service;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.dto.AdDTO;
import com.mmc.pms.model.qo.GoodsInfoQO;
import com.mmc.pms.page.PageResult;
......@@ -16,4 +17,6 @@ public interface WebProductMallService {
ResultBody productQuality();
PageResult listPageGoodsInfo(GoodsInfoQO param);
ResultBody<AdDTO> ad();
}
......@@ -233,4 +233,12 @@
from ware_detail
where ware_info_id = #{wareInfoId}
</select>
<select id="ad" resultType="com.mmc.pms.entity.AdDO">
SELECT
id,
image_url AS imageUrl
FROM
device_ad
</select>
</mapper>
......@@ -171,6 +171,12 @@
WHERE gi.is_deleted = 0
AND gi.id = #{id}
</select>
<select id="ad" resultType="com.mmc.pms.entity.AdDO">
SELECT
id,
image_url AS imageUrl
FROM
product_ad
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论