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
bc33e762
Commit
bc33e762
authored
Aug 03, 2021
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/1005149' into 'master'
feat: [1005149] 授权优化 See merge request rays/pcloud-book!1370
parents
eabe5217
e150e32b
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
130 additions
and
1 deletions
+130
-1
BookDto.java
...-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
+10
-0
BookAdviserBiz.java
...rc/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
+4
-0
BookAdviserBizImpl.java
...ava/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
+33
-0
BookAdviserDao.java
...rc/main/java/com/pcloud/book/book/dao/BookAdviserDao.java
+4
-0
BookAdviserDaoImpl.java
...ava/com/pcloud/book/book/dao/impl/BookAdviserDaoImpl.java
+19
-0
BookAdviserFacadeImpl.java
...m/pcloud/book/book/facade/impl/BookAdviserFacadeImpl.java
+25
-0
Book.Mapper.xml
...rvice-book/src/main/resources/mapper/book/Book.Mapper.xml
+2
-1
BookAdviser.Mapper.xml
...ook/src/main/resources/mapper/book/BookAdviser.Mapper.xml
+33
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/dto/BookDto.java
View file @
bc33e762
...
...
@@ -833,6 +833,16 @@ public class BookDto extends BaseDto {
//是否开启手机号登录
private
Integer
bookPhoneAuth
;
private
Integer
isWechatAuth
;
public
Integer
getIsWechatAuth
()
{
return
isWechatAuth
;
}
public
void
setIsWechatAuth
(
Integer
isWechatAuth
)
{
this
.
isWechatAuth
=
isWechatAuth
;
}
public
Integer
getUploadUserId
()
{
return
uploadUserId
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/BookAdviserBiz.java
View file @
bc33e762
...
...
@@ -459,4 +459,8 @@ public interface BookAdviserBiz {
* @return
*/
Integer
getBookPhoneAuth
(
Long
sceneId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
);
void
updateBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
isWechatAuth
);
Integer
getBookWechatAuth
(
Long
sceneId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/biz/impl/BookAdviserBizImpl.java
View file @
bc33e762
...
...
@@ -3296,4 +3296,37 @@ public class BookAdviserBizImpl implements BookAdviserBiz {
return
bookPhoneAuth
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
isWechatAuth
)
{
if
(
null
==
bookId
||
null
==
adviserId
||
null
==
channelId
||
null
==
isWechatAuth
)
{
throw
new
BizException
(
BizException
.
PARAM_IS_NULL
.
getCode
(),
"参数为空请确认"
);
}
bookAdviserDao
.
updateBookWechatAuth
(
bookId
,
adviserId
,
channelId
,
isWechatAuth
);
}
@Override
public
Integer
getBookWechatAuth
(
Long
sceneId
,
Long
bookId
,
Long
adviserId
,
Long
channelId
)
{
Integer
isWechatAuth
=
YesOrNoEnums
.
YES
.
getValue
();
if
(
null
==
sceneId
&&
null
==
bookId
&&
null
==
adviserId
&&
null
==
channelId
)
{
return
isWechatAuth
;
}
if
(
null
!=
bookId
)
{
isWechatAuth
=
bookAdviserDao
.
getBookWechatAuth
(
bookId
,
adviserId
,
channelId
);
}
else
if
(
null
!=
sceneId
)
{
//根据sceneId获取二维码信息
Map
<
Long
,
QrcodeSceneDto
>
qrcodeSceneDtoMap
=
qrcodeSceneConsr
.
listBaseInfoByIds
(
Lists
.
newArrayList
(
sceneId
));
if
(
MapUtils
.
isEmpty
(
qrcodeSceneDtoMap
)
||
null
==
qrcodeSceneDtoMap
.
get
(
sceneId
))
{
return
isWechatAuth
;
}
QrcodeSceneDto
qrcodeSceneDto
=
qrcodeSceneDtoMap
.
get
(
sceneId
);
if
(
null
==
qrcodeSceneDto
||
null
==
qrcodeSceneDto
.
getAdviserBookId
())
{
return
isWechatAuth
;
}
isWechatAuth
=
bookAdviserDao
.
getBookPhoneAuth
(
qrcodeSceneDto
.
getAdviserBookId
(),
qrcodeSceneDto
.
getCreatedByUserLogin
(),
qrcodeSceneDto
.
getChannelPartyId
());
}
return
isWechatAuth
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/BookAdviserDao.java
View file @
bc33e762
...
...
@@ -335,4 +335,8 @@ public interface BookAdviserDao extends BaseDao<BookAdviser> {
void
updateBookPhoneAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
bookPhoneAuth
);
Integer
getBookPhoneAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
);
void
updateBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
isWechatAuth
);
Integer
getBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/book/dao/impl/BookAdviserDaoImpl.java
View file @
bc33e762
...
...
@@ -466,4 +466,23 @@ public class BookAdviserDaoImpl extends BaseDaoImpl<BookAdviser> implements Book
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookPhoneAuth"
),
paramMap
);
}
@Override
public
void
updateBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
,
Integer
isWechatAuth
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"isWechatAuth"
,
isWechatAuth
);
getSessionTemplate
().
update
(
getStatement
(
"updateBookWechatAuth"
),
paramMap
);
}
@Override
public
Integer
getBookWechatAuth
(
Long
bookId
,
Long
adviserId
,
Long
channelId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
return
getSessionTemplate
().
selectOne
(
getStatement
(
"getBookWechatAuth"
),
paramMap
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/book/facade/impl/BookAdviserFacadeImpl.java
View file @
bc33e762
...
...
@@ -468,4 +468,29 @@ public class BookAdviserFacadeImpl implements BookAdviserFacade {
Cookie
.
getUserInfo
(
userInfo
);
return
new
ResponseDto
<
Integer
>(
bookAdviserBiz
.
getBookPhoneAuth
(
sceneId
,
bookId
,
adviserId
,
channelId
));
}
/**
* 设置书刊二维码进入是否需要授权用户信息
*/
@RequestMapping
(
value
=
"updateBookWechatAuth"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
updateBookWechatAuth
(
@RequestHeader
(
"token"
)
String
token
,
@RequestParam
(
value
=
"bookId"
)
Long
bookId
,
@RequestParam
(
value
=
"channelId"
)
Long
channelId
,
@RequestParam
(
value
=
"isWechatAuth"
)
Integer
isWechatAuth
)
throws
PermissionException
{
Long
adviserId
=
(
Long
)
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
bookAdviserBiz
.
updateBookWechatAuth
(
bookId
,
adviserId
,
channelId
,
isWechatAuth
);
return
new
ResponseDto
<>();
}
/**
* 获取书刊二维码进入是否需要授权用户信息
*/
@RequestMapping
(
value
=
"getBookWechatAuth"
,
method
=
RequestMethod
.
GET
)
public
ResponseDto
<?>
getBookWechatAuth
(
@RequestParam
(
value
=
"sceneId"
,
required
=
false
)
Long
sceneId
,
@RequestParam
(
value
=
"bookId"
,
required
=
false
)
Long
bookId
,
@RequestParam
(
value
=
"adviserId"
,
required
=
false
)
Long
adviserId
,
@RequestParam
(
value
=
"channelId"
,
required
=
false
)
Long
channelId
)
throws
PermissionException
{
return
new
ResponseDto
<
Integer
>(
bookAdviserBiz
.
getBookWechatAuth
(
sceneId
,
bookId
,
adviserId
,
channelId
));
}
}
pcloud-service-book/src/main/resources/mapper/book/Book.Mapper.xml
View file @
bc33e762
...
...
@@ -76,6 +76,7 @@
<result
column=
"is_approval"
property=
"isApproval"
jdbcType=
"BIT"
/>
<result
column=
"is_relate"
property=
"isRelate"
jdbcType=
"BIT"
/>
<result
column=
"book_phone_auth"
property=
"bookPhoneAuth"
jdbcType=
"BIT"
/>
<result
column=
"is_wechat_auth"
property=
"isWechatAuth"
jdbcType=
"BIT"
/>
</resultMap>
<resultMap
id=
"bookListPageMap"
type=
"bookDto"
extends =
"bookMap"
>
...
...
@@ -320,7 +321,7 @@
BA.GRA_LABEL_ID,BA.SUB_LABEL_ID,BA.VER_LABEL_ID,BA.AREA_LABEL_ID, BA.IS_PRINT isPrint, BA.is_relate,
BA.pro_label_id, BA.dep_label_id,BA.pur_label_id,BA.vol_label_id,if(G.ID IS NULL, 0, 1) isBookGroup, G.id BOOK_GROUP_ID,G.join_group_type,
BA.is_open_robot_process,BA.vol_label_id,b.unique_number,BA.CREATED_DATE,b.edition,BA.is_send_mini_url,
BA.is_open_catalog ,BA.is_approval, BA.book_phone_auth
BA.is_open_catalog ,BA.is_approval, BA.book_phone_auth
,BA.is_wechat_auth
FROM
BOOK_ADVISER BA
INNER JOIN
...
...
pcloud-service-book/src/main/resources/mapper/book/BookAdviser.Mapper.xml
View file @
bc33e762
...
...
@@ -1270,4 +1270,37 @@
is_delete = 0
limit 1
</select>
<update
id=
"updateBookWechatAuth"
parameterType=
"map"
>
update
book_adviser
set
is_wechat_auth = #{isWechatAuth}, LAST_MODIFIED_DATE = NOW()
where
BOOK_ID = #{bookId, jdbcType=BIGINT}
AND
ADVISER_ID = #{adviserId, jdbcType=BIGINT}
AND
CHANNEL_ID = #{channelId, jdbcType=BIGINT}
and
IS_DELETE = 0
</update>
<select
id=
"getBookWechatAuth"
parameterType=
"map"
resultType=
"integer"
>
select
is_wechat_auth
from
book_adviser
where
book_id = #{bookId}
<if
test=
"adviserId != null"
>
and adviser_id = #{adviserId}
</if>
<if
test=
"channelId != null"
>
and channel_id = #{channelId}
</if>
and
is_delete = 0
limit 1
</select>
</mapper>
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