Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
e50af33b
提交
e50af33b
authored
9月 29, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit
上级
0630f7f3
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
18 行增加
和
13 行删除
+18
-13
PostController.java
...a/com/example/afrishop_v3/controllers/PostController.java
+8
-7
Item.java
src/main/java/com/example/afrishop_v3/models/Item.java
+1
-0
Position.java
src/main/java/com/example/afrishop_v3/models/Position.java
+1
-1
Tag.java
src/main/java/com/example/afrishop_v3/models/Tag.java
+8
-5
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/PostController.java
浏览文件 @
e50af33b
...
...
@@ -36,13 +36,13 @@ public class PostController {
private
final
VisitRepository
visitRepository
;
private
final
BonusRepository
bonusRepository
;
private
final
HashtagRepository
hashtagRepository
;
private
final
ItemRepository
itemRepository
;
private
final
TbCfStation
ItemRepository
itemRepository
;
private
final
TagRepository
tagRepository
;
private
final
PostHashtagRepository
postHashtagRepository
;
private
final
AuthenticationUser
user
;
public
PostController
(
PostRepository
repository
,
LikeRepository
likeRepository
,
CommentRepository
commentRepository
,
PostTagRepository
postTagRepository
,
ContentRepository
contentRepository
,
UserRepository
userRepository
,
VisitRepository
visitRepository
,
BonusRepository
bonusRepository
,
HashtagRepository
hashtagRepository
,
ItemRepository
itemRepository
,
TagRepository
tagRepository
,
PostHashtagRepository
postHashtagRepository
,
AuthenticationUser
user
)
{
public
PostController
(
PostRepository
repository
,
LikeRepository
likeRepository
,
CommentRepository
commentRepository
,
PostTagRepository
postTagRepository
,
ContentRepository
contentRepository
,
UserRepository
userRepository
,
VisitRepository
visitRepository
,
BonusRepository
bonusRepository
,
HashtagRepository
hashtagRepository
,
TbCfStation
ItemRepository
itemRepository
,
TagRepository
tagRepository
,
PostHashtagRepository
postHashtagRepository
,
AuthenticationUser
user
)
{
this
.
repository
=
repository
;
this
.
likeRepository
=
likeRepository
;
this
.
commentRepository
=
commentRepository
;
...
...
@@ -291,15 +291,16 @@ public class PostController {
Tag
tag
=
position
.
getTag
();
Item
item
=
tag
.
get
Item
();
TbCfStationItem
item
=
tag
.
getStation
Item
();
boolean
b
=
itemRepository
.
existsByItemId
(
item
.
getItemId
());
if
(
b
)
{
item
=
itemRepository
.
findByItemId
(
item
.
getItemId
());
Optional
<
TbCfStationItem
>
itemOptional
=
itemRepository
.
findById
(
item
.
getItemId
());
if
(
itemOptional
.
isPresent
())
{
item
=
itemOptional
.
get
();
}
else
{
//item = itemRepository.save(item);
}
tag
.
setItem
(
item
);
tag
.
set
Station
Item
(
item
);
ContentTag
contentTag
=
new
ContentTag
();
...
...
src/main/java/com/example/afrishop_v3/models/Item.java
浏览文件 @
e50af33b
...
...
@@ -9,6 +9,7 @@ import javax.persistence.Entity;
@Entity
@Getter
@Setter
@Deprecated
public
class
Item
extends
Model
{
protected
String
itemName
;
@Column
(
unique
=
true
)
...
...
src/main/java/com/example/afrishop_v3/models/Position.java
浏览文件 @
e50af33b
...
...
@@ -16,7 +16,7 @@ public class Position extends Tag {
public
Tag
getTag
(){
Tag
tag
=
new
Tag
();
tag
.
tagName
=
tagName
;
tag
.
set
Item
(
i
tem
);
tag
.
set
StationItem
(
stationI
tem
);
return
tag
;
}
...
...
src/main/java/com/example/afrishop_v3/models/Tag.java
浏览文件 @
e50af33b
package
com
.
example
.
afrishop_v3
.
models
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.hibernate.annotations.Formula
;
...
...
@@ -13,7 +14,8 @@ import javax.persistence.ManyToOne;
@Setter
public
class
Tag
extends
Model
{
@ManyToOne
(
cascade
=
CascadeType
.
ALL
)
protected
Item
item
;
@JsonProperty
(
value
=
"item"
)
protected
TbCfStationItem
stationItem
;
protected
String
tagName
;
...
...
@@ -24,11 +26,12 @@ public class Tag extends Model {
return
tagName
;
}
public
Item
get
Item
()
{
return
i
tem
;
public
TbCfStationItem
getStation
Item
()
{
return
stationI
tem
;
}
public
void
set
Item
(
Item
i
tem
)
{
this
.
item
=
i
tem
;
public
void
set
StationItem
(
TbCfStationItem
stationI
tem
)
{
this
.
stationItem
=
stationI
tem
;
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论