Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
ea401cd3
提交
ea401cd3
authored
9月 07, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit
上级
0eb3ac33
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
15 行增加
和
0 行删除
+15
-0
CartController.java
...a/com/example/afrishop_v3/controllers/CartController.java
+10
-0
TbCfCartRecordRRepository.java
...ple/afrishop_v3/repository/TbCfCartRecordRRepository.java
+5
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/CartController.java
浏览文件 @
ea401cd3
...
...
@@ -108,6 +108,16 @@ public class CartController extends Controller {
return
new
Result
<>(
repository
.
findAllByUserId
(
user
.
userId
()));
}
@DeleteMapping
(
"/delete"
)
public
Result
deleteItems
(
@RequestBody
String
[]
ids
)
{
if
(
ids
!=
null
)
{
repository
.
deleteAllByCartRecordIdIn
(
ids
);
return
new
Result
();
}
return
new
Result
(
ResultCodeEnum
.
SERVICE_ERROR
.
getCode
(),
ResultCodeEnum
.
SERVICE_ERROR
.
getDesc
());
}
private
void
insertRecord
(
TbCfItemDetail
itemDetail
,
String
userId
)
{
TbCfCartRecordR
tbCfCartRecordREntity
=
new
TbCfCartRecordR
();
...
...
src/main/java/com/example/afrishop_v3/repository/TbCfCartRecordRRepository.java
浏览文件 @
ea401cd3
...
...
@@ -2,6 +2,7 @@ package com.example.afrishop_v3.repository;
import
com.example.afrishop_v3.models.TbCfCartRecordR
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -12,4 +13,8 @@ public interface TbCfCartRecordRRepository extends PagingAndSortingRepository<Tb
Optional
<
TbCfCartRecordR
>
findFirstByUserIdAndItemDetailItemIdAndItemSku
(
String
userId
,
String
itemId
,
String
itemSku
);
List
<
TbCfCartRecordR
>
findAllByUserId
(
String
userId
);
@Transactional
void
deleteAllByCartRecordIdIn
(
String
[]
ids
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论