Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
1fd9ab2a
提交
1fd9ab2a
authored
3月 30, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前端:H5 首页增加 Banner 列表
上级
23acc40d
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
164 行增加
和
43 行删除
+164
-43
promotion.js
mobile-web/src/api/promotion.js
+11
-0
user.js
mobile-web/src/api/user.js
+0
-9
imageAd.vue
mobile-web/src/components/page/imageAd.vue
+2
-0
page.vue
mobile-web/src/page/page/page.vue
+15
-2
UsersProductCategoryController.java
...tion/controller/users/UsersProductCategoryController.java
+1
-1
AdminsBannerController.java
...application/controller/admins/AdminsBannerController.java
+10
-10
UsersProductCategoryController.java
...tion/controller/users/UsersProductCategoryController.java
+39
-0
BannerConvert.java
...der/mall/promotion/application/convert/BannerConvert.java
+12
-5
AdminBannerPageVO.java
...ll/promotion/application/vo/admins/AdminBannerPageVO.java
+6
-6
AdminsBannerVO.java
.../mall/promotion/application/vo/admins/AdminsBannerVO.java
+10
-10
UsersBannerVO.java
...er/mall/promotion/application/vo/users/UsersBannerVO.java
+33
-0
BannerService.java
...ain/java/cn/iocoder/mall/promotion/api/BannerService.java
+4
-0
BannerMapper.java
.../java/cn/iocoder/mall/promotion/biz/dao/BannerMapper.java
+2
-0
BannerServiceImpl.java
...iocoder/mall/promotion/biz/service/BannerServiceImpl.java
+7
-0
BannerMapper.xml
...n-service-impl/src/main/resources/mapper/BannerMapper.xml
+12
-0
没有找到文件。
mobile-web/src/api/promotion.js
0 → 100644
浏览文件 @
1fd9ab2a
import
request
from
"../config/request"
;
// Banner
export
function
getBannerList
()
{
return
request
({
url
:
'promotion-api/users/banner/list'
,
method
:
'get'
,
});
}
\ No newline at end of file
mobile-web/src/api/user.js
浏览文件 @
1fd9ab2a
import
request
from
"../config/request"
;
import
request
from
"../config/request"
;
export
function
GetUserIndex
()
{
return
request
({
url
:
'/User/GetUserIndex'
,
method
:
'get'
,
})
}
export
function
GetFavorite
(
data
){
export
function
GetFavorite
(
data
){
return
request
({
return
request
({
url
:
'/User/GetFavorite'
,
url
:
'/User/GetFavorite'
,
...
@@ -108,4 +100,3 @@ export function doPassportMobileSendRegisterCode(mobile) {
...
@@ -108,4 +100,3 @@ export function doPassportMobileSendRegisterCode(mobile) {
}
}
});
});
}
}
mobile-web/src/components/page/imageAd.vue
浏览文件 @
1fd9ab2a
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
<
script
>
<
script
>
// TODO 芋艿,准备废弃。
export
default
{
export
default
{
name
:
'imageAd'
,
name
:
'imageAd'
,
components
:{
components
:{
...
...
mobile-web/src/page/page/page.vue
浏览文件 @
1fd9ab2a
<
template
>
<
template
>
<div
:style=
"'background-color:'+((page.BackgroundColor==undefined||page.BackgroundColor=='')?'#fff':page.BackgroundColor)"
>
<div
:style=
"'background-color:'+((page.BackgroundColor==undefined||page.BackgroundColor=='')?'#fff':page.BackgroundColor)"
>
<div
:style=
"'height:'+topheight+'px'"
></div>
<div
:style=
"'height:'+topheight+'px'"
></div>
<van-swipe
:autoplay=
"3000"
indicator-color=
"white"
height=
"160"
>
<van-swipe-item
v-for=
"(banner, index) in banners"
:key=
"index"
>
<img
:src=
"banner.picUrl"
height=
"100%"
width=
"100%"
>
</van-swipe-item>
</van-swipe>
<div
v-for=
"(item,index) in page.Sections"
:key=
"index"
>
<div
v-for=
"(item,index) in page.Sections"
:key=
"index"
>
<imageAd
v-if=
"item.Code=='ImageAd'"
:data=
"item.ParameterDictionary"
></imageAd>
<imageText
v-if=
"item.Code=='ImageText'"
:data=
"item.ParameterDictionary"
></imageText>
<imageText
v-if=
"item.Code=='ImageText'"
:data=
"item.ParameterDictionary"
></imageText>
<pageLine
v-if=
"item.Code=='Line'"
:data=
"item.ParameterDictionary"
></pageLine>
<pageLine
v-if=
"item.Code=='Line'"
:data=
"item.ParameterDictionary"
></pageLine>
...
@@ -38,6 +42,7 @@ import imageAd from "../../components/page/imageAd.vue";
...
@@ -38,6 +42,7 @@ import imageAd from "../../components/page/imageAd.vue";
import
imageText
from
"../../components/page/imageText.vue"
;
import
imageText
from
"../../components/page/imageText.vue"
;
import
product
from
"../../components/page/product.vue"
;
import
product
from
"../../components/page/product.vue"
;
import
{
GetPage
}
from
"../../api/page.js"
;
import
{
GetPage
}
from
"../../api/page.js"
;
import
{
getBannerList
}
from
'../../api/promotion.js'
;
export
default
{
export
default
{
name
:
"page"
,
name
:
"page"
,
...
@@ -57,6 +62,7 @@ export default {
...
@@ -57,6 +62,7 @@ export default {
return
{
return
{
topheight
:
0
,
topheight
:
0
,
page
:{},
page
:{},
banners
:
[],
// Banner 列表
}
}
},
},
created
:
function
(){
created
:
function
(){
...
@@ -64,6 +70,13 @@ export default {
...
@@ -64,6 +70,13 @@ export default {
this
.
page
=
response
;
this
.
page
=
response
;
});
});
},
},
mounted
:
function
()
{
// 加载 Banner
let
response
=
getBannerList
();
response
.
then
(
data
=>
{
this
.
banners
=
data
;
});
},
methods
:{
methods
:{
settopheight
:
function
(
value
){
settopheight
:
function
(
value
){
this
.
topheight
=
value
;
this
.
topheight
=
value
;
...
...
product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductCategoryController.java
浏览文件 @
1fd9ab2a
...
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.List
;
import
java.util.List
;
@RestController
(
"productCategoryController_users"
)
@RestController
@RequestMapping
(
"users/category"
)
@RequestMapping
(
"users/category"
)
@Api
(
"商品分类"
)
@Api
(
"商品分类"
)
public
class
UsersProductCategoryController
{
public
class
UsersProductCategoryController
{
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/controller/admins/AdminsBannerController.java
浏览文件 @
1fd9ab2a
...
@@ -8,8 +8,8 @@ import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
...
@@ -8,8 +8,8 @@ import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
import
cn.iocoder.mall.promotion.api.dto.BannerPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO
;
import
cn.iocoder.mall.promotion.application.convert.BannerConvert
;
import
cn.iocoder.mall.promotion.application.convert.BannerConvert
;
import
cn.iocoder.mall.promotion.application.vo.BannerPageVO
;
import
cn.iocoder.mall.promotion.application.vo.
admins.Admin
BannerPageVO
;
import
cn.iocoder.mall.promotion.application.vo.BannerVO
;
import
cn.iocoder.mall.promotion.application.vo.
admins.Admins
BannerVO
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -32,9 +32,9 @@ public class AdminsBannerController {
...
@@ -32,9 +32,9 @@ public class AdminsBannerController {
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"页码,从 1 开始"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"页码,从 1 开始"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页条数"
,
required
=
true
,
example
=
"10"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页条数"
,
required
=
true
,
example
=
"10"
),
})
})
public
CommonResult
<
BannerPageVO
>
page
(
@RequestParam
(
value
=
"title"
,
required
=
false
)
String
title
,
public
CommonResult
<
Admin
BannerPageVO
>
page
(
@RequestParam
(
value
=
"title"
,
required
=
false
)
String
title
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
CommonResult
<
BannerPageBO
>
result
=
bannerService
.
getBannerPage
(
new
BannerPageDTO
().
setTitle
(
title
).
setPageNo
(
pageNo
).
setPageSize
(
pageSize
));
CommonResult
<
BannerPageBO
>
result
=
bannerService
.
getBannerPage
(
new
BannerPageDTO
().
setTitle
(
title
).
setPageNo
(
pageNo
).
setPageSize
(
pageSize
));
return
BannerConvert
.
INSTANCE
.
convert
(
result
);
return
BannerConvert
.
INSTANCE
.
convert
(
result
);
}
}
...
@@ -48,11 +48,11 @@ public class AdminsBannerController {
...
@@ -48,11 +48,11 @@ public class AdminsBannerController {
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"10"
),
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"10"
),
@ApiImplicitParam
(
name
=
"memo"
,
value
=
"备注"
,
required
=
true
,
example
=
"活动很牛逼"
),
@ApiImplicitParam
(
name
=
"memo"
,
value
=
"备注"
,
required
=
true
,
example
=
"活动很牛逼"
),
})
})
public
CommonResult
<
BannerVO
>
add
(
@RequestParam
(
"title"
)
String
title
,
public
CommonResult
<
Admins
BannerVO
>
add
(
@RequestParam
(
"title"
)
String
title
,
@RequestParam
(
"url"
)
String
url
,
@RequestParam
(
"url"
)
String
url
,
@RequestParam
(
"picUrl"
)
String
picUrl
,
@RequestParam
(
"picUrl"
)
String
picUrl
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
value
=
"memo"
,
required
=
false
)
String
memo
)
{
@RequestParam
(
value
=
"memo"
,
required
=
false
)
String
memo
)
{
BannerAddDTO
bannerAddDTO
=
new
BannerAddDTO
().
setTitle
(
title
).
setUrl
(
url
).
setPicUrl
(
picUrl
)
BannerAddDTO
bannerAddDTO
=
new
BannerAddDTO
().
setTitle
(
title
).
setUrl
(
url
).
setPicUrl
(
picUrl
)
.
setSort
(
sort
).
setMemo
(
memo
);
.
setSort
(
sort
).
setMemo
(
memo
);
return
BannerConvert
.
INSTANCE
.
convert2
(
bannerService
.
addBanner
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
bannerAddDTO
));
return
BannerConvert
.
INSTANCE
.
convert2
(
bannerService
.
addBanner
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
bannerAddDTO
));
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/controller/users/UsersProductCategoryController.java
0 → 100644
浏览文件 @
1fd9ab2a
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
controller
.
users
;
import
cn.iocoder.common.framework.constant.CommonStatusEnum
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.BannerService
;
import
cn.iocoder.mall.promotion.api.bo.BannerBO
;
import
cn.iocoder.mall.promotion.application.convert.BannerConvert
;
import
cn.iocoder.mall.promotion.application.vo.users.UsersBannerVO
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Comparator
;
import
java.util.List
;
@RestController
@RequestMapping
(
"users/banner"
)
@Api
(
"Banner 模块"
)
public
class
UsersProductCategoryController
{
@Reference
(
validation
=
"true"
)
private
BannerService
bannerService
;
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得所有 Banner 列表"
)
public
CommonResult
<
List
<
UsersBannerVO
>>
list
()
{
// 查询 Banner 列表
List
<
BannerBO
>
result
=
bannerService
.
getBannerListByStatus
(
CommonStatusEnum
.
ENABLE
.
getValue
()).
getData
();
// 排序,按照 sort 升序
result
.
sort
(
Comparator
.
comparing
(
BannerBO:
:
getSort
));
// 返回
return
CommonResult
.
success
(
BannerConvert
.
INSTANCE
.
convertList
(
result
));
}
}
\ No newline at end of file
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/convert/BannerConvert.java
浏览文件 @
1fd9ab2a
...
@@ -3,24 +3,30 @@ package cn.iocoder.mall.promotion.application.convert;
...
@@ -3,24 +3,30 @@ package cn.iocoder.mall.promotion.application.convert;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.BannerBO
;
import
cn.iocoder.mall.promotion.api.bo.BannerBO
;
import
cn.iocoder.mall.promotion.api.bo.BannerPageBO
;
import
cn.iocoder.mall.promotion.api.bo.BannerPageBO
;
import
cn.iocoder.mall.promotion.application.vo.BannerPageVO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminBannerPageVO
;
import
cn.iocoder.mall.promotion.application.vo.BannerVO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsBannerVO
;
import
cn.iocoder.mall.promotion.application.vo.users.UsersBannerVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
@Mapper
@Mapper
public
interface
BannerConvert
{
public
interface
BannerConvert
{
BannerConvert
INSTANCE
=
Mappers
.
getMapper
(
BannerConvert
.
class
);
BannerConvert
INSTANCE
=
Mappers
.
getMapper
(
BannerConvert
.
class
);
@Mappings
({})
@Mappings
({})
BannerVO
convert
(
BannerBO
bannerBO
);
AdminsBannerVO
convert
(
BannerBO
bannerBO
);
@Mappings
({})
CommonResult
<
AdminsBannerVO
>
convert2
(
CommonResult
<
BannerBO
>
result
);
@Mappings
({})
@Mappings
({})
CommonResult
<
BannerVO
>
convert2
(
CommonResult
<
Banner
BO
>
result
);
CommonResult
<
AdminBannerPageVO
>
convert
(
CommonResult
<
BannerPage
BO
>
result
);
@Mappings
({})
@Mappings
({})
CommonResult
<
BannerPageVO
>
convert
(
CommonResult
<
BannerPageBO
>
result
);
List
<
UsersBannerVO
>
convertList
(
List
<
BannerBO
>
banners
);
}
}
\ No newline at end of file
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/BannerPageVO.java
→
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/
admins/Admin
BannerPageVO.java
浏览文件 @
1fd9ab2a
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
;
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
.
admins
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -6,18 +6,18 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,18 +6,18 @@ import io.swagger.annotations.ApiModelProperty;
import
java.util.List
;
import
java.util.List
;
@ApiModel
(
"Banner 分页 VO"
)
@ApiModel
(
"Banner 分页 VO"
)
public
class
BannerPageVO
{
public
class
Admin
BannerPageVO
{
@ApiModelProperty
(
value
=
"Banner 数组"
)
@ApiModelProperty
(
value
=
"Banner 数组"
)
private
List
<
BannerVO
>
list
;
private
List
<
Admins
BannerVO
>
list
;
@ApiModelProperty
(
value
=
"Banner 总数"
)
@ApiModelProperty
(
value
=
"Banner 总数"
)
private
Integer
total
;
private
Integer
total
;
public
List
<
BannerVO
>
getList
()
{
public
List
<
Admins
BannerVO
>
getList
()
{
return
list
;
return
list
;
}
}
public
BannerPageVO
setList
(
List
<
BannerVO
>
list
)
{
public
AdminBannerPageVO
setList
(
List
<
Admins
BannerVO
>
list
)
{
this
.
list
=
list
;
this
.
list
=
list
;
return
this
;
return
this
;
}
}
...
@@ -26,7 +26,7 @@ public class BannerPageVO {
...
@@ -26,7 +26,7 @@ public class BannerPageVO {
return
total
;
return
total
;
}
}
public
BannerPageVO
setTotal
(
Integer
total
)
{
public
Admin
BannerPageVO
setTotal
(
Integer
total
)
{
this
.
total
=
total
;
this
.
total
=
total
;
return
this
;
return
this
;
}
}
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/BannerVO.java
→
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/
admins/Admins
BannerVO.java
浏览文件 @
1fd9ab2a
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
;
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
.
admins
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
import
java.util.Date
;
import
java.util.Date
;
@ApiModel
(
"Banner VO"
)
@ApiModel
(
"Banner VO"
)
public
class
BannerVO
{
public
class
Admins
BannerVO
{
@ApiModelProperty
(
value
=
"Banner 编号"
,
required
=
true
,
example
=
"1"
)
@ApiModelProperty
(
value
=
"Banner 编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
private
Integer
id
;
...
@@ -29,7 +29,7 @@ public class BannerVO {
...
@@ -29,7 +29,7 @@ public class BannerVO {
return
id
;
return
id
;
}
}
public
BannerVO
setId
(
Integer
id
)
{
public
Admins
BannerVO
setId
(
Integer
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
return
this
;
return
this
;
}
}
...
@@ -38,7 +38,7 @@ public class BannerVO {
...
@@ -38,7 +38,7 @@ public class BannerVO {
return
title
;
return
title
;
}
}
public
BannerVO
setTitle
(
String
title
)
{
public
Admins
BannerVO
setTitle
(
String
title
)
{
this
.
title
=
title
;
this
.
title
=
title
;
return
this
;
return
this
;
}
}
...
@@ -47,7 +47,7 @@ public class BannerVO {
...
@@ -47,7 +47,7 @@ public class BannerVO {
return
url
;
return
url
;
}
}
public
BannerVO
setUrl
(
String
url
)
{
public
Admins
BannerVO
setUrl
(
String
url
)
{
this
.
url
=
url
;
this
.
url
=
url
;
return
this
;
return
this
;
}
}
...
@@ -56,7 +56,7 @@ public class BannerVO {
...
@@ -56,7 +56,7 @@ public class BannerVO {
return
sort
;
return
sort
;
}
}
public
BannerVO
setSort
(
Integer
sort
)
{
public
Admins
BannerVO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
this
.
sort
=
sort
;
return
this
;
return
this
;
}
}
...
@@ -65,7 +65,7 @@ public class BannerVO {
...
@@ -65,7 +65,7 @@ public class BannerVO {
return
status
;
return
status
;
}
}
public
BannerVO
setStatus
(
Integer
status
)
{
public
Admins
BannerVO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
this
.
status
=
status
;
return
this
;
return
this
;
}
}
...
@@ -74,7 +74,7 @@ public class BannerVO {
...
@@ -74,7 +74,7 @@ public class BannerVO {
return
memo
;
return
memo
;
}
}
public
BannerVO
setMemo
(
String
memo
)
{
public
Admins
BannerVO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
this
.
memo
=
memo
;
return
this
;
return
this
;
}
}
...
@@ -83,7 +83,7 @@ public class BannerVO {
...
@@ -83,7 +83,7 @@ public class BannerVO {
return
createTime
;
return
createTime
;
}
}
public
BannerVO
setCreateTime
(
Date
createTime
)
{
public
Admins
BannerVO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
this
.
createTime
=
createTime
;
return
this
;
return
this
;
}
}
...
@@ -92,7 +92,7 @@ public class BannerVO {
...
@@ -92,7 +92,7 @@ public class BannerVO {
return
picUrl
;
return
picUrl
;
}
}
public
BannerVO
setPicUrl
(
String
picUrl
)
{
public
Admins
BannerVO
setPicUrl
(
String
picUrl
)
{
this
.
picUrl
=
picUrl
;
this
.
picUrl
=
picUrl
;
return
this
;
return
this
;
}
}
...
...
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/users/UsersBannerVO.java
0 → 100644
浏览文件 @
1fd9ab2a
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
.
users
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
@ApiModel
(
"Banner VO"
)
public
class
UsersBannerVO
{
@ApiModelProperty
(
value
=
"跳转链接"
,
required
=
true
,
example
=
"http://www.baidu.com"
)
private
String
url
;
@ApiModelProperty
(
value
=
"图片链接"
,
required
=
true
,
example
=
"http://www.iocoder.cn/01.jpg"
)
private
String
picUrl
;
public
String
getUrl
()
{
return
url
;
}
public
UsersBannerVO
setUrl
(
String
url
)
{
this
.
url
=
url
;
return
this
;
}
public
String
getPicUrl
()
{
return
picUrl
;
}
public
UsersBannerVO
setPicUrl
(
String
picUrl
)
{
this
.
picUrl
=
picUrl
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/BannerService.java
浏览文件 @
1fd9ab2a
...
@@ -7,8 +7,12 @@ import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
...
@@ -7,8 +7,12 @@ import cn.iocoder.mall.promotion.api.dto.BannerAddDTO;
import
cn.iocoder.mall.promotion.api.dto.BannerPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO
;
import
cn.iocoder.mall.promotion.api.dto.BannerUpdateDTO
;
import
java.util.List
;
public
interface
BannerService
{
public
interface
BannerService
{
CommonResult
<
List
<
BannerBO
>>
getBannerListByStatus
(
Integer
status
);
CommonResult
<
BannerPageBO
>
getBannerPage
(
BannerPageDTO
bannerPageDTO
);
CommonResult
<
BannerPageBO
>
getBannerPage
(
BannerPageDTO
bannerPageDTO
);
CommonResult
<
BannerBO
>
addBanner
(
Integer
adminId
,
BannerAddDTO
bannerAddDTO
);
CommonResult
<
BannerBO
>
addBanner
(
Integer
adminId
,
BannerAddDTO
bannerAddDTO
);
...
...
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/dao/BannerMapper.java
浏览文件 @
1fd9ab2a
...
@@ -11,6 +11,8 @@ public interface BannerMapper {
...
@@ -11,6 +11,8 @@ public interface BannerMapper {
BannerDO
selectById
(
@Param
(
"id"
)
Integer
id
);
BannerDO
selectById
(
@Param
(
"id"
)
Integer
id
);
List
<
BannerDO
>
selectListByStatus
(
@Param
(
"status"
)
Integer
status
);
List
<
BannerDO
>
selectListByTitleLike
(
@Param
(
"title"
)
String
title
,
List
<
BannerDO
>
selectListByTitleLike
(
@Param
(
"title"
)
String
title
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
@Param
(
"limit"
)
Integer
limit
);
...
...
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/BannerServiceImpl.java
浏览文件 @
1fd9ab2a
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -19,6 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
@Service
// 实际上不用添加。添加的原因是,必须 Spring 报错提示
@Service
// 实际上不用添加。添加的原因是,必须 Spring 报错提示
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
...
@@ -27,6 +28,12 @@ public class BannerServiceImpl implements BannerService {
...
@@ -27,6 +28,12 @@ public class BannerServiceImpl implements BannerService {
@Autowired
@Autowired
private
BannerMapper
bannerMapper
;
private
BannerMapper
bannerMapper
;
@Override
public
CommonResult
<
List
<
BannerBO
>>
getBannerListByStatus
(
Integer
status
)
{
List
<
BannerDO
>
banners
=
bannerMapper
.
selectListByStatus
(
status
);
return
CommonResult
.
success
(
BannerConvert
.
INSTANCE
.
convertToBO
(
banners
));
}
@Override
@Override
public
CommonResult
<
BannerPageBO
>
getBannerPage
(
BannerPageDTO
bannerPageDTO
)
{
public
CommonResult
<
BannerPageBO
>
getBannerPage
(
BannerPageDTO
bannerPageDTO
)
{
BannerPageBO
bannerPageBO
=
new
BannerPageBO
();
BannerPageBO
bannerPageBO
=
new
BannerPageBO
();
...
...
promotion/promotion-service-impl/src/main/resources/mapper/BannerMapper.xml
浏览文件 @
1fd9ab2a
...
@@ -32,6 +32,18 @@
...
@@ -32,6 +32,18 @@
AND deleted = 0
AND deleted = 0
</select>
</select>
<select
id=
"selectListByStatus"
parameterType=
"Integer"
resultType=
"BannerDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM banner
<where>
<if
test=
"status != null"
>
status = #{status}
</if>
AND deleted = 0
</where>
</select>
<select
id=
"selectListByTitleLike"
resultType=
"BannerDO"
>
<select
id=
"selectListByTitleLike"
resultType=
"BannerDO"
>
SELECT
SELECT
<include
refid=
"FIELDS"
/>
<include
refid=
"FIELDS"
/>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论