package com.tanpu.community.controller; 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 void pageView(@RequestParam String themeId){ redisService.incr("pv"+themeId, 1L); } }