-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #299 from facming/dev
add share tag
- Loading branch information
Showing
9 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/com/dl/officialsite/member/job/MemberXxlJob.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.dl.officialsite.member.job; | ||
|
||
import com.dl.officialsite.member.MemberService; | ||
import com.xxl.job.core.context.XxlJobHelper; | ||
import com.xxl.job.core.handler.annotation.XxlJob; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* @Description | ||
* @Author xiaoming | ||
* @Date 2024/9/8 12:15 PM | ||
**/ | ||
@Component | ||
@Slf4j | ||
public class MemberXxlJob { | ||
|
||
|
||
@Autowired | ||
private MemberService memberService; | ||
/** | ||
* 更新share_count,一小时触发一次 | ||
*/ | ||
@XxlJob("updateShareCountJobHandler") | ||
public void updateShareCount() { | ||
XxlJobHelper.log("updateShareCount start"); | ||
memberService.updateShareCount(); | ||
XxlJobHelper.log("updateShareCount end"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,9 @@ public class ShareSearchVo { | |
*/ | ||
private String label; | ||
|
||
/** | ||
* tag | ||
*/ | ||
private String tag; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/com/dl/officialsite/sharing/config/ShareTagConfigService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.dl.officialsite.sharing.config; | ||
|
||
import com.dl.officialsite.config.bean.Configurable; | ||
import com.dl.officialsite.config.bean.Refreshable; | ||
import com.dl.officialsite.config.constant.ConfigEnum; | ||
import com.dl.officialsite.config.service.ServerConfigCacheService; | ||
import lombok.Data; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.context.event.ApplicationReadyEvent; | ||
import org.springframework.context.event.EventListener; | ||
import org.springframework.stereotype.Service; | ||
import java.util.List; | ||
|
||
@Service | ||
@Slf4j | ||
public class ShareTagConfigService implements Refreshable { | ||
private ShareTagConfig shareTagConfig; | ||
|
||
@Autowired | ||
private ServerConfigCacheService serverConfigCacheService; | ||
@EventListener(ApplicationReadyEvent.class) | ||
public void startUpOrRefresh() { | ||
shareTagConfig = this.serverConfigCacheService.get(ConfigEnum.ECDSA_PRIVATE_KEY, ShareTagConfig.class); | ||
|
||
log.info("Load share tag config:[{}]", this.shareTagConfig); | ||
} | ||
|
||
} | ||
|
||
@Data | ||
class ShareTagConfig implements Configurable { | ||
private List<ShareTagKey> tagList; | ||
} | ||
|
||
@Data | ||
class ShareTagKey { | ||
private String tag; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/dl/officialsite/sharing/model/resp/ShareTagResp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.dl.officialsite.sharing.model.resp; | ||
|
||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @Description | ||
* @Author xiaoming | ||
* @Date 2024/9/8 11:23 AM | ||
**/ | ||
@Data | ||
public class ShareTagResp { | ||
|
||
private List<String> tagList; | ||
} |