Skip to content

Commit

Permalink
添加了修改底部最后更新时间功能
Browse files Browse the repository at this point in the history
  • Loading branch information
TreasureJade committed Dec 28, 2019
1 parent be7d642 commit d816230
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.swpu.uchain.blog.accessctro.RoleControl;
import com.swpu.uchain.blog.enums.RoleEnum;
import com.swpu.uchain.blog.redis.RedisService;
import com.swpu.uchain.blog.redis.key.UpdateTimeKey;
import com.swpu.uchain.blog.service.VisitorService;
import com.swpu.uchain.blog.util.ResultVOUtil;
import io.swagger.annotations.Api;
Expand All @@ -23,6 +25,9 @@ public class IndexController {
@Autowired
private VisitorService visitorService;

@Autowired
private RedisService redisService;

@ApiOperation("获取首页底部信息")
@PostMapping("/getMsg")
public Object getMsg() {
Expand All @@ -33,6 +38,7 @@ public Object getMsg() {
@ApiOperation("/更新底部网站更新时间")
@PostMapping("/updateTime")
public Object updateTime(String date) {
redisService.set(UpdateTimeKey.timeKey, "updateTime", date);
return ResultVOUtil.success(date);
}

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/swpu/uchain/blog/redis/key/UpdateTimeKey.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.swpu.uchain.blog.redis.key;

/**
* @author hobo
* @description
*/
public class UpdateTimeKey extends BasePrefix{
public UpdateTimeKey(String prefix) {
super(prefix);
}

public static UpdateTimeKey timeKey = new UpdateTimeKey("updateTime");
}

0 comments on commit d816230

Please sign in to comment.