Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
da6f2ee0
提交
da6f2ee0
authored
9月 22, 2020
作者:
Whispa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
commit
上级
789f1e4a
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
47 行增加
和
42 行删除
+47
-42
CommentController.java
...om/example/afrishop_v3/controllers/CommentController.java
+1
-1
CommentLikeController.java
...xample/afrishop_v3/controllers/CommentLikeController.java
+1
-1
LikeController.java
...a/com/example/afrishop_v3/controllers/LikeController.java
+1
-1
PostController.java
...a/com/example/afrishop_v3/controllers/PostController.java
+4
-4
ReplyController.java
.../com/example/afrishop_v3/controllers/ReplyController.java
+1
-1
CommentLike.java
...main/java/com/example/afrishop_v3/models/CommentLike.java
+1
-1
Model.java
src/main/java/com/example/afrishop_v3/models/Model.java
+7
-2
PostLike.java
src/main/java/com/example/afrishop_v3/models/PostLike.java
+1
-1
BonusRepository.java
...a/com/example/afrishop_v3/repository/BonusRepository.java
+2
-2
CommentLikeRepository.java
...example/afrishop_v3/repository/CommentLikeRepository.java
+3
-3
CommentRepository.java
...com/example/afrishop_v3/repository/CommentRepository.java
+3
-3
ComplainRepository.java
...om/example/afrishop_v3/repository/ComplainRepository.java
+1
-1
ContentRepository.java
...com/example/afrishop_v3/repository/ContentRepository.java
+2
-2
FollowRepository.java
.../com/example/afrishop_v3/repository/FollowRepository.java
+1
-1
HashtagRepository.java
...com/example/afrishop_v3/repository/HashtagRepository.java
+1
-1
InvitationRequestRepository.java
...e/afrishop_v3/repository/InvitationRequestRepository.java
+1
-1
ItemRepository.java
...va/com/example/afrishop_v3/repository/ItemRepository.java
+1
-1
LikeRepository.java
...va/com/example/afrishop_v3/repository/LikeRepository.java
+5
-5
NetworkRepository.java
...com/example/afrishop_v3/repository/NetworkRepository.java
+1
-1
PostHashtagRepository.java
...example/afrishop_v3/repository/PostHashtagRepository.java
+2
-2
PostRepository.java
...va/com/example/afrishop_v3/repository/PostRepository.java
+1
-1
PostTagRepository.java
...com/example/afrishop_v3/repository/PostTagRepository.java
+2
-2
ReplyRepository.java
...a/com/example/afrishop_v3/repository/ReplyRepository.java
+1
-1
TagRepository.java
...ava/com/example/afrishop_v3/repository/TagRepository.java
+1
-1
VisitRepository.java
...a/com/example/afrishop_v3/repository/VisitRepository.java
+2
-2
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/CommentController.java
浏览文件 @
da6f2ee0
...
...
@@ -21,7 +21,7 @@ public class CommentController {
@GetMapping
(
value
=
"/commentsByPostId/{postId}"
)
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public
List
<
Comment
>
getList
(
@PathVariable
(
value
=
"postId"
)
lo
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
public
List
<
Comment
>
getList
(
@PathVariable
(
value
=
"postId"
)
Stri
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
return
repository
.
findAllByPostId
(
id
,
PageRequest
.
of
(
pageNo
,
pageSize
)).
toList
();
}
...
...
src/main/java/com/example/afrishop_v3/controllers/CommentLikeController.java
浏览文件 @
da6f2ee0
...
...
@@ -31,7 +31,7 @@ public class CommentLikeController {
@GetMapping
(
value
=
"/CommentsLikesByCommentId/{commentId}"
)
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public
List
<
CommentLike
>
getList
(
@PathVariable
(
value
=
"commentId"
)
lo
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
public
List
<
CommentLike
>
getList
(
@PathVariable
(
value
=
"commentId"
)
Stri
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
return
repository
.
findAllByCommentId
(
id
,
PageRequest
.
of
(
pageNo
,
pageSize
)).
toList
();
}
}
src/main/java/com/example/afrishop_v3/controllers/LikeController.java
浏览文件 @
da6f2ee0
...
...
@@ -20,7 +20,7 @@ public class LikeController {
@GetMapping
(
value
=
"/likesByPostId/{postId}"
)
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public
List
<
PostLike
>
getList
(
@PathVariable
(
value
=
"postId"
)
lo
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
public
List
<
PostLike
>
getList
(
@PathVariable
(
value
=
"postId"
)
Stri
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
return
repository
.
findAllByPostId
(
id
,
PageRequest
.
of
(
pageNo
,
pageSize
)).
toList
();
}
...
...
src/main/java/com/example/afrishop_v3/controllers/PostController.java
浏览文件 @
da6f2ee0
...
...
@@ -85,7 +85,7 @@ public class PostController {
@GetMapping
(
"/visit/{postId}"
)
public
Visit
visitPage
(
@PathVariable
(
value
=
"postId"
)
lo
ng
id
)
{
public
Visit
visitPage
(
@PathVariable
(
value
=
"postId"
)
Stri
ng
id
)
{
Optional
<
Post
>
byId
=
repository
.
findById
(
id
);
if
(
byId
.
isPresent
())
{
Post
post
=
byId
.
get
();
...
...
@@ -96,7 +96,7 @@ public class PostController {
@PostMapping
(
value
=
"/repost/{userId}/{postId}"
)
public
Optional
<
Post
>
saveRePost
(
@PathVariable
(
"userId"
)
String
id
,
@PathVariable
(
"postId"
)
lo
ng
postId
)
{
public
Optional
<
Post
>
saveRePost
(
@PathVariable
(
"userId"
)
String
id
,
@PathVariable
(
"postId"
)
Stri
ng
postId
)
{
Optional
<
TbCfUserInfo
>
byId
=
userRepository
.
findById
(
id
);
Optional
<
Post
>
optional
=
repository
.
findById
(
postId
);
if
(
byId
.
isPresent
()
&&
optional
.
isPresent
())
{
...
...
@@ -149,7 +149,7 @@ public class PostController {
}
@GetMapping
(
"/community/{postId}"
)
public
Optional
<
Post
>
findPost
(
@PathVariable
(
value
=
"postId"
)
lo
ng
id
)
{
public
Optional
<
Post
>
findPost
(
@PathVariable
(
value
=
"postId"
)
Stri
ng
id
)
{
Optional
<
Post
>
byId
=
repository
.
findById
(
id
);
if
(
byId
.
isPresent
())
{
Post
post
=
byId
.
get
();
...
...
@@ -179,7 +179,7 @@ public class PostController {
}
@GetMapping
(
"/delete/post/{postId}"
)
public
String
del
(
@PathVariable
(
"postId"
)
lo
ng
id
)
{
public
String
del
(
@PathVariable
(
"postId"
)
Stri
ng
id
)
{
try
{
likeRepository
.
removeByPost_Id
(
id
);
...
...
src/main/java/com/example/afrishop_v3/controllers/ReplyController.java
浏览文件 @
da6f2ee0
...
...
@@ -18,7 +18,7 @@ public class ReplyController {
@GetMapping
(
value
=
"/RepliesByCommentId/{commentId}"
)
//@PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
public
List
<
Reply
>
getList
(
@PathVariable
(
value
=
"commentId"
)
lo
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
public
List
<
Reply
>
getList
(
@PathVariable
(
value
=
"commentId"
)
Stri
ng
id
,
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
)
{
return
repository
.
findAllByCommentId
(
id
,
PageRequest
.
of
(
pageNo
,
pageSize
)).
toList
();
}
...
...
src/main/java/com/example/afrishop_v3/models/CommentLike.java
浏览文件 @
da6f2ee0
...
...
@@ -16,7 +16,7 @@ public class CommentLike extends Model {
@ManyToOne
private
TbCfUserInfo
userInfo
;
public
Lo
ng
commentId
(){
public
Stri
ng
commentId
(){
return
comment
!=
null
?
comment
.
id
:
null
;
}
}
src/main/java/com/example/afrishop_v3/models/Model.java
浏览文件 @
da6f2ee0
package
com
.
example
.
afrishop_v3
.
models
;
import
com.example.afrishop_v3.util.IdUtil
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
@@ -11,12 +12,16 @@ abstract class Model {
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@JsonProperty
protected
Lo
ng
id
;
protected
Stri
ng
id
;
@JsonIgnore
Date
createDate
=
new
Date
();
public
Long
getId
()
{
Model
(){
this
.
id
=
IdUtil
.
createIdbyUUID
();
}
public
String
getId
()
{
return
id
;
}
...
...
src/main/java/com/example/afrishop_v3/models/PostLike.java
浏览文件 @
da6f2ee0
...
...
@@ -20,7 +20,7 @@ public class PostLike extends Model {
private
TbCfUserInfo
userInfo
;
public
Lo
ng
getPostId
()
{
public
Stri
ng
getPostId
()
{
return
post
==
null
?
null
:
post
.
id
;
}
...
...
src/main/java/com/example/afrishop_v3/repository/BonusRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -10,7 +10,7 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
BonusRepository
extends
JpaRepository
<
Bonus
,
Lo
ng
>
{
public
interface
BonusRepository
extends
JpaRepository
<
Bonus
,
Stri
ng
>
{
Page
<
Bonus
>
findAllByUserInfo_UserIdOrderByIdDesc
(
String
id
,
Pageable
pageable
);
@Query
(
value
=
"select a from #{#entityName} a WHERE month(a.createDate) = :month and year(a.createDate) = :year and a.userInfo=:id order by a.id desc"
)
Page
<
Bonus
>
findAllByUser_IdAndCreateDateMonthAndCreateDateYear
(
TbCfUserInfo
id
,
int
month
,
int
year
,
Pageable
pageable
);
...
...
@@ -21,7 +21,7 @@ public interface BonusRepository extends JpaRepository<Bonus,Long> {
@Query
(
value
=
"delete from bonus WHERE post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
...
...
src/main/java/com/example/afrishop_v3/repository/CommentLikeRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -9,12 +9,12 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
CommentLikeRepository
extends
PagingAndSortingRepository
<
CommentLike
,
Lo
ng
>
{
Page
<
CommentLike
>
findAllByCommentId
(
long
id
,
Pageable
pageable
);
public
interface
CommentLikeRepository
extends
PagingAndSortingRepository
<
CommentLike
,
Stri
ng
>
{
Page
<
CommentLike
>
findAllByCommentId
(
String
comment_
id
,
Pageable
pageable
);
@Query
(
value
=
"delete from comment_like WHERE comment_id=:comment"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByComment_Id
(
@Param
(
"comment"
)
Lo
ng
comment_id
);
void
removeByComment_Id
(
@Param
(
"comment"
)
Stri
ng
comment_id
);
}
src/main/java/com/example/afrishop_v3/repository/CommentRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -9,11 +9,11 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
CommentRepository
extends
PagingAndSortingRepository
<
Comment
,
Lo
ng
>
{
Page
<
Comment
>
findAllByPostId
(
long
id
,
Pageable
pageable
);
public
interface
CommentRepository
extends
PagingAndSortingRepository
<
Comment
,
Stri
ng
>
{
Page
<
Comment
>
findAllByPostId
(
String
post_
id
,
Pageable
pageable
);
@Query
(
value
=
"delete from comment WHERE post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
}
src/main/java/com/example/afrishop_v3/repository/ComplainRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -3,5 +3,5 @@ package com.example.afrishop_v3.repository;
import
com.example.afrishop_v3.models.Complain
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
ComplainRepository
extends
PagingAndSortingRepository
<
Complain
,
Lo
ng
>
{
public
interface
ComplainRepository
extends
PagingAndSortingRepository
<
Complain
,
Stri
ng
>
{
}
src/main/java/com/example/afrishop_v3/repository/ContentRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -7,10 +7,10 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
ContentRepository
extends
PagingAndSortingRepository
<
Content
,
Lo
ng
>
{
public
interface
ContentRepository
extends
PagingAndSortingRepository
<
Content
,
Stri
ng
>
{
@Query
(
value
=
"delete from content WHERE post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
}
src/main/java/com/example/afrishop_v3/repository/FollowRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -9,7 +9,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.List
;
public
interface
FollowRepository
extends
CrudRepository
<
Following
,
Lo
ng
>
{
public
interface
FollowRepository
extends
CrudRepository
<
Following
,
Stri
ng
>
{
List
<
Following
>
findAllByFollowedInfoUserId
(
String
followedInfo_userId
);
List
<
Following
>
findAllByFollowerInfoUserId
(
String
followerInfo_userId
);
...
...
src/main/java/com/example/afrishop_v3/repository/HashtagRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -7,7 +7,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
java.util.Optional
;
public
interface
HashtagRepository
extends
PagingAndSortingRepository
<
Hashtag
,
Lo
ng
>
{
public
interface
HashtagRepository
extends
PagingAndSortingRepository
<
Hashtag
,
Stri
ng
>
{
boolean
existsByName
(
String
name
);
Optional
<
Hashtag
>
findByName
(
String
name
);
...
...
src/main/java/com/example/afrishop_v3/repository/InvitationRequestRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -3,7 +3,7 @@ package com.example.afrishop_v3.repository;
import
com.example.afrishop_v3.models.InvitationRequest
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
InvitationRequestRepository
extends
PagingAndSortingRepository
<
InvitationRequest
,
Lo
ng
>
{
public
interface
InvitationRequestRepository
extends
PagingAndSortingRepository
<
InvitationRequest
,
Stri
ng
>
{
boolean
existsByUserInfo_UserId
(
String
userInfo_userId
);
InvitationRequest
findByUserInfo_UserId
(
String
userInfo_userId
);
}
src/main/java/com/example/afrishop_v3/repository/ItemRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -3,7 +3,7 @@ package com.example.afrishop_v3.repository;
import
com.example.afrishop_v3.models.Item
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
ItemRepository
extends
PagingAndSortingRepository
<
Item
,
Lo
ng
>
{
public
interface
ItemRepository
extends
PagingAndSortingRepository
<
Item
,
Stri
ng
>
{
boolean
existsByItemId
(
String
itemId
);
boolean
existsByItemName
(
String
string
);
Item
findByItemId
(
String
itemId
);
...
...
src/main/java/com/example/afrishop_v3/repository/LikeRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -9,17 +9,17 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
LikeRepository
extends
PagingAndSortingRepository
<
PostLike
,
Lo
ng
>
{
Page
<
PostLike
>
findAllByPostId
(
long
i
d
,
Pageable
pageable
);
public
interface
LikeRepository
extends
PagingAndSortingRepository
<
PostLike
,
Stri
ng
>
{
Page
<
PostLike
>
findAllByPostId
(
String
postI
d
,
Pageable
pageable
);
@Query
(
value
=
"delete from post_like WHERE user_info_user_id=:userId and post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByUser_IdAndPost_Id
(
@Param
(
"userId"
)
String
user_id
,
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByUser_IdAndPost_Id
(
@Param
(
"userId"
)
String
user_id
,
@Param
(
"post"
)
Stri
ng
post_id
);
@Query
(
value
=
"delete from post_like WHERE post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
boolean
existsByUserInfo_UserIdAndPost_Id
(
String
user
_id
,
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
boolean
existsByUserInfo_UserIdAndPost_Id
(
String
user
Info_userId
,
Stri
ng
post_id
);
}
src/main/java/com/example/afrishop_v3/repository/NetworkRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -7,7 +7,7 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
java.util.Optional
;
public
interface
NetworkRepository
extends
PagingAndSortingRepository
<
Network
,
Lo
ng
>
{
public
interface
NetworkRepository
extends
PagingAndSortingRepository
<
Network
,
Stri
ng
>
{
boolean
existsByUserInfo_UserIdAndNetworkInfo_UserId
(
String
userInfo_userId
,
String
networkInfo_userId
);
boolean
existsByUserInfo_CodeAndNetworkInfo_UserId
(
String
userInfo_code
,
String
networkInfo_userId
);
Network
findByUserInfo_UserIdAndNetworkInfo_UserId
(
String
user
,
String
network
);
...
...
src/main/java/com/example/afrishop_v3/repository/PostHashtagRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -3,7 +3,7 @@ package com.example.afrishop_v3.repository;
import
com.example.afrishop_v3.models.PostHashtag
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
PostHashtagRepository
extends
PagingAndSortingRepository
<
PostHashtag
,
Lo
ng
>
{
public
interface
PostHashtagRepository
extends
PagingAndSortingRepository
<
PostHashtag
,
Stri
ng
>
{
boolean
existsByHashtagNameAndPostId
(
String
name
,
long
post
);
boolean
existsByHashtagNameAndPostId
(
String
hashtag_name
,
String
post_id
);
}
src/main/java/com/example/afrishop_v3/repository/PostRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -9,7 +9,7 @@ import org.springframework.data.jpa.repository.Query;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.data.repository.query.Param
;
public
interface
PostRepository
extends
PagingAndSortingRepository
<
Post
,
Lo
ng
>
{
public
interface
PostRepository
extends
PagingAndSortingRepository
<
Post
,
Stri
ng
>
{
Page
<
Post
>
findAllByUserInfoUserIdOrderByIdDesc
(
String
tUser_userId
,
Pageable
pageable
);
Page
<
Post
>
findAllByDescriptionContainingOrTitleContainingOrUserInfoNickContaining
(
String
query
,
String
query1
,
String
query2
,
Pageable
pageable
);
//@Query(value = "select a from #{#entityName} a WHERE EXISTS(SELECT f.follower FROM Following f WHERE f.follower=:me and f.followed=a.user)")
...
...
src/main/java/com/example/afrishop_v3/repository/PostTagRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -7,10 +7,10 @@ import org.springframework.data.repository.CrudRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
PostTagRepository
extends
CrudRepository
<
ContentTag
,
Lo
ng
>
{
public
interface
PostTagRepository
extends
CrudRepository
<
ContentTag
,
Stri
ng
>
{
@Query
(
value
=
"delete ct from content_tag ct INNER JOIN content c ON c.id = ct.content_id WHERE c.post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
}
src/main/java/com/example/afrishop_v3/repository/ReplyRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -6,5 +6,5 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
ReplyRepository
extends
PagingAndSortingRepository
<
Reply
,
Long
>
{
Page
<
Reply
>
findAllByCommentId
(
long
id
,
Pageable
pageable
);
Page
<
Reply
>
findAllByCommentId
(
String
comment_
id
,
Pageable
pageable
);
}
src/main/java/com/example/afrishop_v3/repository/TagRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -5,7 +5,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
public
interface
TagRepository
extends
PagingAndSortingRepository
<
Tag
,
Lo
ng
>
{
public
interface
TagRepository
extends
PagingAndSortingRepository
<
Tag
,
Stri
ng
>
{
boolean
existsByTagName
(
String
string
);
Tag
findByTagName
(
String
string
);
Page
<
Tag
>
findAllByTagNameContaining
(
String
string
,
Pageable
pageable
);
...
...
src/main/java/com/example/afrishop_v3/repository/VisitRepository.java
浏览文件 @
da6f2ee0
...
...
@@ -7,10 +7,10 @@ import org.springframework.data.repository.CrudRepository;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.transaction.annotation.Transactional
;
public
interface
VisitRepository
extends
CrudRepository
<
Visit
,
Lo
ng
>
{
public
interface
VisitRepository
extends
CrudRepository
<
Visit
,
Stri
ng
>
{
@Query
(
value
=
"delete from visit WHERE post_id=:post"
,
nativeQuery
=
true
)
@Modifying
@Transactional
void
removeByPost_Id
(
@Param
(
"post"
)
Lo
ng
post_id
);
void
removeByPost_Id
(
@Param
(
"post"
)
Stri
ng
post_id
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论