Commit 12b495f8 by 阮思源

增加内部接口

parent 8acc1c8d
package com.pcloud.book.group.dto;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/8/12 14:57
**/
public class GroupCipherDTO implements Serializable {
private static final long serialVersionUID = 4254978072223600943L;
@ApiModelProperty("密码")
private String cipher;
@ApiModelProperty("分类id")
private Long classifyId;
@ApiModelProperty("创建人")
private Long wechatUserId;
@ApiModelProperty("使用人微信id")
private String wxId;
@ApiModelProperty("是否使用")
private Boolean hasUsed;
@ApiModelProperty("机器人id")
private String altId;
public String getCipher() {
return cipher;
}
public void setCipher(String cipher) {
this.cipher = cipher;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public Long getWechatUserId() {
return wechatUserId;
}
public void setWechatUserId(Long wechatUserId) {
this.wechatUserId = wechatUserId;
}
public String getWxId() {
return wxId;
}
public void setWxId(String wxId) {
this.wxId = wxId;
}
public Boolean getHasUsed() {
return hasUsed;
}
public void setHasUsed(Boolean hasUsed) {
this.hasUsed = hasUsed;
}
public String getAltId() {
return altId;
}
public void setAltId(String altId) {
this.altId = altId;
}
@Override
public String toString() {
return "GroupCipherDTO{" +
"cipher='" + cipher + '\'' +
", classifyId=" + classifyId +
", wechatUserId=" + wechatUserId +
", wxId='" + wxId + '\'' +
", hasUsed=" + hasUsed +
", altId='" + altId + '\'' +
'}';
}
}
......@@ -3,6 +3,7 @@ package com.pcloud.book.group.service;
import java.util.List;
import java.util.Map;
import com.pcloud.book.group.dto.GroupCipherDTO;
import com.pcloud.book.group.dto.GroupUseDTO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.ResponseEntity;
......@@ -44,4 +45,8 @@ public interface BookGroupService {
@ApiOperation("获取个人二维码方式群已使用和未使用数量")
@PostMapping("/getGroupUse")
ResponseEntity<ResponseDto<GroupUseDTO>> getGroupUse(@RequestBody List<String> altIds) throws BizException;
@ApiOperation("获取暗号基本信息")
@GetMapping("/getJoinGroupCipher")
ResponseEntity<ResponseDto<GroupCipherDTO>> getJoinGroupCipher(@RequestParam("cipher")String cipher) throws BizException;
}
......@@ -272,4 +272,9 @@ public interface BookGroupBiz {
* 根据微信id和机器人id获取分类集合
*/
List<JoinGroupCipherDTO> getClassifyIdsByWxIdAndAltId(String wxId,String altId);
/**
* 获取暗号基本信息
*/
GroupCipherDTO getJoinGroupCipher(String cipher);
}
......@@ -1189,4 +1189,19 @@ public class BookGroupBizImpl implements BookGroupBiz {
return CollectionUtils.isEmpty(list) ? Lists.newArrayList() : list;
}
@ParamLog("获取暗号基本信息")
@Override
public GroupCipherDTO getJoinGroupCipher(String cipher) {
if (StringUtil.isEmpty(cipher)) {
throw new BookBizException(BookBizException.PARAM_IS_ERROR, "参数不能为空!");
}
JoinGroupCipher joinGroupCipher = joinGroupCipherDao.getByCipher(cipher);
if (joinGroupCipher != null) {
GroupCipherDTO groupCipherDTO = new GroupCipherDTO();
BeanUtils.copyProperties(joinGroupCipher, groupCipherDTO);
return groupCipherDTO;
}
return null;
}
}
......@@ -3,6 +3,7 @@ package com.pcloud.book.group.service.impl;
import java.util.List;
import java.util.Map;
import com.pcloud.book.group.dto.GroupCipherDTO;
import com.pcloud.book.group.dto.GroupUseDTO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -83,4 +84,11 @@ public class BookGroupServiceImpl implements BookGroupService {
return ResponseHandleUtil.toResponse(bookGroupBiz.getGroupUse(altIds));
}
@ApiOperation("获取暗号基本信息")
@GetMapping("/getJoinGroupCipher")
@Override
public ResponseEntity<ResponseDto<GroupCipherDTO>> getJoinGroupCipher(@RequestParam("cipher")String cipher) throws BizException {
return ResponseHandleUtil.toResponse(bookGroupBiz.getJoinGroupCipher(cipher));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment