package org.springblade.modules.app.web;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.modules.app.manager.OssManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@Slf4j
@RequestMapping("app/resource")
public class ResourceController {

    @Autowired
    private OssManager ossManager;

    @PostMapping("/uploadpic")
	public R uploadpic(HttpServletRequest request) {
		return R.data(ossManager.upLoadImage(request,"userimg"));
	}


}
