Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
431caeb5
Commit
431caeb5
authored
Nov 07, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改取消收藏
parent
4c733932
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
AppUserCollectBiz.java
.../github/wxiaoqi/security/admin/biz/AppUserCollectBiz.java
+16
-3
AppUserCollectController.java
...wxiaoqi/security/admin/rest/AppUserCollectController.java
+2
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserCollectBiz.java
View file @
431caeb5
...
...
@@ -97,11 +97,16 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
if
(
collectDTO
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
AppUserCollect
collect
=
new
AppUserCollect
();
BeanUtils
.
copyProperties
(
collectDTO
,
collect
);
updateSelectiveById
(
collect
);
List
<
AppUserCollect
>
list
=
getList
(
collectDTO
);
if
(
list
.
size
()
>
0
){
for
(
AppUserCollect
appUserCollect:
list
){
appUserCollect
.
setStatus
(
1
);
updateSelectiveById
(
appUserCollect
);
}
}
return
ObjectRestResponse
.
succ
();
}
//查看是否收藏
public
ObjectRestResponse
checkUserCollect
(
String
id
,
Integer
userId
,
Integer
type
){
Example
example
=
new
Example
(
AppUserCollect
.
class
);
...
...
@@ -120,6 +125,14 @@ public class AppUserCollectBiz extends BaseBiz<AppUserCollectMapper, AppUserColl
obj
.
put
(
"id"
,
collect_id
);
return
ObjectRestResponse
.
succ
(
obj
);
}
public
List
<
AppUserCollect
>
getList
(
AppUserCollectDTO
collectDTO
){
Example
example
=
new
Example
(
AppUserCollect
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
collectDTO
.
getUserId
()).
andEqualTo
(
"typeId"
,
collectDTO
.
getTypeId
()).
andEqualTo
(
"type"
,
collectDTO
.
getType
()).
andEqualTo
(
"isDel"
,
0
).
andEqualTo
(
"status"
,
0
);
return
selectByExample
(
example
);
}
//我的收藏
public
ObjectRestResponse
getCollectList
(
Integer
userId
,
int
page
,
int
limit
){
Example
example
=
new
Example
(
AppUserCollect
.
class
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserCollectController.java
View file @
431caeb5
...
...
@@ -94,8 +94,9 @@ public class AppUserCollectController extends CommonBaseController {
@RequestMapping
(
value
=
"/collect/remove"
,
method
=
RequestMethod
.
POST
)
@ApiModelProperty
(
"取消收藏"
)
public
ObjectRestResponse
remove
(
@RequestBody
AppUserCollectDTO
collectDTO
)
throws
Exception
{
collectDTO
.
set
Status
(
1
);
collectDTO
.
set
UserId
(
getCurrentUserIdInt
()
);
return
collectBiz
.
upUserCollect
(
collectDTO
);
}
@GetMapping
(
"/collect/exist"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment