package com.tanpu.community.controller; import com.tanpu.common.api.CommonResp; import com.tanpu.community.api.constants.RedisKeyConstant; import com.tanpu.community.service.RedisService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @RequestMapping(value = "/metric") public class MetricsController { @Autowired private RedisService redisService; @ApiOperation("浏览量埋点") @RequestMapping("/pv") public CommonResp pageView(@RequestParam String themeId){ redisService.incr(RedisKeyConstant.THEME_VIEW_COUNT_ +themeId, 1L); return CommonResp.success(); } }