admin
2020-08-22 813d2cae75cbae3f216de5f493af643c5a560c82
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.yeshi.buwan.controller.api;
 
import java.io.PrintWriter;
 
import javax.servlet.http.HttpServletRequest;
 
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
 
import com.yeshi.buwan.util.OSSManager;
 
@Controller
@RequestMapping("/upload/img")
public class ImageController {
    @RequestMapping(value = "/{path}", method = RequestMethod.GET)
    public String ad(@PathVariable String path, HttpServletRequest request, PrintWriter out) {
        return "redirect:" + OSSManager.getInstance().getUrl(path + ".jpg");
    }
}