Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
cabdb8f4
Commit
cabdb8f4
authored
Aug 11, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 小程序藏品接口
parent
797b9deb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
10 deletions
+46
-10
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
...c/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
+0
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFavoritesController.java
...c/main/java/com/wwdz/ch/wx/web/WxFavoritesController.java
+0
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
...pi/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
+45
-4
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FavoritesServiceImpl.java
View file @
cabdb8f4
...
@@ -144,7 +144,6 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -144,7 +144,6 @@ public class FavoritesServiceImpl implements FavoritesService {
favorites
.
setUserId
(
dto
.
getUserId
());
favorites
.
setUserId
(
dto
.
getUserId
());
favorites
.
setTitle
(
dto
.
getTitle
());
favorites
.
setTitle
(
dto
.
getTitle
());
favorites
.
setDescription
(
dto
.
getDescription
());
favorites
.
setDescription
(
dto
.
getDescription
());
favorites
.
setImages
(
dto
.
getImages
());
Date
date
=
new
Date
();
Date
date
=
new
Date
();
favorites
.
setAddTime
(
date
);
favorites
.
setAddTime
(
date
);
favorites
.
setUpdateTime
(
date
);
favorites
.
setUpdateTime
(
date
);
...
@@ -175,7 +174,6 @@ public class FavoritesServiceImpl implements FavoritesService {
...
@@ -175,7 +174,6 @@ public class FavoritesServiceImpl implements FavoritesService {
favorites
.
setTitle
(
dto
.
getTitle
());
favorites
.
setTitle
(
dto
.
getTitle
());
favorites
.
setDescription
(
dto
.
getDescription
());
favorites
.
setDescription
(
dto
.
getDescription
());
favorites
.
setImages
(
dto
.
getImages
());
favorites
.
setUpdateTime
(
new
Date
());
favorites
.
setUpdateTime
(
new
Date
());
favoritesDao
.
update
(
favorites
);
favoritesDao
.
update
(
favorites
);
logger
.
info
(
"【请求结束】修改收藏册成功"
);
logger
.
info
(
"【请求结束】修改收藏册成功"
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
cabdb8f4
...
@@ -115,6 +115,7 @@ public class ItemServiceImpl implements ItemService {
...
@@ -115,6 +115,7 @@ public class ItemServiceImpl implements ItemService {
// 新增收藏册和藏品关联记录
// 新增收藏册和藏品关联记录
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
FavoritesItemsRelation
favoritesItemsRelation
=
new
FavoritesItemsRelation
();
favoritesItemsRelation
.
setUserId
(
dto
.
getUserId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setFavoritesId
(
dto
.
getFavoritesId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setItemId
(
item
.
getId
());
favoritesItemsRelation
.
setAddTime
(
now
);
favoritesItemsRelation
.
setAddTime
(
now
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxFavoritesController.java
View file @
cabdb8f4
...
@@ -76,7 +76,6 @@ public class WxFavoritesController {
...
@@ -76,7 +76,6 @@ public class WxFavoritesController {
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
title
=
JsonUtils
.
getValueByPath
(
json
,
"title"
);
String
title
=
JsonUtils
.
getValueByPath
(
json
,
"title"
);
String
description
=
JsonUtils
.
getValueByPath
(
json
,
"description"
);
String
description
=
JsonUtils
.
getValueByPath
(
json
,
"description"
);
String
images
=
JsonUtils
.
getValueByPath
(
json
,
"images"
);
if
(
StringUtils
.
isBlank
(
userId
))
{
if
(
StringUtils
.
isBlank
(
userId
))
{
return
Result
.
failed
(
"用户id不能为空"
);
return
Result
.
failed
(
"用户id不能为空"
);
...
@@ -95,7 +94,6 @@ public class WxFavoritesController {
...
@@ -95,7 +94,6 @@ public class WxFavoritesController {
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setTitle
(
title
);
dto
.
setTitle
(
title
);
dto
.
setDescription
(
description
);
dto
.
setDescription
(
description
);
dto
.
setImages
(
images
);
return
favoritesService
.
add
(
dto
);
return
favoritesService
.
add
(
dto
);
}
}
...
@@ -108,7 +106,6 @@ public class WxFavoritesController {
...
@@ -108,7 +106,6 @@ public class WxFavoritesController {
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
title
=
JsonUtils
.
getValueByPath
(
json
,
"title"
);
String
title
=
JsonUtils
.
getValueByPath
(
json
,
"title"
);
String
description
=
JsonUtils
.
getValueByPath
(
json
,
"description"
);
String
description
=
JsonUtils
.
getValueByPath
(
json
,
"description"
);
String
images
=
JsonUtils
.
getValueByPath
(
json
,
"images"
);
if
(
StringUtils
.
isBlank
(
id
))
{
if
(
StringUtils
.
isBlank
(
id
))
{
return
Result
.
failed
(
"id不能为空"
);
return
Result
.
failed
(
"id不能为空"
);
...
@@ -131,7 +128,6 @@ public class WxFavoritesController {
...
@@ -131,7 +128,6 @@ public class WxFavoritesController {
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setTitle
(
title
);
dto
.
setTitle
(
title
);
dto
.
setDescription
(
description
);
dto
.
setDescription
(
description
);
dto
.
setImages
(
images
);
return
favoritesService
.
update
(
dto
);
return
favoritesService
.
update
(
dto
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/WxItemController.java
View file @
cabdb8f4
...
@@ -98,7 +98,48 @@ public class WxItemController {
...
@@ -98,7 +98,48 @@ public class WxItemController {
@ApiOperation
(
value
=
"修改"
)
@ApiOperation
(
value
=
"修改"
)
@PostMapping
(
"/update"
)
@PostMapping
(
"/update"
)
public
Result
update
(
@RequestBody
ItemRequestDto
dto
)
{
public
Result
update
(
@RequestBody
KlDataRequestDto
klDataRequestDto
)
{
String
json
=
klDataRequestDto
.
getKl_data
();
logger
.
info
(
"【请求开始】藏品发布,请求参数,kl_data:{}"
,
json
);
String
id
=
JsonUtils
.
getValueByPath
(
json
,
"id"
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
cid
=
JsonUtils
.
getValueByPath
(
json
,
"cid"
);
String
name
=
JsonUtils
.
getValueByPath
(
json
,
"name"
);
String
detail
=
JsonUtils
.
getValueByPath
(
json
,
"detail"
);
String
images
=
JsonUtils
.
getValueByPath
(
json
,
"images"
);
String
favoritesId
=
JsonUtils
.
getValueByPath
(
json
,
"favoritesId"
);
String
price
=
JsonUtils
.
getValueByPath
(
json
,
"price"
);
if
(
StringUtils
.
isBlank
(
id
))
{
return
Result
.
failed
(
"id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
userId
))
{
return
Result
.
failed
(
"用户id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
cid
))
{
return
Result
.
failed
(
"分类id不能为空"
);
}
if
(
StringUtils
.
isBlank
(
name
))
{
return
Result
.
failed
(
"标题不能为空"
);
}
if
(
StringUtils
.
isBlank
(
price
))
{
return
Result
.
failed
(
"价格不能为空"
);
}
if
(
StringUtils
.
isBlank
(
images
))
{
return
Result
.
failed
(
"图片或视频不能为空"
);
}
if
(
StringUtils
.
isBlank
(
favoritesId
))
{
return
Result
.
failed
(
"收藏册id不能为空"
);
}
ItemRequestDto
dto
=
new
ItemRequestDto
();
dto
.
setId
(
Long
.
parseLong
(
id
));
dto
.
setUserId
(
Long
.
parseLong
(
userId
));
dto
.
setName
(
name
);
dto
.
setCid
(
Integer
.
parseInt
(
cid
));
dto
.
setDetail
(
detail
);
dto
.
setFavoritesId
(
Long
.
parseLong
(
favoritesId
));
dto
.
setImages
(
images
);
dto
.
setPrice
(
price
);
return
itemService
.
update
(
dto
);
return
itemService
.
update
(
dto
);
}
}
...
@@ -109,9 +150,9 @@ public class WxItemController {
...
@@ -109,9 +150,9 @@ public class WxItemController {
logger
.
info
(
"【请求开始】藏品详情查询,请求参数,kl_data:{}"
,
json
);
logger
.
info
(
"【请求开始】藏品详情查询,请求参数,kl_data:{}"
,
json
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
userId
=
JsonUtils
.
getValueByPath
(
json
,
"userId"
);
String
id
=
JsonUtils
.
getValueByPath
(
json
,
"id"
);
String
id
=
JsonUtils
.
getValueByPath
(
json
,
"id"
);
if
(
StringUtils
.
isBlank
(
userId
))
{
//
if (StringUtils.isBlank(userId)) {
return
Result
.
failed
(
"用户id不能为空"
);
//
return Result.failed("用户id不能为空");
}
//
}
if
(
StringUtils
.
isBlank
(
id
))
{
if
(
StringUtils
.
isBlank
(
id
))
{
return
Result
.
failed
(
"当前页不能为空"
);
return
Result
.
failed
(
"当前页不能为空"
);
}
}
...
...
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