網站首頁 編程語言 正文
服務方
@ApiOperation(value = "G992207:通過表格導入用戶", nickname = "G992207")
@PostMapping("/api/file/members/users")
public ResponseEntity<UserImportResponse> parseTheExcelImportUsers(@RequestParam(value = "tenantCode") String tenantCode,
@RequestParam(value = "file") MultipartFile file) throws Exception {
log.info("REST request to parseTheExcelImportUsers : {}", tenantCode);
UserImportResponse userImportResponse = tenantMembersService.parseTheExcelImportUsers(tenantCode, file);
return ResponseEntity.ok().body(userImportResponse);
}
Feign接口
@ApiOperation(value = "G992207:通過表格導入用戶", nickname = "G992207")
@PostMapping(value = "/api/file/members/users", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
UserImportResponse parseTheExcelImportUsers(@RequestParam(value = "tenantCode") String tenantCode,
@RequestPart(value = "file") MultipartFile file) throws Exception;
注意
- Feign的參數注解必須改為@RequestPart
- 路徑后一定要指定Content-Type為multipart/form-data
調用方
@ApiOperation(value = "API110105:表格批量導入員工", nickname = "API110105")
@PostMapping("/api/file/users")
public ResponseEntity<UserImportResponse> parseExcelImportUsers(@RequestHeader(Constants.X_TENANT) String tenantCode,
@RequestParam(value = "file") MultipartFile file) throws Exception {
log.info("REST request to parseTheExcelImportUsers tenantCode : {}", tenantCode);
UserImportResponse userImportResponse = userService.parseExcelImportUsers(tenantCode, file);
return ResponseEntity.ok().body(userImportResponse);
}
原文鏈接:https://blog.csdn.net/weixin_49194846/article/details/124308737
相關推薦
- 2021-12-02 Golang共享變量如何解決問題_Golang
- 2022-06-10 Python語法學習之進程的創建與常用方法詳解_python
- 2023-04-27 python請求域名requests.(url?=?地址)報錯_python
- 2022-10-09 .NET擴展方法使用實例詳解_實用技巧
- 2022-05-12 Android textAppearance 使用
- 2022-07-02 Python遠程SSH庫Paramiko詳細操作_python
- 2022-09-23 WPF仿微信實現截圖功能的方法詳解_C#教程
- 2022-03-07 axios和ajax的區別點總結_AJAX相關
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支