Feature #5 申请友链时自动抓取网页信息 #6
@@ -56,10 +56,17 @@ public interface PartnerSiteService {
|
||||
|
||||
/**
|
||||
* 申请友链
|
||||
*
|
||||
* @param linkApplyReq linkApplyReq
|
||||
* @return linkApplyReq
|
||||
*/
|
||||
PartnerSite apply(LinkApplyReq linkApplyReq);
|
||||
|
||||
Object reapply(String key);
|
||||
/**
|
||||
* 重写申请友链
|
||||
*
|
||||
* @param key key
|
||||
* @return msg
|
||||
*/
|
||||
String reapply(String key);
|
||||
}
|
||||
|
||||
@@ -176,6 +176,8 @@ public class PartnerSiteServiceImpl implements PartnerSiteService {
|
||||
boolean exists = partnerMapper.existsByUrl(linkApplyReq.getUrl());
|
||||
if (!exists) {
|
||||
partnerMapper.insert(ps);
|
||||
} else {
|
||||
ps.setId(partnerMapper.findByUrl(linkApplyReq.getUrl()).getId());
|
||||
}
|
||||
SimpleMailMessage smm = new SimpleMailMessage();
|
||||
smm.setSubject("友链申请");
|
||||
@@ -204,7 +206,7 @@ public class PartnerSiteServiceImpl implements PartnerSiteService {
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public Object reapply(String key) {
|
||||
public String reapply(String key) {
|
||||
if (!redisUtil.hasKey(key)) {
|
||||
throw new MyException(ResponseEnum.DATA_EXPIRED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user