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
d5eb2b53
Commit
d5eb2b53
authored
Nov 23, 2020
by
田超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixbug/perfCheckCode' into 'master'
bug: [none] 优化授权码接口 See merge request rays/pcloud-book!1047
parents
0a639509
d9c65ae1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
5 deletions
+48
-5
BookAuthCodeBizImpl.java
...m/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
+4
-5
BookAuthCodeDao.java
...n/java/com/pcloud/book/copyright/dao/BookAuthCodeDao.java
+5
-0
BookAuthCodeDaoImpl.java
...m/pcloud/book/copyright/dao/impl/BookAuthCodeDaoImpl.java
+15
-0
BookAuthCode.Mapper.xml
...c/main/resources/mapper/copyright/BookAuthCode.Mapper.xml
+24
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/copyright/biz/impl/BookAuthCodeBizImpl.java
View file @
d5eb2b53
...
@@ -155,16 +155,15 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
...
@@ -155,16 +155,15 @@ public class BookAuthCodeBizImpl implements BookAuthCodeBiz {
if
(
isHaveAuth
)
{
if
(
isHaveAuth
)
{
return
BookStatusEnum
.
CodeUseTypeEnum
.
RIGHT
.
value
;
return
BookStatusEnum
.
CodeUseTypeEnum
.
RIGHT
.
value
;
}
}
Boolean
isHaveCode
=
bookAuthCodeDao
.
getIsHaveCode
(
bookId
,
channelId
,
adviserId
,
code
,
authBookType
);
Long
authCodeId
=
bookAuthCodeDao
.
getBookAuthCodeId
(
bookId
,
channelId
,
adviserId
,
code
,
authBookType
);
Integer
count
=
bookAuthCodeDao
.
updateUseCount
(
bookId
,
channelId
,
adviserId
,
code
,
authBookInfo
.
getCodeUseCount
(),
authBookType
);
Integer
count
=
bookAuthCodeDao
.
updateUseCount
(
bookId
,
channelId
,
adviserId
,
code
,
authBookInfo
.
getCodeUseCount
(),
authBookType
);
if
(
count
<
1
&&
isHaveCode
)
{
if
(
count
<
1
&&
authCodeId
!=
null
&&
authCodeId
>
0
)
{
return
BookStatusEnum
.
CodeUseTypeEnum
.
HAVE_USE
.
value
;
return
BookStatusEnum
.
CodeUseTypeEnum
.
HAVE_USE
.
value
;
}
else
if
(
count
<
1
&&
!
isHaveCode
)
{
}
else
if
(
count
<
1
&&
(
authCodeId
==
null
||
authCodeId
==
0
)
)
{
return
BookStatusEnum
.
CodeUseTypeEnum
.
NOT_RIGHT
.
value
;
return
BookStatusEnum
.
CodeUseTypeEnum
.
NOT_RIGHT
.
value
;
}
else
{
}
else
{
BookAuthCode
bookAuthCode
=
bookAuthCodeDao
.
getByFullCode
(
code
);
//新增一条校验成功记录
//新增一条校验成功记录
addUserRecord
(
bookId
,
channelId
,
adviserId
,
wechatUserId
,
authBookType
,
bookAuthCode
.
getId
()
);
addUserRecord
(
bookId
,
channelId
,
adviserId
,
wechatUserId
,
authBookType
,
authCodeId
);
return
BookStatusEnum
.
CodeUseTypeEnum
.
RIGHT
.
value
;
return
BookStatusEnum
.
CodeUseTypeEnum
.
RIGHT
.
value
;
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/BookAuthCodeDao.java
View file @
d5eb2b53
...
@@ -29,6 +29,11 @@ public interface BookAuthCodeDao extends BaseDao<BookAuthCode> {
...
@@ -29,6 +29,11 @@ public interface BookAuthCodeDao extends BaseDao<BookAuthCode> {
Boolean
getIsHaveCode
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
code
,
Integer
authBookType
);
Boolean
getIsHaveCode
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
code
,
Integer
authBookType
);
/**
/**
* 获取码数量
*/
Long
getBookAuthCodeId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
code
,
Integer
authBookType
);
/**
* 批量删除正版授权码
* 批量删除正版授权码
* @param ids
* @param ids
*/
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/copyright/dao/impl/BookAuthCodeDaoImpl.java
View file @
d5eb2b53
...
@@ -65,6 +65,21 @@ public class BookAuthCodeDaoImpl extends BaseDaoImpl<BookAuthCode> implements Bo
...
@@ -65,6 +65,21 @@ public class BookAuthCodeDaoImpl extends BaseDaoImpl<BookAuthCode> implements Bo
}
}
@Override
@Override
public
Long
getBookAuthCodeId
(
Long
bookId
,
Long
channelId
,
Long
adviserId
,
String
code
,
Integer
authBookType
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"channelId"
,
channelId
);
paramMap
.
put
(
"adviserId"
,
adviserId
);
paramMap
.
put
(
"code"
,
code
);
if
(
authBookType
==
null
||
authBookType
.
equals
(
0
))
{
paramMap
.
put
(
"isPaperBook"
,
1
);
}
else
{
paramMap
.
put
(
"isGroupBook"
,
1
);
}
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getBookAuthCodeId"
),
paramMap
);
}
@Override
public
void
batchDeleteCode
(
List
<
Long
>
ids
)
{
public
void
batchDeleteCode
(
List
<
Long
>
ids
)
{
this
.
getSqlSession
().
delete
(
this
.
getStatement
(
"batchDeleteCode"
),
ids
);
this
.
getSqlSession
().
delete
(
this
.
getStatement
(
"batchDeleteCode"
),
ids
);
}
}
...
...
pcloud-service-book/src/main/resources/mapper/copyright/BookAuthCode.Mapper.xml
View file @
d5eb2b53
...
@@ -86,6 +86,30 @@
...
@@ -86,6 +86,30 @@
</if>
</if>
</select>
</select>
<select
id=
"getBookAuthCodeId"
resultType=
"Long"
parameterType=
"map"
>
SELECT
id
FROM
BOOK_AUTH_CODE
WHERE
BOOK_ID = #{bookId, jdbcType=BIGINT}
AND
CHANNEL_ID = #{channelId, jdbcType=BIGINT}
AND
ADVISER_ID = #{adviserId, jdbcType=BIGINT}
AND
FULL_CODE = #{code}
<if
test=
"isPaperBook != null"
>
AND
is_paper_book = #{isPaperBook}
</if>
<if
test=
"isGroupBook!=null"
>
AND
is_group_book = #{isGroupBook}
</if>
LIMIT 1
</select>
<select
id=
"getCodeList"
parameterType=
"map"
resultType=
"com.pcloud.book.copyright.dto.BookAuthCodeDTO"
>
<select
id=
"getCodeList"
parameterType=
"map"
resultType=
"com.pcloud.book.copyright.dto.BookAuthCodeDTO"
>
SELECT
SELECT
id id,
id id,
...
...
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