mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
feat: 增加用户反馈删除接口
This commit is contained in:
parent
ee449134d0
commit
a3a6d3f326
@ -55,11 +55,19 @@ public class UserController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户反馈
|
||||
* 用户反馈提交接口
|
||||
*/
|
||||
@PostMapping("feedBack")
|
||||
public RestResp<Void> submitFeedBack(@RequestBody String content) {
|
||||
return userService.saveFeedBack(UserHolder.getUserId(), content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户反馈删除接口
|
||||
* */
|
||||
@DeleteMapping("feedBack/{id}")
|
||||
public RestResp<Void> deleteFeedBack(@PathVariable Long id) {
|
||||
return userService.deleteFeedBack(UserHolder.getUserId(), id);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,19 @@ public class DatabaseConsts {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户反馈表
|
||||
*/
|
||||
public static class UserFeedBackTable {
|
||||
|
||||
private UserFeedBackTable() {
|
||||
throw new IllegalStateException(SystemConfigConsts.CONST_INSTANCE_EXCEPTION_MSG);
|
||||
}
|
||||
|
||||
public static final String COLUMN_USER_ID = "user_id";
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 作家信息表
|
||||
*/
|
||||
|
@ -42,4 +42,12 @@ public interface UserService {
|
||||
* @return void
|
||||
* */
|
||||
RestResp<Void> updateUserInfo(UserInfoUptReqDto dto);
|
||||
|
||||
/**
|
||||
* 用户反馈删除
|
||||
* @param userId 用户ID
|
||||
* @param id 反馈ID
|
||||
* @return void
|
||||
* */
|
||||
RestResp<Void> deleteFeedBack(Long userId, Long id);
|
||||
}
|
||||
|
@ -123,4 +123,13 @@ public class UserServiceImpl implements UserService {
|
||||
userInfoMapper.updateById(userInfo);
|
||||
return RestResp.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RestResp<Void> deleteFeedBack(Long userId, Long id) {
|
||||
QueryWrapper<UserFeedback> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq(DatabaseConsts.CommonColumnEnum.ID.getName(), id)
|
||||
.eq(DatabaseConsts.UserFeedBackTable.COLUMN_USER_ID,userId);
|
||||
userFeedbackMapper.delete(queryWrapper);
|
||||
return RestResp.ok();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user