完成回复接口
parent
dae61186f5
commit
25113aba37
@ -0,0 +1,42 @@
|
||||
package com.example.venue_reservation_service.controller;
|
||||
|
||||
|
||||
import com.example.venue_reservation_service.dto.QuestionDTO;
|
||||
import com.example.venue_reservation_service.dto.QuestionQueryDTO;
|
||||
import com.example.venue_reservation_service.service.QuestionService;
|
||||
import com.example.venue_reservation_service.vo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/question")
|
||||
@Api("提问管理")
|
||||
@CrossOrigin
|
||||
public class QuestionController {
|
||||
|
||||
@Resource
|
||||
private QuestionService questionService;
|
||||
|
||||
|
||||
@ApiOperation("添加提问")
|
||||
@PostMapping("/create")
|
||||
public Result create(@RequestBody QuestionDTO dto) {
|
||||
return questionService.create(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("用户分页查询提问")
|
||||
@PostMapping("/user/page")
|
||||
public Result userPage(@RequestBody QuestionQueryDTO dto) {
|
||||
return questionService.userPage(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("管理员分页查询提问")
|
||||
@PostMapping("/admin/page")
|
||||
public Result adminPage(@RequestBody QuestionQueryDTO dto) {
|
||||
return questionService.adminPage(dto);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.example.venue_reservation_service.controller;
|
||||
|
||||
|
||||
import com.example.venue_reservation_service.domain.Reply;
|
||||
import com.example.venue_reservation_service.dto.ReplyDTO;
|
||||
import com.example.venue_reservation_service.service.ReplyService;
|
||||
import com.example.venue_reservation_service.vo.Result;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 回复记录表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2025-06-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/reply")
|
||||
@Api("回复管理")
|
||||
@CrossOrigin
|
||||
public class ReplyController {
|
||||
|
||||
@Autowired
|
||||
private ReplyService replyService;
|
||||
|
||||
@ApiOperation("添加回复")
|
||||
@PostMapping("/create")
|
||||
public Result createReply(@RequestBody ReplyDTO dto) {
|
||||
return replyService.createReply(dto);
|
||||
}
|
||||
|
||||
@ApiOperation("修改回复")
|
||||
@PostMapping("/update")
|
||||
public Result updateReply(@RequestBody ReplyDTO dto) {
|
||||
return replyService.updateReply(dto);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.example.venue_reservation_service.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ReplyDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 管理员编号
|
||||
*/
|
||||
private Integer adminId;
|
||||
|
||||
/**
|
||||
* 回复内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 答疑记录编号
|
||||
*/
|
||||
private Integer questionId;
|
||||
|
||||
}
|
Loading…
Reference in New Issue