Files
love-nav/src/main/java/com/lovenav/controller/UrlAccessController.java

33 lines
928 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.lovenav.controller;
import com.lovenav.entity.UrlAccess;
import com.lovenav.service.UrlAccessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.HashMap;
@RestController
public class UrlAccessController {
@Autowired
UrlAccessService urlAccessService;
//浏览url访问量加1
@RequestMapping("/addUrlAccessViews")
public String addUrlAccessViews(UrlAccess urlAccess){
String result=urlAccessService.inreaseUrlViews(urlAccess);
return result;
}
@RequestMapping("/getUrlAccess")
public HashMap<Date,Object> getUrlAccess(UrlAccess urlAccess){
HashMap<Date,Object> map=new HashMap<>();
map=urlAccessService.getUrlAccess(urlAccess);
return map;
}
}