From e43b6be4d240d77b1ddcdff613e658fafb7ad7ba Mon Sep 17 00:00:00 2001 From: chen-xin-zhi <3588068430@qq.com> Date: Mon, 4 Nov 2024 14:07:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../heritage/controller/address/AddressController.java | 3 ++- .../heritage/controller/address/ContactsController.java | 8 +++++--- .../cultural/heritage/controller/file/FileController.java | 3 +++ .../heritage/controller/good/CartRecordController.java | 5 +++-- .../cultural/heritage/controller/user/UserController.java | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/cultural/heritage/controller/address/AddressController.java b/src/main/java/com/cultural/heritage/controller/address/AddressController.java index c6acb51..3e7dbc9 100644 --- a/src/main/java/com/cultural/heritage/controller/address/AddressController.java +++ b/src/main/java/com/cultural/heritage/controller/address/AddressController.java @@ -80,7 +80,7 @@ public class AddressController { * @return 是否更新成功 */ @PostMapping("/update") -// @Operation(summary = "小程序端用户更新地址信息", ) + @Operation(summary = "小程序端用户更新地址信息", description = "参数:地址更新请求体,权限:所有人,方法名:updateAddress") public BaseResponse updateAddress(@RequestBody AddressUpdateRequest addressUpdateRequest) { if (addressUpdateRequest == null || addressUpdateRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); @@ -102,6 +102,7 @@ public class AddressController { * @return 用户地址列表 */ @PostMapping("/list") + @Operation(summary = "小程序端查询用户地址信息", description = "参数:地址查询请求体,权限:所有人,方法名:listAddress") public BaseResponse> listAddress(@RequestBody CommonRequest addressQueryRequest) { if (addressQueryRequest == null || addressQueryRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); diff --git a/src/main/java/com/cultural/heritage/controller/address/ContactsController.java b/src/main/java/com/cultural/heritage/controller/address/ContactsController.java index 55ffccb..b1d8921 100644 --- a/src/main/java/com/cultural/heritage/controller/address/ContactsController.java +++ b/src/main/java/com/cultural/heritage/controller/address/ContactsController.java @@ -1,6 +1,5 @@ package com.cultural.heritage.controller.address; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.cultural.heritage.common.BaseResponse; import com.cultural.heritage.common.ErrorCode; import com.cultural.heritage.common.ResultUtils; @@ -11,9 +10,8 @@ import com.cultural.heritage.model.dto.contacts.ContactsAddRequest; import com.cultural.heritage.model.dto.contacts.ContactsUpdateRequest; import com.cultural.heritage.model.entity.Contacts; import com.cultural.heritage.service.address.ContactsService; -import com.obs.services.internal.utils.RestUtils; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.models.info.Contact; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -41,6 +39,7 @@ public class ContactsController { * @return 是否添加成功 */ @PostMapping("/add") + @Operation(summary = "小程序端用户添加联系人信息", description = "参数:联系人添加请求体,权限:所有人,方法名:addContacts") public BaseResponse addContacts(@RequestBody ContactsAddRequest contactsAddRequest) { if (contactsAddRequest == null) { throw new BusinessException(ErrorCode.PARAMS_ERROR); @@ -61,6 +60,7 @@ public class ContactsController { * @return 是否更新成功 */ @PostMapping("/update") + @Operation(summary = "小程序端用户更新联系人信息", description = "参数:联系人更新请求体,权限:所有人,方法名:updateContacts") public BaseResponse updateContacts(@RequestBody ContactsUpdateRequest contactsUpdateRequest) { if (contactsUpdateRequest == null || contactsUpdateRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); @@ -82,6 +82,7 @@ public class ContactsController { * @return 是否删除成功 */ @PostMapping("/delete") + @Operation(summary = "小程序端用户删除联系人信息", description = "参数:联系人删除请求体,权限:所有人,方法名:deleteContacts") public BaseResponse deleteContacts(@RequestBody CommonRequest contactsDeleteRequest) { if (contactsDeleteRequest == null || contactsDeleteRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); @@ -100,6 +101,7 @@ public class ContactsController { * @return 用户联系人列表 */ @PostMapping("/list") + @Operation(summary = "小程序端用户查询联系人信息", description = "参数:联系人查询请求体,权限:所有人,方法名:listUserContacts") public BaseResponse> listUserContacts(@RequestBody CommonRequest contactsQueryRequest) { if (contactsQueryRequest == null || contactsQueryRequest.getId() <= 0) { throw new BusinessException(ErrorCode.PARAMS_ERROR); diff --git a/src/main/java/com/cultural/heritage/controller/file/FileController.java b/src/main/java/com/cultural/heritage/controller/file/FileController.java index c8439df..a63c701 100644 --- a/src/main/java/com/cultural/heritage/controller/file/FileController.java +++ b/src/main/java/com/cultural/heritage/controller/file/FileController.java @@ -11,6 +11,7 @@ import com.cultural.heritage.model.entity.User; import com.cultural.heritage.model.enums.FileUploadBizEnum; import com.cultural.heritage.service.file.IHweiYunOBSService; import com.cultural.heritage.service.user.UserService; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletRequest; @@ -47,6 +48,7 @@ public class FileController { * @return 图片可访问地址 */ @PostMapping("/upload/server/not_login") + @Operation(summary = "未登录情况下的文件上传", description = "参数:文件对象(multipartFile), 业务类型(biz),权限:所有人,方法名:uploadServerFileNotLogin") private BaseResponse uploadServerFileNotLogin(@RequestPart("file")MultipartFile multipartFile, UploadFileRequest uploadFileRequest) { //获取业务名称 String biz = uploadFileRequest.getBiz(); @@ -77,6 +79,7 @@ public class FileController { @PostMapping("/upload/server") + @Operation(summary = "未登录情况下的文件上传", description = "参数:文件对象(multipartFile), 业务类型(biz),权限:所有人,方法名:uploadServerFile") public BaseResponse uploadServerFile(@RequestPart MultipartFile multipartFile, UploadFileRequest uploadFileRequest, HttpServletRequest request) { //获取业务名称 String biz = uploadFileRequest.getBiz(); diff --git a/src/main/java/com/cultural/heritage/controller/good/CartRecordController.java b/src/main/java/com/cultural/heritage/controller/good/CartRecordController.java index 104deae..809c91c 100644 --- a/src/main/java/com/cultural/heritage/controller/good/CartRecordController.java +++ b/src/main/java/com/cultural/heritage/controller/good/CartRecordController.java @@ -12,7 +12,7 @@ import com.cultural.heritage.model.dto.cart.CartRecordUpdateRequest; import com.cultural.heritage.model.entity.CartRecord; import com.cultural.heritage.model.vo.CartRecordVO; import com.cultural.heritage.service.good.CartRecordService; -import com.cultural.heritage.service.good.GoodService; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; @@ -36,13 +36,13 @@ public class CartRecordController { private CartRecordService cartRecordService; - /** * 用户添加商品至购物车 * @param cartRecordAddRequest 购物车记录添加请求体 * @return 是否添加成功 */ @PostMapping("/add") + @Operation(summary = "小程序端用户添加商品至购物车", description = "参数:购物车记录添加请求体,权限:所有人,方法名:addCartRecord") public BaseResponse addCartRecord(@RequestBody CartRecordAddRequest cartRecordAddRequest) { if (cartRecordAddRequest == null) { throw new BusinessException(ErrorCode.PARAMS_ERROR); @@ -58,6 +58,7 @@ public class CartRecordController { * @return 是否更新成功 */ @PostMapping("/update") + @Operation(summary = "小程序端用户更新商品至购物车", description = "参数:购物车记录更新请求体") public BaseResponse updateCartRecord(@RequestBody List cartRecordUpdateRequestList) { if (CollectionUtils.isEmpty(cartRecordUpdateRequestList)) { throw new BusinessException(ErrorCode.PARAMS_ERROR); diff --git a/src/main/java/com/cultural/heritage/controller/user/UserController.java b/src/main/java/com/cultural/heritage/controller/user/UserController.java index 561f874..39a24b9 100644 --- a/src/main/java/com/cultural/heritage/controller/user/UserController.java +++ b/src/main/java/com/cultural/heritage/controller/user/UserController.java @@ -60,7 +60,7 @@ public class UserController { */ @PostMapping("/login") @Operation(summary = "Web端用户登录", description = "参数:{账号,密码}, 权限:管理员(admin, boss), 方法名:userLogin") - @AuthCheck(mustRole = UserConstant.ADMIN_ROLE) +// @AuthCheck(mustRole = UserConstant.ADMIN_ROLE) public BaseResponse userLogin(@RequestBody UserLoginRequest userLoginRequest, HttpServletRequest request){ if(userLoginRequest == null) { throw new BusinessException(ErrorCode.PARAMS_ERROR);