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
cc4d59c4
Commit
cc4d59c4
authored
Aug 07, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人二维码替换群二维码
parent
e1c705fa
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
5 deletions
+115
-5
GroupUseDTO.java
.../src/main/java/com/pcloud/book/group/dto/GroupUseDTO.java
+45
-0
BookGroupService.java
.../java/com/pcloud/book/group/service/BookGroupService.java
+5
-0
BookGroupBiz.java
...src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
+5
-0
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+20
-0
WeixinQrcodeDao.java
.../main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
+5
-0
WeixinQrcodeDaoImpl.java
...a/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
+8
-0
BookGroupServiceImpl.java
.../pcloud/book/group/service/impl/BookGroupServiceImpl.java
+18
-5
WeixinQrcode.Mapper.xml
...k/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
+9
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/GroupUseDTO.java
0 → 100644
View file @
cc4d59c4
package
com
.
pcloud
.
book
.
group
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/8/7 9:26
**/
@ApiModel
(
"群使用情况模型"
)
public
class
GroupUseDTO
implements
Serializable
{
@ApiModelProperty
(
"已使用"
)
private
Integer
hasUsed
;
@ApiModelProperty
(
"未使用"
)
private
Integer
notUsed
;
public
Integer
getHasUsed
()
{
return
hasUsed
;
}
public
void
setHasUsed
(
Integer
hasUsed
)
{
this
.
hasUsed
=
hasUsed
;
}
public
Integer
getNotUsed
()
{
return
notUsed
;
}
public
void
setNotUsed
(
Integer
notUsed
)
{
this
.
notUsed
=
notUsed
;
}
@Override
public
String
toString
()
{
return
"GroupUseDTO{"
+
"hasUsed="
+
hasUsed
+
", notUsed="
+
notUsed
+
'}'
;
}
}
pcloud-facade-book/src/main/java/com/pcloud/book/group/service/BookGroupService.java
View file @
cc4d59c4
...
@@ -2,6 +2,8 @@ package com.pcloud.book.group.service;
...
@@ -2,6 +2,8 @@ package com.pcloud.book.group.service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.pcloud.book.group.dto.GroupUseDTO
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.cloud.netflix.feign.FeignClient
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -39,4 +41,7 @@ public interface BookGroupService {
...
@@ -39,4 +41,7 @@ public interface BookGroupService {
@GetMapping
(
"/updateCipherStateToUsed"
)
@GetMapping
(
"/updateCipherStateToUsed"
)
void
updateCipherStateToUsed
(
@RequestParam
(
"cipher"
)
String
cipher
,
@RequestParam
(
"wxId"
)
String
wxId
)
throws
BizException
;
void
updateCipherStateToUsed
(
@RequestParam
(
"cipher"
)
String
cipher
,
@RequestParam
(
"wxId"
)
String
wxId
)
throws
BizException
;
@ApiOperation
(
"获取个人二维码方式群已使用和未使用数量"
)
@PostMapping
(
"/getGroupUse"
)
ResponseEntity
<
ResponseDto
<
GroupUseDTO
>>
getGroupUse
(
@RequestBody
List
<
String
>
altIds
)
throws
BizException
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/BookGroupBiz.java
View file @
cc4d59c4
...
@@ -257,4 +257,9 @@ public interface BookGroupBiz {
...
@@ -257,4 +257,9 @@ public interface BookGroupBiz {
* 更新状态为已使用
* 更新状态为已使用
*/
*/
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
);
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
);
/**
* 获取个人二维码方式群已使用和未使用数量
*/
GroupUseDTO
getGroupUse
(
List
<
String
>
altIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
cc4d59c4
...
@@ -158,6 +158,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -158,6 +158,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private
JoinGroupCipherDao
joinGroupCipherDao
;
private
JoinGroupCipherDao
joinGroupCipherDao
;
@Autowired
@Autowired
private
WechatGroupConsr
wechatGroupConsr
;
private
WechatGroupConsr
wechatGroupConsr
;
@Autowired
private
WeixinQrcodeDao
weixinQrcodeDao
;
@Override
@Override
...
@@ -1135,7 +1137,25 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -1135,7 +1137,25 @@ public class BookGroupBizImpl implements BookGroupBiz {
@ParamLog
(
"获取暗号状态为已使用"
)
@ParamLog
(
"获取暗号状态为已使用"
)
@Override
@Override
public
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
)
{
public
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
)
{
if
(
StringUtil
.
isEmpty
(
cipher
)
||
StringUtil
.
isEmpty
(
wxId
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空!"
);
}
joinGroupCipherDao
.
updateCipherStateToUsed
(
cipher
,
wxId
);
joinGroupCipherDao
.
updateCipherStateToUsed
(
cipher
,
wxId
);
}
}
@ParamLog
(
"获取个人二维码方式群已使用和未使用数量"
)
@Override
public
GroupUseDTO
getGroupUse
(
List
<
String
>
altIds
)
{
if
(
ListUtils
.
isEmpty
(
altIds
))
{
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"参数不能为空!"
);
}
GroupUseDTO
groupUseDTO
=
new
GroupUseDTO
();
Integer
notUsed
=
weixinQrcodeDao
.
countByState
(
0
,
altIds
);
Integer
hasUsed
=
weixinQrcodeDao
.
countByState
(
1
,
altIds
);
Integer
full
=
weixinQrcodeDao
.
countByState
(
2
,
altIds
);
groupUseDTO
.
setHasUsed
(
hasUsed
+
full
);
groupUseDTO
.
setNotUsed
(
notUsed
);
return
groupUseDTO
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/WeixinQrcodeDao.java
View file @
cc4d59c4
...
@@ -155,4 +155,9 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
...
@@ -155,4 +155,9 @@ public interface WeixinQrcodeDao extends BaseDao<WeixinQrcode> {
Map
<
String
,
BookWxQrcodeDTO
>
listByWxGroupIds
(
List
<
String
>
wxGroupIds
);
Map
<
String
,
BookWxQrcodeDTO
>
listByWxGroupIds
(
List
<
String
>
wxGroupIds
);
String
getVirtualIp
(
Integer
generation
);
String
getVirtualIp
(
Integer
generation
);
/**
* 根据状态获取群数量
*/
Integer
countByState
(
Integer
state
,
List
<
String
>
altIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/WeixinQrcodeDaoImpl.java
View file @
cc4d59c4
...
@@ -154,4 +154,12 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
...
@@ -154,4 +154,12 @@ public class WeixinQrcodeDaoImpl extends BaseDaoImpl<WeixinQrcode> implements We
public
String
getVirtualIp
(
Integer
generation
)
{
public
String
getVirtualIp
(
Integer
generation
)
{
return
this
.
getSessionTemplate
().
selectOne
(
"getVirtualIp"
,
generation
);
return
this
.
getSessionTemplate
().
selectOne
(
"getVirtualIp"
,
generation
);
}
}
@Override
public
Integer
countByState
(
Integer
state
,
List
<
String
>
altIds
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"state"
,
state
);
paramMap
.
put
(
"altIds"
,
altIds
);
return
this
.
getSessionTemplate
().
selectOne
(
"countByState"
,
paramMap
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/service/impl/BookGroupServiceImpl.java
View file @
cc4d59c4
...
@@ -2,13 +2,12 @@ package com.pcloud.book.group.service.impl;
...
@@ -2,13 +2,12 @@ package com.pcloud.book.group.service.impl;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
com.pcloud.book.group.dto.GroupUseDTO
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.biz.BookGroupBiz
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.service.BookGroupService
;
import
com.pcloud.book.group.service.BookGroupService
;
...
@@ -57,6 +56,8 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -57,6 +56,8 @@ public class BookGroupServiceImpl implements BookGroupService {
/**
/**
* 获取暗号状态
* 获取暗号状态
*/
*/
@ApiOperation
(
"获取暗号状态"
)
@GetMapping
(
"/getCipherState"
)
@Override
@Override
public
ResponseEntity
<
ResponseDto
<
Integer
>>
getCipherState
(
String
cipher
)
throws
BizException
{
public
ResponseEntity
<
ResponseDto
<
Integer
>>
getCipherState
(
String
cipher
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
getCipherState
(
cipher
));
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
getCipherState
(
cipher
));
...
@@ -65,9 +66,21 @@ public class BookGroupServiceImpl implements BookGroupService {
...
@@ -65,9 +66,21 @@ public class BookGroupServiceImpl implements BookGroupService {
/**
/**
* 更新密码状态为已使用
* 更新密码状态为已使用
*/
*/
@ApiOperation
(
"更新暗号状态为已使用"
)
@GetMapping
(
"/updateCipherStateToUsed"
)
@Override
@Override
public
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
)
throws
BizException
{
public
void
updateCipherStateToUsed
(
String
cipher
,
String
wxId
)
throws
BizException
{
bookGroupBiz
.
updateCipherStateToUsed
(
cipher
,
wxId
);
bookGroupBiz
.
updateCipherStateToUsed
(
cipher
,
wxId
);
}
}
/**
* 获取个人二维码方式群已使用和未使用数量
*/
@ApiOperation
(
"获取个人二维码方式群已使用和未使用数量"
)
@PostMapping
(
"/getGroupUse"
)
@Override
public
ResponseEntity
<
ResponseDto
<
GroupUseDTO
>>
getGroupUse
(
@RequestBody
List
<
String
>
altIds
)
throws
BizException
{
return
ResponseHandleUtil
.
toResponse
(
bookGroupBiz
.
getGroupUse
(
altIds
));
}
}
}
pcloud-service-book/src/main/resources/mapper/group/WeixinQrcode.Mapper.xml
View file @
cc4d59c4
...
@@ -275,4 +275,12 @@
...
@@ -275,4 +275,12 @@
where generation = #{_parameter}
where generation = #{_parameter}
</select>
</select>
<!--根据状态获取群数量-->
<select
id=
"countByState"
parameterType=
"map"
resultType=
"Integer"
>
select count(1) from weixin_qrcode t where t.robot_wx_id in
<foreach
collection=
"altIds"
item=
"item"
index=
"index"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
and use_state=#{state}
</select>
</mapper>
</mapper>
\ No newline at end of file
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