|
|
|
@ -4,11 +4,11 @@ import api.Result;
|
|
|
|
|
import com.luoo.comment.service.VisitCountService;
|
|
|
|
|
import controller.BaseController;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
@ -26,10 +26,13 @@ public class VisitCountController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private VisitCountService visitCountService;
|
|
|
|
|
|
|
|
|
|
@GetMapping("/count/o2o")
|
|
|
|
|
public Result<Void> addNewVisit(HttpServletRequest req){
|
|
|
|
|
@GetMapping("/count/{type}")
|
|
|
|
|
@ApiImplicitParams(value = {
|
|
|
|
|
@ApiImplicitParam(name = "type", value = "web/o2o", required = true)
|
|
|
|
|
})
|
|
|
|
|
public Result<Void> addNewVisit(HttpServletRequest req, @PathVariable String type){
|
|
|
|
|
String ipAddr = getIpAddr(req);
|
|
|
|
|
visitCountService.addNewVisit(ipAddr);
|
|
|
|
|
visitCountService.addNewVisit(ipAddr, type);
|
|
|
|
|
return Result.success();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|