init
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.xq.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.domain.Feedback;
|
||||
import com.ruoyi.xq.service.FeedbackService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 留言举报
|
||||
*
|
||||
* @author 77
|
||||
* @date 2024-04-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xq/feedback")
|
||||
public class FeedbackController extends BaseController {
|
||||
|
||||
private final FeedbackService feedbackService;
|
||||
|
||||
/**
|
||||
* 查询留言举报列表
|
||||
*/
|
||||
@SaCheckPermission("xq:feedback:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<Feedback> list(Feedback bo, PageQuery pageQuery) {
|
||||
Page<Feedback> page = feedbackService.page(pageQuery.build(), Wrappers.lambdaQuery(bo));
|
||||
return TableDataInfo.build(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取留言举报详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xq:feedback:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<Feedback> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(feedbackService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改留言举报
|
||||
*/
|
||||
@SaCheckPermission("xq:feedback:edit")
|
||||
@Log(title = "留言举报", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody Feedback bo) {
|
||||
return toAjax(feedbackService.updateById(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除留言举报
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xq:feedback:remove")
|
||||
@Log(title = "留言举报", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(feedbackService.removeBatchByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.ruoyi.xq.controller.app;
|
||||
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.xq.dto.app.other.FeedbackReq;
|
||||
import com.ruoyi.xq.dto.app.report.ReportPushReq;
|
||||
import com.ruoyi.xq.service.FeedbackService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/other")
|
||||
@Tag(name = "其他接口")
|
||||
@Slf4j
|
||||
public class OtherController {
|
||||
|
||||
@Autowired
|
||||
private FeedbackService feedbackService;
|
||||
|
||||
@PostMapping("/feedback")
|
||||
@Operation(summary = "留言反馈")
|
||||
@Log(title = "留言反馈", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||
public R<Void> feedback(@RequestBody FeedbackReq req){
|
||||
feedbackService.feedback(req);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user