|
|
|
@ -4,15 +4,15 @@ import com.gszc.build.Result;
|
|
|
|
|
import com.gszc.build.ResultBuilder;
|
|
|
|
|
import com.gszc.service.CountService;
|
|
|
|
|
import com.gszc.util.OssUtil;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.*;
|
|
|
|
|
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 java.io.IOException;
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
|
|
|
|
|
@Api(value = "工商注册 API", tags = {"上传图片api"})
|
|
|
|
@ -23,18 +23,22 @@ public class UploadController {
|
|
|
|
|
@Autowired
|
|
|
|
|
OssUtil ossUtil;
|
|
|
|
|
|
|
|
|
|
@PostMapping("/VATCount")
|
|
|
|
|
@ApiOperation(value = "增值税计算器", notes = "增值税计算器")
|
|
|
|
|
@PostMapping("/image")
|
|
|
|
|
@ApiOperation(value = "上传图片", notes = "上传图片")
|
|
|
|
|
@ApiImplicitParams({
|
|
|
|
|
@ApiImplicitParam(name = "companyType", value = "公司类型(1-有限公司 2-个独、合伙企业)", dataType = "string", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "invoiceType", value = "开票类型(1-普通发票 2-专用发票)", dataType = "string", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "specialInvoiceType", value = "专票类型(1-服务业 2-商业),不是专票不用填写", dataType = "string", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "money", value = "开票金额", dataType = "string", paramType = "query"),
|
|
|
|
|
@ApiImplicitParam(name = "token", value = "token", required = true, dataType = "String", paramType = "header"),
|
|
|
|
|
})
|
|
|
|
|
public Result VATCount(String imageName,String invoiceType,String specialInvoiceType,double money) {
|
|
|
|
|
|
|
|
|
|
// ossUtil.putObjectForImage();
|
|
|
|
|
return ResultBuilder.withPayload("").build();
|
|
|
|
|
public Result uploadImage(@ApiParam(name = "file", value = "文件") MultipartFile file) {
|
|
|
|
|
|
|
|
|
|
InputStream inputStream = null;
|
|
|
|
|
try {
|
|
|
|
|
inputStream = file.getInputStream();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return ResultBuilder.error("图片读取失败").build();
|
|
|
|
|
}
|
|
|
|
|
String url = ossUtil.putObjectForImage(file.getOriginalFilename(),inputStream,true);
|
|
|
|
|
return ResultBuilder.withPayload(url).build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|