upload auth
This commit is contained in:
@@ -47,24 +47,6 @@ public class KioskApiController {
|
|||||||
return R.data(url);
|
return R.data(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传文件
|
|
||||||
*
|
|
||||||
* @param code code
|
|
||||||
* @param file file
|
|
||||||
* @return Boolean
|
|
||||||
*/
|
|
||||||
@SneakyThrows
|
|
||||||
@PostMapping("/upload")
|
|
||||||
public R<Boolean> upload(@RequestParam @NotBlank(message = "Invalid code") String code,
|
|
||||||
@RequestParam @NotBlank(message = "Invalid machine") String machine,
|
|
||||||
@RequestParam @NotBlank(message = "Invalid store") String store,
|
|
||||||
@RequestParam MultipartFile file) {
|
|
||||||
Boolean result = kioskApiService.uploadByCode(code, machine, store, file.getOriginalFilename(), file.getInputStream());
|
|
||||||
return R.data(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 照片列表查询
|
* 照片列表查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package org.springblade.modules.kiosk.controller;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.SneakyThrows;
|
||||||
|
import org.springblade.core.tool.api.R;
|
||||||
|
import org.springblade.modules.kiosk.service.IKioskApiService;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@AllArgsConstructor
|
||||||
|
@RequestMapping("kiosk-upload")
|
||||||
|
@Validated
|
||||||
|
public class UploadController {
|
||||||
|
|
||||||
|
private final IKioskApiService kioskApiService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*
|
||||||
|
* @param code code
|
||||||
|
* @param file file
|
||||||
|
* @return Boolean
|
||||||
|
*/
|
||||||
|
@SneakyThrows
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public R<Boolean> upload(@RequestParam @NotBlank(message = "Invalid code") String code,
|
||||||
|
@RequestParam @NotBlank(message = "Invalid machine") String machine,
|
||||||
|
@RequestParam @NotBlank(message = "Invalid store") String store,
|
||||||
|
@RequestParam MultipartFile file) {
|
||||||
|
Boolean result = kioskApiService.uploadByCode(code, machine, store, file.getOriginalFilename(), file.getInputStream());
|
||||||
|
return R.data(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -214,8 +214,7 @@ blade:
|
|||||||
strict-header: true
|
strict-header: true
|
||||||
#接口放行
|
#接口放行
|
||||||
skip-url:
|
skip-url:
|
||||||
- /blade-test/**
|
- /kiosk-upload/upload
|
||||||
- /kiosk/upload
|
|
||||||
#授权认证配置
|
#授权认证配置
|
||||||
auth:
|
auth:
|
||||||
- method: ALL
|
- method: ALL
|
||||||
|
|||||||
Reference in New Issue
Block a user