|
|
@@ -6,8 +6,8 @@ import cn.reghao.tnb.common.auth.AuthUser;
|
|
|
import cn.reghao.tnb.common.auth.UserContext;
|
|
|
import cn.reghao.tnb.user.app.model.dto.*;
|
|
|
import cn.reghao.tnb.user.app.service.ContactService;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -18,7 +18,7 @@ import java.util.List;
|
|
|
* @author reghao
|
|
|
* @date 2022-04-16 20:43:30
|
|
|
*/
|
|
|
-@Api(tags = "用户联系人接口")
|
|
|
+@Tag(name = "用户联系人接口")
|
|
|
@RestController
|
|
|
@RequestMapping("/api/user/contact")
|
|
|
public class UserContactController {
|
|
|
@@ -28,7 +28,7 @@ public class UserContactController {
|
|
|
this.contactService = contactService;
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "查找联系人", notes = "N")
|
|
|
+ @Operation(summary = "查找联系人", description = "N")
|
|
|
@GetMapping(value = "/search", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactSearch(@RequestParam("mobile") String mobile) {
|
|
|
SearchContactResult contactDetail = contactService.searchUser(mobile);
|
|
|
@@ -39,7 +39,7 @@ public class UserContactController {
|
|
|
return WebResult.success(contactDetail);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "获取联系人信息", notes = "N")
|
|
|
+ @Operation(summary = "获取联系人信息", description = "N")
|
|
|
@GetMapping(value = "/detail/{userId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactDetail(@PathVariable("userId") Long userId) {
|
|
|
ContactInfoResult contactDetail = contactService.getContactInfoResult(userId);
|
|
|
@@ -50,41 +50,41 @@ public class UserContactController {
|
|
|
return WebResult.success(contactDetail);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "申请添加联系人", notes = "N")
|
|
|
+ @Operation(summary = "申请添加联系人", description = "N")
|
|
|
@PostMapping(value = "/apply/create", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactApplyCreate(@RequestBody ContactAdd contactAdd) {
|
|
|
Result result = contactService.createApply(contactAdd);
|
|
|
return WebResult.result(result);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "获取联系人申请列表", notes = "N")
|
|
|
+ @Operation(summary = "获取联系人申请列表", description = "N")
|
|
|
@GetMapping(value = "/apply/records", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactApplyRecords(@RequestParam("pageNumber") int pageNumber) {
|
|
|
ContactApplyList pageList = contactService.getApplyList(pageNumber);
|
|
|
return WebResult.success(pageList);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "获取联系人申请未读消息数目", notes = "N")
|
|
|
+ @Operation(summary = "获取联系人申请未读消息数目", description = "N")
|
|
|
@GetMapping(value = "/apply/unread", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactApplyUnreadNum() {
|
|
|
UnreadNum unreadNum = contactService.getApplyCount();
|
|
|
return WebResult.success(unreadNum);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "回复消息", notes = "N")
|
|
|
+ @Operation(summary = "回复消息", description = "N")
|
|
|
@PostMapping(value = "/reply", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactReply(@RequestBody ContactReply contactReply) {
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "接受联系人申请", notes = "N")
|
|
|
+ @Operation(summary = "接受联系人申请", description = "N")
|
|
|
@PostMapping(value = "/apply/accept", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactApplyAccept(@RequestBody ContactAddRespond contactAddRespond) {
|
|
|
contactService.acceptApply(contactAddRespond);
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "拒绝联系人申请", notes = "N")
|
|
|
+ @Operation(summary = "拒绝联系人申请", description = "N")
|
|
|
@PostMapping(value = "/apply/decline", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactApplyDecline(@RequestBody ContactAddRespond contactAddRespond) {
|
|
|
contactService.declineApply(contactAddRespond);
|
|
|
@@ -92,7 +92,7 @@ public class UserContactController {
|
|
|
}
|
|
|
|
|
|
@AuthUser
|
|
|
- @ApiOperation(value = "获取联系人列表", notes = "N")
|
|
|
+ @Operation(summary = "获取联系人列表", description = "N")
|
|
|
@GetMapping(value = "/list", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactList() {
|
|
|
long loginUser = UserContext.getUser();
|
|
|
@@ -100,20 +100,20 @@ public class UserContactController {
|
|
|
return WebResult.success(list);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "设置联系人备注", notes = "N")
|
|
|
+ @Operation(summary = "设置联系人备注", description = "N")
|
|
|
@PostMapping(value = "/remark", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactEditRemark(@RequestBody @Validated ContactRemark contactRemark) {
|
|
|
contactService.updateContactRemark(contactRemark);
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "拉黑联系人", notes = "N")
|
|
|
+ @Operation(summary = "拉黑联系人", description = "N")
|
|
|
@PostMapping(value = "/block", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactBlock(@RequestParam("friend_id") int friendId) {
|
|
|
return WebResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "删除联系人", notes = "N")
|
|
|
+ @Operation(summary = "删除联系人", description = "N")
|
|
|
@PostMapping(value = "/delete", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String contactDelete(@RequestParam("friend_id") int friendId) {
|
|
|
return WebResult.success();
|