Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
85a1be39
提交
85a1be39
authored
3月 31, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master'
上级
bbd23cae
b333340c
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
45 个修改的文件
包含
1632 行增加
和
69 行删除
+1632
-69
proxy.dev.js
admin-web/config/proxy/proxy.dev.js
+7
-1
router.config.js
admin-web/config/router.config.js
+23
-0
admin.js
admin-web/mock/admin.js
+5
-5
menu.js
admin-web/src/locales/zh-CN/menu.js
+2
-0
bannerList.js
admin-web/src/models/promotion/bannerList.js
+256
-0
ProductCategoryList.js
admin-web/src/pages/Product/ProductCategoryList.js
+0
-1
BannerList.js
admin-web/src/pages/Promotion/BannerList.js
+0
-0
BannerList.less
admin-web/src/pages/Promotion/BannerList.less
+48
-0
promotion.js
admin-web/src/services/promotion.js
+35
-0
ResourceController.java
...min/application/controller/admins/ResourceController.java
+4
-4
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
index.vue
mobile-web/src/page/index.vue
+3
-4
index.vue
mobile-web/src/page/page/index.vue
+24
-5
UsersProductCategoryController.java
...tion/controller/users/UsersProductCategoryController.java
+1
-1
AdminsBannerController.java
...application/controller/admins/AdminsBannerController.java
+10
-10
AdminsProductRecommendController.java
...n/controller/admins/AdminsProductRecommendController.java
+97
-0
UsersProductCategoryController.java
...tion/controller/users/UsersProductCategoryController.java
+39
-0
BannerConvert.java
...der/mall/promotion/application/convert/BannerConvert.java
+12
-5
ProductRecommendConvert.java
...romotion/application/convert/ProductRecommendConvert.java
+30
-0
AdminsBannerPageVO.java
...l/promotion/application/vo/admins/AdminsBannerPageVO.java
+6
-6
AdminsBannerVO.java
.../mall/promotion/application/vo/admins/AdminsBannerVO.java
+11
-11
AdminsProductRecommendPageVO.java
...n/application/vo/admins/AdminsProductRecommendPageVO.java
+35
-0
AdminsProductRecommendVO.java
...otion/application/vo/admins/AdminsProductRecommendVO.java
+89
-0
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
ProductRecommendService.java
...n/iocoder/mall/promotion/api/ProductRecommendService.java
+27
-0
ProductRecommendBO.java
.../cn/iocoder/mall/promotion/api/bo/ProductRecommendBO.java
+107
-0
ProductRecommendPageBO.java
...iocoder/mall/promotion/api/bo/ProductRecommendPageBO.java
+35
-0
ProductRecommendType.java
...der/mall/promotion/api/constant/ProductRecommendType.java
+44
-0
PromotionErrorCodeEnum.java
...r/mall/promotion/api/constant/PromotionErrorCodeEnum.java
+7
-1
BannerAddDTO.java
.../java/cn/iocoder/mall/promotion/api/dto/BannerAddDTO.java
+3
-1
BannerUpdateDTO.java
...va/cn/iocoder/mall/promotion/api/dto/BannerUpdateDTO.java
+4
-1
ProductRecommendAddDTO.java
...ocoder/mall/promotion/api/dto/ProductRecommendAddDTO.java
+58
-0
ProductRecommendPageDTO.java
...coder/mall/promotion/api/dto/ProductRecommendPageDTO.java
+45
-0
ProductRecommendUpdateDTO.java
...der/mall/promotion/api/dto/ProductRecommendUpdateDTO.java
+69
-0
ProductRecommendConvert.java
...r/mall/promotion/biz/convert/ProductRecommendConvert.java
+31
-0
BannerMapper.java
.../java/cn/iocoder/mall/promotion/biz/dao/BannerMapper.java
+2
-0
ProductRecommendMapper.java
...ocoder/mall/promotion/biz/dao/ProductRecommendMapper.java
+31
-0
ProductRecommendDO.java
...der/mall/promotion/biz/dataobject/ProductRecommendDO.java
+95
-0
BannerServiceImpl.java
...iocoder/mall/promotion/biz/service/BannerServiceImpl.java
+12
-1
ProductRecommendServiceImpl.java
...ll/promotion/biz/service/ProductRecommendServiceImpl.java
+134
-0
BannerMapper.xml
...n-service-impl/src/main/resources/mapper/BannerMapper.xml
+15
-3
ProductRecommendMapper.xml
...impl/src/main/resources/mapper/ProductRecommendMapper.xml
+126
-0
没有找到文件。
admin-web/config/proxy/proxy.dev.js
浏览文件 @
85a1be39
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
export
default
{
export
default
{
'/admin-api/'
:
{
'/admin-api/'
:
{
target
:
'http://180.167.213.26:18083/'
,
// target: 'http://180.167.213.26:18083/',
target
:
'http://127.0.0.1:18083/'
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{},
pathRewrite
:
{},
},
},
...
@@ -11,4 +12,9 @@ export default {
...
@@ -11,4 +12,9 @@ export default {
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{},
pathRewrite
:
{},
},
},
'/promotion-api/'
:
{
target
:
'http://127.0.0.1:18085/'
,
changeOrigin
:
true
,
pathRewrite
:
{},
},
};
};
admin-web/config/router.config.js
浏览文件 @
85a1be39
...
@@ -94,6 +94,29 @@ export default [
...
@@ -94,6 +94,29 @@ export default [
},
},
],
],
},
},
// promotion
{
path
:
'/promotion'
,
name
:
'promotion'
,
icon
:
'user'
,
routes
:
[
{
path
:
'/promotion/banner-list'
,
name
:
'promotion-banner-list'
,
component
:
'./Promotion/BannerList'
,
},
// {
// path: '/product/product-spu-add',
// name: 'product-spu-add',
// component: './Product/ProductSpuAddOrUpdate',
// },
// {
// path: '/product/product-category-list',
// name: 'product-category-list',
// component: './Product/ProductCategoryList',
// },
],
},
{
{
path
:
'/dashboard'
,
path
:
'/dashboard'
,
name
:
'dashboard'
,
name
:
'dashboard'
,
...
...
admin-web/mock/admin.js
浏览文件 @
85a1be39
...
@@ -49,10 +49,10 @@ function getDictionaryTree(req, res) {
...
@@ -49,10 +49,10 @@ function getDictionaryTree(req, res) {
}
}
export
default
{
export
default
{
'GET /admin-api/admins/admin/menu_resource_tree'
:
getAdminMenuAll
,
//
'GET /admin-api/admins/admin/menu_resource_tree': getAdminMenuAll,
'GET /admin-api/admins/admin/url_resource_list'
:
getAdminUrls
,
//
'GET /admin-api/admins/admin/url_resource_list': getAdminUrls,
'GET /admin-api/admins/resource/tree'
:
getResourceTree
,
//
'GET /admin-api/admins/resource/tree': getResourceTree,
'GET /admin-api/admins/role/page'
:
getQueryRole
,
//
'GET /admin-api/admins/role/page': getQueryRole,
// 'GET /admin-api/admins/admin/page': getQueryRole,
// 'GET /admin-api/admins/admin/page': getQueryRole,
'GET /admin-api/admins/data_dict/tree'
:
getDictionaryTree
,
//
'GET /admin-api/admins/data_dict/tree': getDictionaryTree,
};
};
admin-web/src/locales/zh-CN/menu.js
浏览文件 @
85a1be39
...
@@ -52,4 +52,6 @@ export default {
...
@@ -52,4 +52,6 @@ export default {
// 订单
// 订单
'menu.order'
:
'订单管理'
,
'menu.order'
:
'订单管理'
,
'menu.order.order-list'
:
'订单管理'
,
'menu.order.order-list'
:
'订单管理'
,
// 营销相关
'menu.promotion.promotion-banner-list'
:
'Banner 管理'
};
};
admin-web/src/models/promotion/bannerList.js
0 → 100644
浏览文件 @
85a1be39
import
{
message
}
from
'antd'
;
import
{
buildTreeNode
,
findCheckedKeys
}
from
'../../utils/tree.utils'
;
import
{
addBanner
,
adminRoleAssign
,
deleteBanner
,
queryBanner
,
queryBannerRoleList
,
updateBanner
,
updateBannerStatus
,
}
from
'../../services/promotion'
;
import
{
arrayToStringParams
}
from
'../../utils/request.qs'
;
import
PaginationHelper
from
'../../../helpers/PaginationHelper'
;
const
SEARCH_PARAMS_DEFAULT
=
{
title
:
''
,
};
export
default
{
namespace
:
'bannerList'
,
state
:
{
// 分页列表相关
list
:
[],
listLoading
:
false
,
pagination
:
PaginationHelper
.
defaultPaginationConfig
,
searchParams
:
SEARCH_PARAMS_DEFAULT
,
// 添加 or 修改表单相关
modalVisible
:
false
,
modalType
:
undefined
,
// 'add' or 'update' 表单
formVals
:
{},
// 当前表单值
modalLoading
:
false
,
// 分配角色表单相关
roleList
:
[],
roleModalVisible
:
false
,
roleCheckedKeys
:
[],
// 此处的 Key ,就是角色编号
roleAssignLoading
:
false
,
},
effects
:
{
// 查询列表
*
query
({
payload
},
{
call
,
put
})
{
// 显示加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
queryBanner
,
payload
);
// 响应
yield
put
({
type
:
'setAll'
,
payload
:
{
list
:
response
.
data
.
list
,
pagination
:
PaginationHelper
.
formatPagination
(
response
.
data
,
payload
),
searchParams
:
{
title
:
payload
.
title
||
''
}
},
});
// 隐藏加载中
yield
put
({
type
:
'changeListLoading'
,
payload
:
false
,
});
},
*
add
({
payload
},
{
call
,
put
})
{
const
{
callback
,
body
}
=
payload
;
// 显示加载中
yield
put
({
type
:
'changeModalLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
addBanner
,
body
);
// 响应
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
// 刷新列表
yield
put
({
type
:
'query'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
},
});
}
// 隐藏加载中
yield
put
({
type
:
'changeModalLoading'
,
payload
:
false
,
});
},
*
update
({
payload
},
{
call
,
put
})
{
const
{
callback
,
body
}
=
payload
;
// 显示加载中
yield
put
({
type
:
'changeModalLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
updateBanner
,
body
);
// 响应
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
// 刷新列表
yield
put
({
type
:
'query'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
},
});
}
// 隐藏加载中
yield
put
({
type
:
'changeModalLoading'
,
payload
:
false
,
});
},
*
updateStatus
({
payload
},
{
call
,
put
})
{
// 请求
const
response
=
yield
call
(
updateBannerStatus
,
payload
);
// 响应
if
(
response
.
code
===
0
)
{
message
.
info
(
'更新状态成功!'
);
// 刷新列表
yield
put
({
type
:
'query'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
},
});
}
},
*
delete
({
payload
},
{
call
,
put
})
{
// 请求
const
response
=
yield
call
(
deleteBanner
,
payload
);
// 响应
if
(
response
.
code
===
0
)
{
message
.
info
(
'删除成功!'
);
// 刷新列表
yield
put
({
type
:
'query'
,
payload
:
{
...
PaginationHelper
.
defaultPayload
},
});
}
},
*
queryRoleList
({
payload
},
{
call
,
put
})
{
// 显示加载中
yield
put
({
type
:
'changeRoleAssignLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
queryBannerRoleList
,
payload
);
// 响应
if
(
response
.
code
===
0
)
{
const
roleList
=
response
.
data
;
const
roleTreeData
=
buildTreeNode
(
roleList
,
'name'
,
'id'
);
const
roleCheckedKeys
=
findCheckedKeys
(
roleList
);
yield
put
({
type
:
'setAll'
,
payload
:
{
roleList
:
roleTreeData
,
roleCheckedKeys
,
},
});
}
// 隐藏加载中
yield
put
({
type
:
'changeRoleAssignLoading'
,
payload
:
false
,
});
},
*
roleAssign
({
payload
},
{
call
,
put
})
{
const
{
callback
,
body
}
=
payload
;
// 显示加载中
yield
put
({
type
:
'changeRoleAssignLoading'
,
payload
:
true
,
});
// 请求
const
response
=
yield
call
(
adminRoleAssign
,
{
id
:
body
.
id
,
roleIds
:
arrayToStringParams
(
body
.
roleIds
),
});
// 响应
if
(
response
.
code
===
0
)
{
if
(
callback
)
{
callback
(
response
);
}
}
// 隐藏加载中
yield
put
({
type
:
'changeRoleAssignLoading'
,
payload
:
false
,
});
},
},
reducers
:
{
changeRoleCheckedKeys
(
state
,
{
payload
})
{
return
{
...
state
,
roleCheckedKeys
:
payload
,
};
},
// 修改加载中的状态
changeRoleAssignLoading
(
state
,
{
payload
})
{
return
{
...
state
,
roleAssignLoading
:
payload
,
};
},
changeModalLoading
(
state
,
{
payload
})
{
return
{
...
state
,
modalLoading
:
payload
,
};
},
changeListLoading
(
state
,
{
payload
})
{
return
{
...
state
,
listLoading
:
payload
,
};
},
// 设置所有属性
setAll
(
state
,
{
payload
})
{
return
{
...
state
,
...
payload
,
};
}
},
};
admin-web/src/pages/Product/ProductCategoryList.js
浏览文件 @
85a1be39
...
@@ -209,7 +209,6 @@ class ProductCategoryList extends PureComponent {
...
@@ -209,7 +209,6 @@ class ProductCategoryList extends PureComponent {
{
{
title
:
'排序值'
,
title
:
'排序值'
,
dataIndex
:
'sort'
,
dataIndex
:
'sort'
,
render
:
sort
=>
<
span
>
{
sort
}
<
/span>
,
},
},
{
{
title
:
'创建时间'
,
title
:
'创建时间'
,
...
...
admin-web/src/pages/Promotion/BannerList.js
0 → 100644
浏览文件 @
85a1be39
差异被折叠。
点击展开。
admin-web/src/pages/Promotion/BannerList.less
0 → 100644
浏览文件 @
85a1be39
@import '~antd/lib/style/themes/default.less';
@import '~@/utils/utils.less';
.tableList {
.tableListOperator {
margin-bottom: 16px;
button {
margin-right: 8px;
}
}
}
.tableDelete {
color: red;
}
.tableListForm {
:global {
.ant-form-item {
display: flex;
margin-right: 0;
margin-bottom: 24px;
> .ant-form-item-label {
width: auto;
padding-right: 8px;
line-height: 32px;
}
.ant-form-item-control {
line-height: 32px;
}
}
.ant-form-item-control-wrapper {
flex: 1;
}
}
.submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
}
@media screen and (max-width: @screen-lg) {
.tableListForm :global(.ant-form-item) {
margin-right: 24px;
}
}
\ No newline at end of file
admin-web/src/services/promotion.js
0 → 100644
浏览文件 @
85a1be39
import
{
stringify
}
from
'@/utils/request.qs'
;
import
request
from
'@/utils/request'
;
// banner
export
async
function
queryBanner
(
params
)
{
return
request
(
`/promotion-api/admins/banner/page?
${
stringify
(
params
)}
`
,
{
method
:
'GET'
,
});
}
export
async
function
addBanner
(
params
)
{
return
request
(
`/promotion-api/admins/banner/add?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
updateBanner
(
params
)
{
return
request
(
`/promotion-api/admins/banner/update?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
updateBannerStatus
(
params
)
{
return
request
(
`/promotion-api/admins/banner/update_status?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
export
async
function
deleteBanner
(
params
)
{
return
request
(
`/promotion-api/admins/banner/delete?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
});
}
\ No newline at end of file
admin/admin-application/src/main/java/cn/iocoder/mall/admin/application/controller/admins/ResourceController.java
浏览文件 @
85a1be39
...
@@ -66,14 +66,14 @@ public class ResourceController {
...
@@ -66,14 +66,14 @@ public class ResourceController {
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"displayName"
,
value
=
"菜单展示名"
,
required
=
true
,
example
=
"商品管理"
),
@ApiImplicitParam
(
name
=
"displayName"
,
value
=
"菜单展示名"
,
required
=
true
,
example
=
"商品管理"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"父级资源编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"父级资源编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"handler"
,
value
=
"操作"
,
required
=
true
,
example
=
"/order/list"
),
@ApiImplicitParam
(
name
=
"handler"
,
value
=
"操作"
,
example
=
"/order/list"
),
})
})
public
CommonResult
<
ResourceVO
>
add
(
@RequestParam
(
"name"
)
String
name
,
public
CommonResult
<
ResourceVO
>
add
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"displayName"
)
String
displayName
,
@RequestParam
(
"displayName"
)
String
displayName
,
@RequestParam
(
"pid"
)
Integer
pid
,
@RequestParam
(
"pid"
)
Integer
pid
,
@RequestParam
(
"handler"
)
String
handler
)
{
@RequestParam
(
value
=
"handler"
,
required
=
false
)
String
handler
)
{
ResourceAddDTO
resourceAddDTO
=
new
ResourceAddDTO
().
setName
(
name
).
setType
(
type
).
setSort
(
sort
)
ResourceAddDTO
resourceAddDTO
=
new
ResourceAddDTO
().
setName
(
name
).
setType
(
type
).
setSort
(
sort
)
.
setDisplayName
(
displayName
).
setPid
(
pid
).
setHandler
(
handler
);
.
setDisplayName
(
displayName
).
setPid
(
pid
).
setHandler
(
handler
);
return
ResourceConvert
.
INSTANCE
.
convert3
(
resourceService
.
addResource
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
resourceAddDTO
));
return
ResourceConvert
.
INSTANCE
.
convert3
(
resourceService
.
addResource
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
resourceAddDTO
));
...
@@ -87,14 +87,14 @@ public class ResourceController {
...
@@ -87,14 +87,14 @@ public class ResourceController {
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"displayName"
,
value
=
"菜单展示名"
,
required
=
true
,
example
=
"商品管理"
),
@ApiImplicitParam
(
name
=
"displayName"
,
value
=
"菜单展示名"
,
required
=
true
,
example
=
"商品管理"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"父级资源编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"父级资源编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"handler"
,
value
=
"操作"
,
required
=
true
,
example
=
"/order/list"
),
@ApiImplicitParam
(
name
=
"handler"
,
value
=
"操作"
,
example
=
"/order/list"
),
})
})
public
CommonResult
<
Boolean
>
update
(
@RequestParam
(
"id"
)
Integer
id
,
public
CommonResult
<
Boolean
>
update
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
"displayName"
)
String
displayName
,
@RequestParam
(
"displayName"
)
String
displayName
,
@RequestParam
(
"pid"
)
Integer
pid
,
@RequestParam
(
"pid"
)
Integer
pid
,
@RequestParam
(
"handler"
)
String
handler
)
{
@RequestParam
(
value
=
"handler"
,
required
=
false
)
String
handler
)
{
ResourceUpdateDTO
resourceUpdateDTO
=
new
ResourceUpdateDTO
().
setId
(
id
).
setName
(
name
).
setSort
(
sort
).
setDisplayName
(
displayName
).
setPid
(
pid
).
setHandler
(
handler
);
ResourceUpdateDTO
resourceUpdateDTO
=
new
ResourceUpdateDTO
().
setId
(
id
).
setName
(
name
).
setSort
(
sort
).
setDisplayName
(
displayName
).
setPid
(
pid
).
setHandler
(
handler
);
return
resourceService
.
updateResource
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
resourceUpdateDTO
);
return
resourceService
.
updateResource
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
resourceUpdateDTO
);
}
}
...
...
mobile-web/src/api/promotion.js
0 → 100644
浏览文件 @
85a1be39
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
浏览文件 @
85a1be39
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
浏览文件 @
85a1be39
...
@@ -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/index.vue
浏览文件 @
85a1be39
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<
script
>
<
script
>
import
navigate
from
'../components/footer/navigate.vue'
import
navigate
from
'../components/footer/navigate.vue'
import
page
from
'./page/
page
.vue'
import
page
from
'./page/
index
.vue'
export
default
{
export
default
{
components
:{
components
:{
...
@@ -18,6 +18,4 @@ export default {
...
@@ -18,6 +18,4 @@ export default {
</
script
>
</
script
>
<
style
>
<
style
>
</
style
>
</
style
>
\ No newline at end of file
mobile-web/src/page/page/
page
.vue
→
mobile-web/src/page/page/
index
.vue
浏览文件 @
85a1be39
<
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"
>
<a
:href=
"banner.url"
>
<img
:src=
"banner.picUrl"
height=
"100%"
width=
"100%"
>
</a>
</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 +44,7 @@ import imageAd from "../../components/page/imageAd.vue";
...
@@ -38,6 +44,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 +64,7 @@ export default {
...
@@ -57,6 +64,7 @@ export default {
return
{
return
{
topheight
:
0
,
topheight
:
0
,
page
:{},
page
:{},
banners
:
[],
// Banner 列表
}
}
},
},
created
:
function
(){
created
:
function
(){
...
@@ -64,10 +72,21 @@ export default {
...
@@ -64,10 +72,21 @@ 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
){
onBannerClick
:
function
(
event
,
index
)
{
this
.
topheight
=
value
;
debugger
;
}
console
.
log
(
event
);
},
settopheight
:
function
(
value
){
this
.
topheight
=
value
;
}
}
}
}
}
</
script
>
</
script
>
product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductCategoryController.java
浏览文件 @
85a1be39
...
@@ -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
浏览文件 @
85a1be39
...
@@ -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.Admins
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
<
Admins
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/admins/AdminsProductRecommendController.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
controller
.
admins
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.admin.sdk.context.AdminSecurityContextHolder
;
import
cn.iocoder.mall.promotion.api.ProductRecommendService
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO
;
import
cn.iocoder.mall.promotion.application.convert.ProductRecommendConvert
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"admins/product_recommend"
)
@Api
(
"商品推荐模块"
)
public
class
AdminsProductRecommendController
{
@Reference
(
validation
=
"true"
)
private
ProductRecommendService
productRecommendService
;
@GetMapping
(
"/page"
)
@ApiOperation
(
value
=
"商品推荐分页"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"推荐类型"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"页码,从 1 开始"
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页条数"
,
required
=
true
,
example
=
"10"
),
})
public
CommonResult
<
AdminsProductRecommendPageVO
>
page
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
@RequestParam
(
value
=
"pageNo"
,
defaultValue
=
"0"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
Integer
pageSize
)
{
CommonResult
<
ProductRecommendPageBO
>
result
=
productRecommendService
.
getProductRecommendPage
(
new
ProductRecommendPageDTO
().
setType
(
type
).
setPageNo
(
pageNo
).
setPageSize
(
pageSize
));
return
ProductRecommendConvert
.
INSTANCE
.
convert
(
result
);
}
@PostMapping
(
"/add"
)
@ApiOperation
(
value
=
"创建商品推荐"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"type"
,
value
=
"推荐类型"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"productSpuId"
,
value
=
"商品编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"10"
),
@ApiImplicitParam
(
name
=
"memo"
,
value
=
"备注"
,
example
=
"活动很牛逼"
),
})
public
CommonResult
<
AdminsProductRecommendVO
>
add
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"productSpuId"
)
Integer
productSpuId
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
value
=
"memo"
,
required
=
false
)
String
memo
)
{
ProductRecommendAddDTO
bannerAddDTO
=
new
ProductRecommendAddDTO
().
setType
(
type
).
setProductSpuId
(
productSpuId
)
.
setSort
(
sort
).
setMemo
(
memo
);
return
ProductRecommendConvert
.
INSTANCE
.
convert2
(
productRecommendService
.
addProductRecommend
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
bannerAddDTO
));
}
@PostMapping
(
"/update"
)
@ApiOperation
(
value
=
"更新商品推荐"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"商品推荐编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"推荐类型"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"productSpuId"
,
value
=
"商品编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"10"
),
@ApiImplicitParam
(
name
=
"memo"
,
value
=
"备注"
,
example
=
"活动很牛逼"
),
})
public
CommonResult
<
Boolean
>
update
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"productSpuId"
)
Integer
productSpuId
,
@RequestParam
(
"sort"
)
Integer
sort
,
@RequestParam
(
value
=
"memo"
,
required
=
false
)
String
memo
)
{
ProductRecommendUpdateDTO
bannerUpdateDTO
=
new
ProductRecommendUpdateDTO
().
setId
(
id
).
setType
(
type
).
setProductSpuId
(
productSpuId
)
.
setSort
(
sort
).
setMemo
(
memo
);
return
productRecommendService
.
updateProductRecommend
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
bannerUpdateDTO
);
}
@PostMapping
(
"/update_status"
)
@ApiOperation
(
value
=
"更新商品推荐状态"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"商品推荐编号"
,
required
=
true
,
example
=
"1"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态。1 - 开启;2 - 禁用"
,
required
=
true
,
example
=
"1"
),
})
public
CommonResult
<
Boolean
>
updateStatus
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"status"
)
Integer
status
)
{
return
productRecommendService
.
updateProductRecommendStatus
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
id
,
status
);
}
@PostMapping
(
"/delete"
)
@ApiOperation
(
value
=
"删除商品推荐"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"商品推荐编号"
,
required
=
true
,
example
=
"1"
)
public
CommonResult
<
Boolean
>
delete
(
@RequestParam
(
"id"
)
Integer
id
)
{
return
productRecommendService
.
deleteProductRecommend
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
id
);
}
}
\ No newline at end of file
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/controller/users/UsersProductCategoryController.java
0 → 100644
浏览文件 @
85a1be39
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
浏览文件 @
85a1be39
...
@@ -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.AdminsBannerPageVO
;
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
<
AdminsBannerPageVO
>
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/convert/ProductRecommendConvert.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
convert
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendBO
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendPageVO
;
import
cn.iocoder.mall.promotion.application.vo.admins.AdminsProductRecommendVO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
@Mapper
public
interface
ProductRecommendConvert
{
ProductRecommendConvert
INSTANCE
=
Mappers
.
getMapper
(
ProductRecommendConvert
.
class
);
@Mappings
({})
AdminsProductRecommendVO
convert
(
ProductRecommendBO
bannerBO
);
@Mappings
({})
CommonResult
<
AdminsProductRecommendVO
>
convert2
(
CommonResult
<
ProductRecommendBO
>
result
);
@Mappings
({})
CommonResult
<
AdminsProductRecommendPageVO
>
convert
(
CommonResult
<
ProductRecommendPageBO
>
result
);
// @Mappings({})
// List<UsersProductRecommendVO> convertList(List<ProductRecommendBO> 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/Admins
BannerPageVO.java
浏览文件 @
85a1be39
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
Admins
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
AdminsBannerPageVO
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
Admins
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
浏览文件 @
85a1be39
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
;
...
@@ -14,7 +14,7 @@ public class BannerVO {
...
@@ -14,7 +14,7 @@ public class BannerVO {
private
String
title
;
private
String
title
;
@ApiModelProperty
(
value
=
"跳转链接"
,
required
=
true
,
example
=
"http://www.baidu.com"
)
@ApiModelProperty
(
value
=
"跳转链接"
,
required
=
true
,
example
=
"http://www.baidu.com"
)
private
String
url
;
private
String
url
;
@ApiModelProperty
(
value
=
"
突脸
链接"
,
required
=
true
,
example
=
"http://www.iocoder.cn/01.jpg"
)
@ApiModelProperty
(
value
=
"
图片
链接"
,
required
=
true
,
example
=
"http://www.iocoder.cn/01.jpg"
)
private
String
picUrl
;
private
String
picUrl
;
@ApiModelProperty
(
value
=
"排序"
,
required
=
true
,
example
=
"10"
)
@ApiModelProperty
(
value
=
"排序"
,
required
=
true
,
example
=
"10"
)
private
Integer
sort
;
private
Integer
sort
;
...
@@ -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/admins/AdminsProductRecommendPageVO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
.
admins
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.List
;
@ApiModel
(
"商品推荐分页 VO"
)
public
class
AdminsProductRecommendPageVO
{
@ApiModelProperty
(
value
=
"商品推荐数组"
)
private
List
<
AdminsProductRecommendVO
>
list
;
@ApiModelProperty
(
value
=
"商品推荐总数"
)
private
Integer
total
;
public
List
<
AdminsProductRecommendVO
>
getList
()
{
return
list
;
}
public
AdminsProductRecommendPageVO
setList
(
List
<
AdminsProductRecommendVO
>
list
)
{
this
.
list
=
list
;
return
this
;
}
public
Integer
getTotal
()
{
return
total
;
}
public
AdminsProductRecommendPageVO
setTotal
(
Integer
total
)
{
this
.
total
=
total
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/admins/AdminsProductRecommendVO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
application
.
vo
.
admins
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
@ApiModel
(
"商品推荐 VO"
)
public
class
AdminsProductRecommendVO
{
@ApiModelProperty
(
value
=
"编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"推荐类型"
,
required
=
true
,
example
=
"1"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"商品编号"
,
required
=
true
,
example
=
"1"
)
private
Integer
productSpuId
;
@ApiModelProperty
(
value
=
"排序"
,
required
=
true
,
example
=
"10"
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"状态"
,
required
=
true
,
example
=
"1"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"备注"
,
required
=
true
,
example
=
"这个活动很牛逼"
)
private
String
memo
;
@ApiModelProperty
(
value
=
"创建时间"
,
required
=
true
,
example
=
"时间戳格式"
)
private
Date
createTime
;
public
Integer
getId
()
{
return
id
;
}
public
AdminsProductRecommendVO
setId
(
Integer
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
AdminsProductRecommendVO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getProductSpuId
()
{
return
productSpuId
;
}
public
AdminsProductRecommendVO
setProductSpuId
(
Integer
productSpuId
)
{
this
.
productSpuId
=
productSpuId
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
AdminsProductRecommendVO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
AdminsProductRecommendVO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
String
getMemo
()
{
return
memo
;
}
public
AdminsProductRecommendVO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
AdminsProductRecommendVO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-application/src/main/java/cn/iocoder/mall/promotion/application/vo/users/UsersBannerVO.java
0 → 100644
浏览文件 @
85a1be39
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
浏览文件 @
85a1be39
...
@@ -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-api/src/main/java/cn/iocoder/mall/promotion/api/ProductRecommendService.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendBO
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO
;
import
java.util.List
;
public
interface
ProductRecommendService
{
CommonResult
<
List
<
ProductRecommendBO
>>
getProductRecommendList
(
Integer
type
,
Integer
status
);
CommonResult
<
ProductRecommendPageBO
>
getProductRecommendPage
(
ProductRecommendPageDTO
productRecommendPageDTO
);
CommonResult
<
ProductRecommendBO
>
addProductRecommend
(
Integer
adminId
,
ProductRecommendAddDTO
productRecommendAddDTO
);
CommonResult
<
Boolean
>
updateProductRecommend
(
Integer
adminId
,
ProductRecommendUpdateDTO
productRecommendUpdateDTO
);
CommonResult
<
Boolean
>
updateProductRecommendStatus
(
Integer
adminId
,
Integer
productRecommendId
,
Integer
status
);
CommonResult
<
Boolean
>
deleteProductRecommend
(
Integer
adminId
,
Integer
productRecommendId
);
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/bo/ProductRecommendBO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
bo
;
import
java.util.Date
;
/**
* 商品推荐 BO
*/
public
class
ProductRecommendBO
{
/**
* 编号
*/
private
Integer
id
;
/**
* 类型
*
* {@link cn.iocoder.mall.promotion.api.constant.ProductRecommendType}
*/
private
Integer
type
;
/**
* 商品 Spu 编号
*/
private
Integer
productSpuId
;
/**
* 排序
*/
private
Integer
sort
;
/**
* 状态
*
* {@link cn.iocoder.common.framework.constant.CommonStatusEnum}
*/
private
Integer
status
;
/**
* 备注
*/
private
String
memo
;
/**
* 创建时间
*/
private
Date
createTime
;
public
Integer
getId
()
{
return
id
;
}
public
ProductRecommendBO
setId
(
Integer
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
ProductRecommendBO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getProductSpuId
()
{
return
productSpuId
;
}
public
ProductRecommendBO
setProductSpuId
(
Integer
productSpuId
)
{
this
.
productSpuId
=
productSpuId
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
ProductRecommendBO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
ProductRecommendBO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
String
getMemo
()
{
return
memo
;
}
public
ProductRecommendBO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
ProductRecommendBO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/bo/ProductRecommendPageBO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
bo
;
import
java.util.List
;
public
class
ProductRecommendPageBO
{
/**
* ProductRecommend 数组
*/
private
List
<
ProductRecommendBO
>
list
;
/**
* 总量
*/
private
Integer
total
;
public
List
<
ProductRecommendBO
>
getList
()
{
return
list
;
}
public
ProductRecommendPageBO
setList
(
List
<
ProductRecommendBO
>
list
)
{
this
.
list
=
list
;
return
this
;
}
public
Integer
getTotal
()
{
return
total
;
}
public
ProductRecommendPageBO
setTotal
(
Integer
total
)
{
this
.
total
=
total
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/ProductRecommendType.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
constant
;
/**
* 商品推荐类型
*/
public
enum
ProductRecommendType
{
HOT
(
1
,
"热卖推荐"
),
NEW
(
2
,
"新品推荐"
),
;
/**
* 状态值
*/
private
final
Integer
value
;
/**
* 状态名
*/
private
final
String
name
;
ProductRecommendType
(
Integer
value
,
String
name
)
{
this
.
value
=
value
;
this
.
name
=
name
;
}
public
Integer
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
public
static
boolean
isValid
(
Integer
status
)
{
if
(
status
==
null
)
{
return
false
;
}
return
HOT
.
value
.
equals
(
status
)
||
NEW
.
value
.
equals
(
status
);
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/constant/PromotionErrorCodeEnum.java
浏览文件 @
85a1be39
...
@@ -8,10 +8,16 @@ package cn.iocoder.mall.promotion.api.constant;
...
@@ -8,10 +8,16 @@ package cn.iocoder.mall.promotion.api.constant;
public
enum
PromotionErrorCodeEnum
{
public
enum
PromotionErrorCodeEnum
{
// ========== Banner 模块 ==========
// ========== Banner 模块 ==========
BANNER_NOT_EXISTS
(
1002002000
,
"账号不存在"
),
BANNER_NOT_EXISTS
(
1006000000
,
"账号不存在"
),
// ========== PRODUCT RECOMMEND 模块 ==========
PRODUCT_RECOMMEND_NOT_EXISTS
(
1006001000
,
"商品推荐不存在"
),
PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS
(
1006001001
,
"商品不存在"
),
PRODUCT_RECOMMEND_EXISTS
(
1006001002
,
"该商品推荐已经存在"
),
;
;
private
final
int
code
;
private
final
int
code
;
private
final
String
message
;
private
final
String
message
;
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/BannerAddDTO.java
浏览文件 @
85a1be39
...
@@ -12,13 +12,15 @@ import javax.validation.constraints.NotNull;
...
@@ -12,13 +12,15 @@ import javax.validation.constraints.NotNull;
public
class
BannerAddDTO
{
public
class
BannerAddDTO
{
@NotEmpty
(
message
=
"标题不能为空"
)
@NotEmpty
(
message
=
"标题不能为空"
)
@Length
(
min
=
6
,
max
=
32
,
message
=
"标题长度为 6
-32 位"
)
@Length
(
min
=
2
,
max
=
32
,
message
=
"标题长度为 2
-32 位"
)
private
String
title
;
private
String
title
;
@NotEmpty
(
message
=
"跳转链接不能为空"
)
@NotEmpty
(
message
=
"跳转链接不能为空"
)
@URL
(
message
=
"跳转链接格式不正确"
)
@URL
(
message
=
"跳转链接格式不正确"
)
@Length
(
max
=
255
,
message
=
"跳转链接最大长度为 255 位"
)
private
String
url
;
private
String
url
;
@NotEmpty
(
message
=
"图片链接不能为空"
)
@NotEmpty
(
message
=
"图片链接不能为空"
)
@URL
(
message
=
"图片链接格式不正确"
)
@URL
(
message
=
"图片链接格式不正确"
)
@Length
(
max
=
255
,
message
=
"图片链接最大长度为 255 位"
)
private
String
picUrl
;
private
String
picUrl
;
@NotNull
(
message
=
"排序不能为空"
)
@NotNull
(
message
=
"排序不能为空"
)
private
Integer
sort
;
private
Integer
sort
;
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/BannerUpdateDTO.java
浏览文件 @
85a1be39
...
@@ -14,12 +14,15 @@ public class BannerUpdateDTO {
...
@@ -14,12 +14,15 @@ public class BannerUpdateDTO {
@NotNull
(
message
=
"编号不能为空"
)
@NotNull
(
message
=
"编号不能为空"
)
private
Integer
id
;
private
Integer
id
;
@NotEmpty
(
message
=
"标题不能为空"
)
@NotEmpty
(
message
=
"标题不能为空"
)
@Length
(
min
=
6
,
max
=
32
,
message
=
"标题长度为 6
-32 位"
)
@Length
(
min
=
2
,
max
=
32
,
message
=
"标题长度为 2
-32 位"
)
private
String
title
;
private
String
title
;
@NotEmpty
(
message
=
"跳转链接不能为空"
)
@NotEmpty
(
message
=
"跳转链接不能为空"
)
@URL
(
message
=
"跳转链接格式不正确"
)
@URL
(
message
=
"跳转链接格式不正确"
)
@Length
(
max
=
255
,
message
=
"跳转链接最大长度为 255 位"
)
private
String
url
;
private
String
url
;
@NotEmpty
(
message
=
"图片链接不能为空"
)
@URL
(
message
=
"图片链接格式不正确"
)
@URL
(
message
=
"图片链接格式不正确"
)
@Length
(
max
=
255
,
message
=
"图片链接最大长度为 255 位"
)
private
String
picUrl
;
private
String
picUrl
;
@NotNull
(
message
=
"排序不能为空"
)
@NotNull
(
message
=
"排序不能为空"
)
private
Integer
sort
;
private
Integer
sort
;
...
...
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/ProductRecommendAddDTO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
dto
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotNull
;
/**
* 商品推荐添加 DTO
*/
public
class
ProductRecommendAddDTO
{
@NotNull
(
message
=
"推荐类型不能为空"
)
private
Integer
type
;
@NotNull
(
message
=
"商品编号不能为空"
)
private
Integer
productSpuId
;
@NotNull
(
message
=
"排序不能为空"
)
private
Integer
sort
;
@Length
(
max
=
255
,
message
=
"备注最大长度为 255 位"
)
private
String
memo
;
public
Integer
getType
()
{
return
type
;
}
public
ProductRecommendAddDTO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getProductSpuId
()
{
return
productSpuId
;
}
public
ProductRecommendAddDTO
setProductSpuId
(
Integer
productSpuId
)
{
this
.
productSpuId
=
productSpuId
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
ProductRecommendAddDTO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
String
getMemo
()
{
return
memo
;
}
public
ProductRecommendAddDTO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/ProductRecommendPageDTO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
dto
;
import
javax.validation.constraints.NotNull
;
public
class
ProductRecommendPageDTO
{
/**
* 推荐类型
*/
private
Integer
type
;
@NotNull
(
message
=
"页码不能为空"
)
private
Integer
pageNo
;
@NotNull
(
message
=
"每页条数不能为空"
)
private
Integer
pageSize
;
public
Integer
getPageNo
()
{
return
pageNo
;
}
public
ProductRecommendPageDTO
setPageNo
(
Integer
pageNo
)
{
this
.
pageNo
=
pageNo
;
return
this
;
}
public
Integer
getPageSize
()
{
return
pageSize
;
}
public
ProductRecommendPageDTO
setPageSize
(
Integer
pageSize
)
{
this
.
pageSize
=
pageSize
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
ProductRecommendPageDTO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-api/src/main/java/cn/iocoder/mall/promotion/api/dto/ProductRecommendUpdateDTO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
api
.
dto
;
import
org.hibernate.validator.constraints.Length
;
import
javax.validation.constraints.NotNull
;
/**
* 商品推荐更新 DTO
*/
public
class
ProductRecommendUpdateDTO
{
@NotNull
(
message
=
"编号不能为空"
)
private
Integer
id
;
@NotNull
(
message
=
"类型不能为空"
)
private
Integer
type
;
@NotNull
(
message
=
"商品编号不能为空"
)
private
Integer
productSpuId
;
@NotNull
(
message
=
"排序不能为空"
)
private
Integer
sort
;
@Length
(
max
=
255
,
message
=
"备注最大长度为 255 位"
)
private
String
memo
;
public
Integer
getId
()
{
return
id
;
}
public
ProductRecommendUpdateDTO
setId
(
Integer
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
ProductRecommendUpdateDTO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getProductSpuId
()
{
return
productSpuId
;
}
public
ProductRecommendUpdateDTO
setProductSpuId
(
Integer
productSpuId
)
{
this
.
productSpuId
=
productSpuId
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
ProductRecommendUpdateDTO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
String
getMemo
()
{
return
memo
;
}
public
ProductRecommendUpdateDTO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/convert/ProductRecommendConvert.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
convert
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendBO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO
;
import
cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
import
java.util.List
;
@Mapper
public
interface
ProductRecommendConvert
{
ProductRecommendConvert
INSTANCE
=
Mappers
.
getMapper
(
ProductRecommendConvert
.
class
);
@Mappings
({})
ProductRecommendBO
convertToBO
(
ProductRecommendDO
banner
);
@Mappings
({})
List
<
ProductRecommendBO
>
convertToBO
(
List
<
ProductRecommendDO
>
bannerList
);
@Mappings
({})
ProductRecommendDO
convert
(
ProductRecommendAddDTO
bannerAddDTO
);
@Mappings
({})
ProductRecommendDO
convert
(
ProductRecommendUpdateDTO
bannerUpdateDTO
);
}
\ No newline at end of file
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/dao/BannerMapper.java
浏览文件 @
85a1be39
...
@@ -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/dao/ProductRecommendMapper.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
dao
;
import
cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
interface
ProductRecommendMapper
{
ProductRecommendDO
selectById
(
@Param
(
"id"
)
Integer
id
);
ProductRecommendDO
selectByProductSpuIdAndType
(
@Param
(
"productSpuId"
)
Integer
productSpuId
,
@Param
(
"type"
)
Integer
type
);
List
<
ProductRecommendDO
>
selectListByTypeAndStatus
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"status"
)
Integer
status
);
List
<
ProductRecommendDO
>
selectPageByType
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"limit"
)
Integer
limit
);
Integer
selectCountByType
(
@Param
(
"type"
)
Integer
type
);
void
insert
(
ProductRecommendDO
bannerDO
);
int
update
(
ProductRecommendDO
bannerDO
);
}
\ No newline at end of file
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/dataobject/ProductRecommendDO.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
dataobject
;
import
cn.iocoder.common.framework.dataobject.DeletableDO
;
/**
* 商品推荐 DO
*/
public
class
ProductRecommendDO
extends
DeletableDO
{
/**
* 编号
*/
private
Integer
id
;
/**
* 类型
*
* {@link cn.iocoder.mall.promotion.api.constant.ProductRecommendType}
*/
private
Integer
type
;
/**
* 商品 Spu 编号
*/
private
Integer
productSpuId
;
// TODO 芋艿,商品 spu 名
/**
* 排序
*/
private
Integer
sort
;
/**
* 状态
*
* {@link cn.iocoder.common.framework.constant.CommonStatusEnum}
*/
private
Integer
status
;
/**
* 备注
*/
private
String
memo
;
public
Integer
getId
()
{
return
id
;
}
public
ProductRecommendDO
setId
(
Integer
id
)
{
this
.
id
=
id
;
return
this
;
}
public
Integer
getType
()
{
return
type
;
}
public
ProductRecommendDO
setType
(
Integer
type
)
{
this
.
type
=
type
;
return
this
;
}
public
Integer
getProductSpuId
()
{
return
productSpuId
;
}
public
ProductRecommendDO
setProductSpuId
(
Integer
productSpuId
)
{
this
.
productSpuId
=
productSpuId
;
return
this
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
ProductRecommendDO
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
return
this
;
}
public
Integer
getStatus
()
{
return
status
;
}
public
ProductRecommendDO
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
return
this
;
}
public
String
getMemo
()
{
return
memo
;
}
public
ProductRecommendDO
setMemo
(
String
memo
)
{
this
.
memo
=
memo
;
return
this
;
}
}
\ No newline at end of file
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/BannerServiceImpl.java
浏览文件 @
85a1be39
...
@@ -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
();
...
@@ -42,7 +49,7 @@ public class BannerServiceImpl implements BannerService {
...
@@ -42,7 +49,7 @@ public class BannerServiceImpl implements BannerService {
@Override
@Override
public
CommonResult
<
BannerBO
>
addBanner
(
Integer
adminId
,
BannerAddDTO
bannerAddDTO
)
{
public
CommonResult
<
BannerBO
>
addBanner
(
Integer
adminId
,
BannerAddDTO
bannerAddDTO
)
{
// 保存到数据库
// 保存到数据库
BannerDO
banner
=
BannerConvert
.
INSTANCE
.
convert
(
bannerAddDTO
);
BannerDO
banner
=
BannerConvert
.
INSTANCE
.
convert
(
bannerAddDTO
)
.
setStatus
(
CommonStatusEnum
.
ENABLE
.
getValue
())
;
banner
.
setDeleted
(
DeletedStatusEnum
.
DELETED_NO
.
getValue
()).
setCreateTime
(
new
Date
());
banner
.
setDeleted
(
DeletedStatusEnum
.
DELETED_NO
.
getValue
()).
setCreateTime
(
new
Date
());
bannerMapper
.
insert
(
banner
);
bannerMapper
.
insert
(
banner
);
// 返回成功
// 返回成功
...
@@ -68,6 +75,10 @@ public class BannerServiceImpl implements BannerService {
...
@@ -68,6 +75,10 @@ public class BannerServiceImpl implements BannerService {
if
(!
CommonStatusEnum
.
isValid
(
status
))
{
if
(!
CommonStatusEnum
.
isValid
(
status
))
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"变更状态必须是开启(1)或关闭(2)"
);
// TODO 有点搓
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"变更状态必须是开启(1)或关闭(2)"
);
// TODO 有点搓
}
}
// 校验 Banner 存在
if
(
bannerMapper
.
selectById
(
bannerId
)
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
BANNER_NOT_EXISTS
.
getCode
());
}
// 更新到数据库
// 更新到数据库
BannerDO
updateBanner
=
new
BannerDO
().
setId
(
bannerId
).
setStatus
(
status
);
BannerDO
updateBanner
=
new
BannerDO
().
setId
(
bannerId
).
setStatus
(
status
);
bannerMapper
.
update
(
updateBanner
);
bannerMapper
.
update
(
updateBanner
);
...
...
promotion/promotion-service-impl/src/main/java/cn/iocoder/mall/promotion/biz/service/ProductRecommendServiceImpl.java
0 → 100644
浏览文件 @
85a1be39
package
cn
.
iocoder
.
mall
.
promotion
.
biz
.
service
;
import
cn.iocoder.common.framework.constant.CommonStatusEnum
;
import
cn.iocoder.common.framework.constant.DeletedStatusEnum
;
import
cn.iocoder.common.framework.constant.SysErrorCodeEnum
;
import
cn.iocoder.common.framework.util.ServiceExceptionUtil
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.product.api.ProductSpuService
;
import
cn.iocoder.mall.promotion.api.ProductRecommendService
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendBO
;
import
cn.iocoder.mall.promotion.api.bo.ProductRecommendPageBO
;
import
cn.iocoder.mall.promotion.api.constant.PromotionErrorCodeEnum
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendAddDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendPageDTO
;
import
cn.iocoder.mall.promotion.api.dto.ProductRecommendUpdateDTO
;
import
cn.iocoder.mall.promotion.biz.convert.ProductRecommendConvert
;
import
cn.iocoder.mall.promotion.biz.dao.ProductRecommendMapper
;
import
cn.iocoder.mall.promotion.biz.dataobject.ProductRecommendDO
;
import
com.alibaba.dubbo.config.annotation.Reference
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Service
// 实际上不用添加。添加的原因是,必须 Spring 报错提示
@com
.
alibaba
.
dubbo
.
config
.
annotation
.
Service
(
validation
=
"true"
)
public
class
ProductRecommendServiceImpl
implements
ProductRecommendService
{
@Reference
(
validation
=
"true"
)
private
ProductSpuService
productSpuService
;
@Autowired
private
ProductRecommendMapper
productRecommendMapper
;
@Override
public
CommonResult
<
List
<
ProductRecommendBO
>>
getProductRecommendList
(
Integer
type
,
Integer
status
)
{
List
<
ProductRecommendDO
>
productRecommends
=
productRecommendMapper
.
selectListByTypeAndStatus
(
type
,
status
);
return
CommonResult
.
success
(
ProductRecommendConvert
.
INSTANCE
.
convertToBO
(
productRecommends
));
}
@Override
public
CommonResult
<
ProductRecommendPageBO
>
getProductRecommendPage
(
ProductRecommendPageDTO
productRecommendPageDTO
)
{
ProductRecommendPageBO
productRecommendPageBO
=
new
ProductRecommendPageBO
();
// 查询分页数据
int
offset
=
(
productRecommendPageDTO
.
getPageNo
()
-
1
)
*
productRecommendPageDTO
.
getPageSize
();
productRecommendPageBO
.
setList
(
ProductRecommendConvert
.
INSTANCE
.
convertToBO
(
productRecommendMapper
.
selectPageByType
(
productRecommendPageDTO
.
getType
(),
offset
,
productRecommendPageDTO
.
getPageSize
())));
// 查询分页总数
productRecommendPageBO
.
setTotal
(
productRecommendMapper
.
selectCountByType
(
productRecommendPageDTO
.
getType
()));
return
CommonResult
.
success
(
productRecommendPageBO
);
}
@Override
public
CommonResult
<
ProductRecommendBO
>
addProductRecommend
(
Integer
adminId
,
ProductRecommendAddDTO
productRecommendAddDTO
)
{
// 校验参数
if
(!
CommonStatusEnum
.
isValid
(
productRecommendAddDTO
.
getType
()))
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"推荐类型必须是新品(1)或热卖(2)"
);
// TODO 有点搓
}
// 校验商品不存在
if
(
productSpuService
.
getProductSpu
(
productRecommendAddDTO
.
getProductSpuId
())
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS
.
getCode
());
}
// 校验商品是否已经推荐
if
(
productRecommendMapper
.
selectByProductSpuIdAndType
(
productRecommendAddDTO
.
getProductSpuId
(),
productRecommendAddDTO
.
getType
())
!=
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_EXISTS
.
getCode
());
}
// 保存到数据库
ProductRecommendDO
productRecommend
=
ProductRecommendConvert
.
INSTANCE
.
convert
(
productRecommendAddDTO
).
setStatus
(
CommonStatusEnum
.
ENABLE
.
getValue
());
productRecommend
.
setDeleted
(
DeletedStatusEnum
.
DELETED_NO
.
getValue
()).
setCreateTime
(
new
Date
());
productRecommendMapper
.
insert
(
productRecommend
);
// 返回成功
return
CommonResult
.
success
(
ProductRecommendConvert
.
INSTANCE
.
convertToBO
(
productRecommend
));
}
@Override
public
CommonResult
<
Boolean
>
updateProductRecommend
(
Integer
adminId
,
ProductRecommendUpdateDTO
productRecommendUpdateDTO
)
{
// 校验参数
if
(!
CommonStatusEnum
.
isValid
(
productRecommendUpdateDTO
.
getType
()))
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"推荐类型必须是新品(1)或热卖(2)"
);
// TODO 有点搓
}
// 校验更新的商品推荐存在
if
(
productRecommendMapper
.
selectById
(
productRecommendUpdateDTO
.
getId
())
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_NOT_EXISTS
.
getCode
());
}
// 校验商品不存在
if
(
productSpuService
.
getProductSpu
(
productRecommendUpdateDTO
.
getProductSpuId
())
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_PRODUCT_NOT_EXISTS
.
getCode
());
}
// 校验商品是否已经推荐
ProductRecommendDO
existProductRecommend
=
productRecommendMapper
.
selectByProductSpuIdAndType
(
productRecommendUpdateDTO
.
getProductSpuId
(),
productRecommendUpdateDTO
.
getType
());
if
(
existProductRecommend
!=
null
&&
!
existProductRecommend
.
getId
().
equals
(
productRecommendUpdateDTO
.
getId
()))
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_EXISTS
.
getCode
());
}
// 更新到数据库
ProductRecommendDO
updateProductRecommend
=
ProductRecommendConvert
.
INSTANCE
.
convert
(
productRecommendUpdateDTO
);
productRecommendMapper
.
update
(
updateProductRecommend
);
// 返回成功
return
CommonResult
.
success
(
true
);
}
@Override
public
CommonResult
<
Boolean
>
updateProductRecommendStatus
(
Integer
adminId
,
Integer
productRecommendId
,
Integer
status
)
{
// 校验参数
if
(!
CommonStatusEnum
.
isValid
(
status
))
{
return
CommonResult
.
error
(
SysErrorCodeEnum
.
VALIDATION_REQUEST_PARAM_ERROR
.
getCode
(),
"变更状态必须是开启(1)或关闭(2)"
);
// TODO 有点搓
}
// 校验更新的商品推荐存在
if
(
productRecommendMapper
.
selectById
(
productRecommendId
)
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_NOT_EXISTS
.
getCode
());
}
// 更新到数据库
ProductRecommendDO
updateProductRecommend
=
new
ProductRecommendDO
().
setId
(
productRecommendId
).
setStatus
(
status
);
productRecommendMapper
.
update
(
updateProductRecommend
);
// 返回成功
return
CommonResult
.
success
(
true
);
}
@Override
public
CommonResult
<
Boolean
>
deleteProductRecommend
(
Integer
adminId
,
Integer
productRecommendId
)
{
// 校验更新的商品推荐存在
if
(
productRecommendMapper
.
selectById
(
productRecommendId
)
==
null
)
{
return
ServiceExceptionUtil
.
error
(
PromotionErrorCodeEnum
.
PRODUCT_RECOMMEND_NOT_EXISTS
.
getCode
());
}
// 更新到数据库
ProductRecommendDO
updateProductRecommend
=
new
ProductRecommendDO
().
setId
(
productRecommendId
);
updateProductRecommend
.
setDeleted
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
());
productRecommendMapper
.
update
(
updateProductRecommend
);
// 返回成功
return
CommonResult
.
success
(
true
);
}
}
\ No newline at end of file
promotion/promotion-service-impl/src/main/resources/mapper/BannerMapper.xml
浏览文件 @
85a1be39
...
@@ -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"
/>
...
@@ -76,7 +88,7 @@
...
@@ -76,7 +88,7 @@
<if
test=
"url != null"
>
<if
test=
"url != null"
>
url = #{url},
url = #{url},
</if>
</if>
<if
test=
"pic
_u
rl != null"
>
<if
test=
"pic
U
rl != null"
>
pic_url = #{picUrl} ,
pic_url = #{picUrl} ,
</if>
</if>
<if
test=
"sort != null"
>
<if
test=
"sort != null"
>
...
@@ -85,8 +97,8 @@
...
@@ -85,8 +97,8 @@
<if
test=
"status != null"
>
<if
test=
"status != null"
>
status = #{status},
status = #{status},
</if>
</if>
<if
test=
"
VALUES
!= null"
>
<if
test=
"
memo
!= null"
>
VALUES = #{VALUES
},
memo = #{memo
},
</if>
</if>
<if
test=
"deleted != null"
>
<if
test=
"deleted != null"
>
deleted = #{deleted}
deleted = #{deleted}
...
...
promotion/promotion-service-impl/src/main/resources/mapper/ProductRecommendMapper.xml
0 → 100644
浏览文件 @
85a1be39
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"cn.iocoder.mall.promotion.biz.dao.ProductRecommendMapper"
>
<sql
id=
"FIELDS"
>
id, type, product_spu_id, sort,
status, memo, create_time
</sql>
<!-- <select id="selectListByPidAndStatusOrderBySort" resultType="BannerDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM product_recommend-->
<!-- WHERE pid = #{pid}-->
<!-- AND status = #{status}-->
<!-- AND deleted = 0-->
<!-- ORDER BY sort ASC-->
<!-- </select>-->
<!-- <select id="selectList" resultType="BannerDO">-->
<!-- SELECT-->
<!-- <include refid="FIELDS" />-->
<!-- FROM product_recommend-->
<!-- WHERE deleted = 0-->
<!-- </select>-->
<select
id=
"selectById"
parameterType=
"Integer"
resultType=
"BannerDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM product_recommend
WHERE id = #{id}
AND deleted = 0
</select>
<select
id=
"selectByProductSpuIdAndType"
resultType=
"BannerDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM product_recommend
<where>
<if
test=
"productSpuId != null"
>
product_spu_id = #{productSpuId}
</if>
<if
test=
"type != null"
>
type = #{type}
</if>
AND deleted = 0
</where>
</select>
<select
id=
"selectListByTypeAndStatus"
parameterType=
"Integer"
resultType=
"BannerDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM product_recommend
<where>
<if
test=
"type != null"
>
type = #{type}
</if>
<if
test=
"status != null"
>
status = #{status}
</if>
AND deleted = 0
</where>
</select>
<select
id=
"selectPageByType"
resultType=
"BannerDO"
>
SELECT
<include
refid=
"FIELDS"
/>
FROM product_recommend
<where>
<if
test=
"type != null"
>
type = #{type}
</if>
AND deleted = 0
</where>
LIMIT #{offset}, #{limit}
</select>
<select
id=
"selectCountByType"
resultType=
"Integer"
>
SELECT
COUNT(1)
FROM product_recommend
<where>
<if
test=
"type != null"
>
type = #{type}
</if>
AND deleted = 0
</where>
</select>
<insert
id=
"insert"
parameterType=
"BannerDO"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
>
INSERT INTO product_recommend (
type, product_spu_id, sort, status, memo,
create_time, deleted
) VALUES (
#{type}, #{productSpuId}, #{sort}, #{status}, #{memo},
#{createTime}, #{deleted}
)
</insert>
<update
id=
"update"
parameterType=
"BannerDO"
>
UPDATE product_recommend
<set>
<if
test=
"type != null"
>
type = #{type},
</if>
<if
test=
"productSpuId != null"
>
product_spu_id = #{productSpuId},
</if>
<if
test=
"sort != null"
>
sort = #{sort},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"memo != null"
>
memo = #{memo},
</if>
<if
test=
"deleted != null"
>
deleted = #{deleted}
</if>
</set>
WHERE id = #{id}
</update>
</mapper>
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论