Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
Details
Activity
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
徐少华
midjourney-proxy
Commits
3ce16fbb
Commit
3ce16fbb
authored
Apr 17, 2020
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002766 add cookie check
parent
0335d905
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
27 deletions
+36
-27
SearchFacade.java
...c/main/java/com/pcloud/book/book/facade/SearchFacade.java
+3
-0
SearchFacadeImpl.java
...va/com/pcloud/book/book/facade/impl/SearchFacadeImpl.java
+6
-1
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+2
-2
CultivateFacade.java
...ava/com/pcloud/book/cultivate/facade/CultivateFacade.java
+23
-21
RightsSettingBizImpl.java
...oud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
+1
-1
RightsSettingDAOImpl.java
...oud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
+1
-1
RightsSettingMapper.xml
...in/resources/mapper/rightssetting/RightsSettingMapper.xml
+0
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/SearchFacade.java
View file @
3ce16fbb
...
...
@@ -9,6 +9,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -58,6 +59,7 @@ public interface SearchFacade {
@ApiOperation
(
"创建搜索记录H5"
)
@PostMapping
(
"createSearchRecord4H5"
)
ResponseDto
<?>
createSearchRecord4H5
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
SearchRecord
searchRecord
)
throws
PermissionException
;
...
...
@@ -100,6 +102,7 @@ public interface SearchFacade {
@ApiOperation
(
"获取用户最近搜索列表H5"
)
@GetMapping
(
"getUserSearchList4H5"
)
ResponseDto
<?>
getUserSearchList4H5
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxId"
,
required
=
false
)
@ApiParam
(
"用户id"
)
String
wxId
,
@RequestParam
(
value
=
"wechatUserId"
,
required
=
false
)
@ApiParam
(
"微信id"
)
Long
wechatUserId
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/SearchFacadeImpl.java
View file @
3ce16fbb
...
...
@@ -9,11 +9,13 @@ import com.pcloud.common.dto.ResponseDto;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.cookie.Cookie
;
import
com.pcloud.wechatgroup.message.enums.IsSystem
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.CookieValue
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -95,8 +97,10 @@ public class SearchFacadeImpl implements SearchFacade {
@PostMapping
(
"createSearchRecord4H5"
)
@Override
public
ResponseDto
<?>
createSearchRecord4H5
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
SearchRecord
searchRecord
)
throws
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
searchBiz
.
createSearchRecord4H5
(
searchRecord
);
return
new
ResponseDto
<>();
}
...
...
@@ -177,12 +181,13 @@ public class SearchFacadeImpl implements SearchFacade {
@GetMapping
(
"getUserSearchList4H5"
)
@Override
public
ResponseDto
<?>
getUserSearchList4H5
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"wxId"
,
required
=
false
)
@ApiParam
(
"用户id"
)
String
wxId
,
@RequestParam
(
value
=
"wechatUserId"
,
required
=
false
)
@ApiParam
(
"微信id"
)
Long
wechatUserId
,
@RequestParam
(
"currentPage"
)
@ApiParam
(
"当前页"
)
Integer
currentPage
,
@RequestParam
(
"numPerPage"
)
@ApiParam
(
"每页条数"
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
return
new
ResponseDto
<>(
searchBiz
.
getUserSearchList4H5
(
wxId
,
wechatUserId
,
currentPage
,
numPerPage
));
return
new
ResponseDto
<>(
searchBiz
.
getUserSearchList4H5
(
wxId
,
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
)
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"删除用户搜索记录H5"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
3ce16fbb
...
...
@@ -343,7 +343,7 @@ public class WechatGroupConsr {
try
{
selfRobotDTO
=
ResponseHandleUtil
.
parseResponse
(
selfRobotService
.
getAvailableRobot
(
wechatUserId
,
largeTemplet
,
classifyId
),
SelfRobotDTO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取可用机器人.[getAvailableRobot]:
"
+
e
.
getMessage
(),
e
);
log
.
error
(
"获取可用机器人.[getAvailableRobot]:
wechatUserId:{},largeTemplet:{},classifyId:{}"
,
wechatUserId
,
largeTemplet
,
classifyId
);
}
return
selfRobotDTO
;
}
...
...
@@ -368,7 +368,7 @@ public class WechatGroupConsr {
try
{
selfRobotDTO
=
ResponseHandleUtil
.
parseResponse
(
selfRobotService
.
getAvailableRobotByBookGroup
(
availableRobotParamDTO
),
SelfRobotDTO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取可用机器人.[getAvailableRobotByBookGroup]
:"
+
e
.
getMessage
(),
e
);
log
.
error
(
"获取可用机器人.[getAvailableRobotByBookGroup]
获取参数为:{}"
,
availableRobotParamDTO
);
}
return
selfRobotDTO
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/facade/CultivateFacade.java
View file @
3ce16fbb
...
...
@@ -43,17 +43,19 @@ public class CultivateFacade {
@ApiOperation
(
"新增养成"
)
@PostMapping
(
"/createCultivate"
)
public
ResponseDto
<?>
createCultivate
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
CreateCultivateDTO
createCultivateDTO
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
createCultivate
(
createCultivateDTO
));
}
@ApiOperation
(
"获取养成"
)
@GetMapping
(
"/getCultivate"
)
public
ResponseDto
<?>
getCultivate
(
@RequestParam
(
"wechatUserId"
)
@ApiParam
(
"用户id"
)
Long
wechatUserId
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
)
throws
BizException
,
PermissionException
{
return
new
ResponseDto
<>(
cultivateBiz
.
getCultivate
(
wechatUserId
));
return
new
ResponseDto
<>(
cultivateBiz
.
getCultivate
(
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
)
));
}
@ApiOperation
(
"新增养成分类关联"
)
...
...
@@ -68,8 +70,10 @@ public class CultivateFacade {
@ApiOperation
(
"能量消耗"
)
@PostMapping
(
"/energyConsumption"
)
public
ResponseDto
<?>
getCultivate
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
(
"养成分类关联"
)
EnergyConsumptionDTO
energyConsumptionDTO
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
cultivateBiz
.
energyConsumption
(
energyConsumptionDTO
);
return
new
ResponseDto
<>();
}
...
...
@@ -77,8 +81,10 @@ public class CultivateFacade {
@ApiOperation
(
"银两兑换"
)
@PostMapping
(
"/fishBallConversion"
)
public
ResponseDto
<?>
fishBallConversion
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
(
"银两兑换"
)
FishBallConversionDTO
fishBallConversionDTO
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
cultivateBiz
.
fishBallConversion
(
fishBallConversionDTO
);
return
new
ResponseDto
<>();
}
...
...
@@ -86,9 +92,10 @@ public class CultivateFacade {
@ApiOperation
(
"新增技能使用记录"
)
@PostMapping
(
"/addUseSkillRecord"
)
public
ResponseDto
<?>
addUseSkillRecord
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
(
"技能使用"
)
SkillUseDTO
skillUseDTO
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
skillUseDTO
.
getWechatUserId
(
);
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
cultivateBiz
.
addUseSkillRecord
(
wechatUserId
,
skillUseDTO
);
return
new
ResponseDto
<>();
}
...
...
@@ -97,8 +104,10 @@ public class CultivateFacade {
@ApiOperation
(
"银两摘取"
)
@PostMapping
(
"/fishBallPick"
)
public
ResponseDto
<?>
fishBallPick
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
@ApiParam
(
"银两摘取"
)
FishBallPickDTO
fishBallPickDTO
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
cultivateBiz
.
fishBallPick
(
fishBallPickDTO
);
return
new
ResponseDto
<>();
}
...
...
@@ -114,43 +123,35 @@ public class CultivateFacade {
@ApiOperation
(
"获取动态记录列表"
)
@GetMapping
(
"/getCultivateRecordList"
)
public
ResponseDto
<?>
getCultivateRecordList
(
@
RequestParam
Long
wechatUserId
,
@
CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestParam
(
"cultivateId"
)
@ApiParam
(
"养成id"
)
Long
cultivateId
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
if
(
currentPage
==
null
||
numPerPage
==
null
||
currentPage
<
0
||
numPerPage
<
0
)
{
throw
BookBizException
.
PAGE_PARAM_DELETION
;
}
if
(!
NumberUtil
.
isNumber
(
wechatUserId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
getCultivateRecordList
(
cultivateId
,
wechatUserId
,
currentPage
,
numPerPage
));
}
@ApiOperation
(
"获取陪伴天数"
)
@GetMapping
(
"/getLoginDays"
)
public
ResponseDto
<?>
getLoginDays
(
@RequestParam
Long
wechatUserId
){
if
(!
NumberUtil
.
isNumber
(
wechatUserId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
public
ResponseDto
<?>
getLoginDays
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
){
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
getLoginDays
(
wechatUserId
));
}
@ApiOperation
(
"获取排名"
)
@GetMapping
(
"/getRanking"
)
public
ResponseDto
<?>
getRanking
(
@RequestParam
Long
wechatUserId
){
if
(!
NumberUtil
.
isNumber
(
wechatUserId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
public
ResponseDto
<?>
getRanking
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
){
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
getRanking
(
wechatUserId
));
}
@ApiOperation
(
"分享"
)
@GetMapping
(
"shareMedal"
)
public
ResponseDto
<?>
shareMedal
(
@RequestParam
Long
wechatUserId
){
if
(!
NumberUtil
.
isNumber
(
wechatUserId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
public
ResponseDto
<?>
shareMedal
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
){
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
shareMedal
(
wechatUserId
));
}
...
...
@@ -165,8 +166,10 @@ public class CultivateFacade {
@ApiOperation
(
"小睿养成读者喜好书籍"
)
@PostMapping
(
"/createCultivateBookUser"
)
public
ResponseDto
<?>
createCultivateBookUser
(
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestBody
CultivateBookUser
cultivateBookUser
)
throws
BizException
,
PermissionException
{
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
return
new
ResponseDto
<>(
cultivateBiz
.
createCultivateBookUser
(
cultivateBookUser
));
}
...
...
@@ -181,14 +184,13 @@ public class CultivateFacade {
@ApiOperation
(
"获取搜索书籍记录列表"
)
@GetMapping
(
"/getBookSearchRecord"
)
public
ResponseDto
<?>
getBookSearchRecord
(
@CookieValue
(
value
=
"userInfo"
,
required
=
false
)
String
userInfo
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@CookieValue
(
value
=
"userInfo"
)
String
userInfo
,
@RequestParam
(
value
=
"currentPage"
,
required
=
false
)
Integer
currentPage
,
@RequestParam
(
value
=
"numPerPage"
,
required
=
false
)
Integer
numPerPage
)
throws
BizException
,
PermissionException
{
Long
wechatUserId
=
Cookie
.
getId
(
userInfo
,
Cookie
.
_WECHAT_USER_ID
);
if
(!
NumberUtil
.
isNumber
(
wechatUserId
)){
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"wechatUserId 不能为空"
);
}
return
new
ResponseDto
<>(
cultivateBiz
.
getBookSearchRecord
(
wechatUserId
,
currentPage
,
numPerPage
));
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/biz/impl/RightsSettingBizImpl.java
View file @
3ce16fbb
...
...
@@ -97,7 +97,7 @@ public class RightsSettingBizImpl implements RightsSettingBiz {
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"已存在相同的权益设置"
);
}
rightsSetting
.
setUpdateTime
(
new
Date
());
rightsSettingDAO
.
updateByPrimaryKey
Selective
(
rightsSetting
);
rightsSettingDAO
.
updateByPrimaryKey
(
rightsSetting
);
}
@Override
...
...
pcloud-service-book/src/main/java/com/pcloud/book/rightsSetting/dao/impl/RightsSettingDAOImpl.java
View file @
3ce16fbb
...
...
@@ -28,7 +28,7 @@ public class RightsSettingDAOImpl extends BaseDaoImpl<RightsSetting> implement
@Override
public
int
updateByPrimaryKey
(
RightsSetting
record
)
{
return
super
.
getSqlSession
().
update
(
getStatement
(
"updateByPrimaryKey
Selective
"
),
record
);
return
super
.
getSqlSession
().
update
(
getStatement
(
"updateByPrimaryKey"
),
record
);
}
@Override
...
...
pcloud-service-book/src/main/resources/mapper/rightssetting/RightsSettingMapper.xml
View file @
3ce16fbb
...
...
@@ -92,7 +92,6 @@
second_classify = #{secondClassify,jdbcType=BIGINT},
grade_label_id = #{gradeLabelId,jdbcType=BIGINT},
subject_label_id = #{subjectLabelId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
...
...
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