From 4a9a9fa60f52be1e7c91f01df54b3cbae8c11d6c Mon Sep 17 00:00:00 2001 From: baizonghao <1719256278@qq.com> Date: 星期日, 23 四月 2023 13:11:21 +0800 Subject: [PATCH] 用户导出 --- src/main/java/com/example/jz/controller/MessageController.java | 65 +++++--------------------------- 1 files changed, 11 insertions(+), 54 deletions(-) diff --git a/src/main/java/com/example/jz/controller/MessageController.java b/src/main/java/com/example/jz/controller/MessageController.java index bd4137e..3c4d5e7 100644 --- a/src/main/java/com/example/jz/controller/MessageController.java +++ b/src/main/java/com/example/jz/controller/MessageController.java @@ -1,13 +1,17 @@ package com.example.jz.controller; - import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.api.ApiController; -import com.baomidou.mybatisplus.extension.api.R; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.example.jz.modle.R; import com.example.jz.modle.entity.Message; +import com.example.jz.modle.vo.GroupMessageVo; import com.example.jz.service.MessageService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -22,6 +26,7 @@ */ @RestController @RequestMapping("message") +@Api(tags = "缇ょ粍娑堟伅") public class MessageController extends ApiController { /** * 鏈嶅姟瀵硅薄 @@ -29,59 +34,11 @@ @Resource private MessageService messageService; - /** - * 鍒嗛〉鏌ヨ鎵�鏈夋暟鎹� - * - * @param page 鍒嗛〉瀵硅薄 - * @param message 鏌ヨ瀹炰綋 - * @return 鎵�鏈夋暟鎹� - */ - @GetMapping - public R selectAll(Page<Message> page, Message message) { - return success(this.messageService.page(page, new QueryWrapper<>(message))); + @GetMapping("deleteById") + public R deleteById(@RequestParam Integer id){ + boolean b = messageService.removeById(id); + return R.ok("鍒犻櫎鎴愬姛"); } - /** - * 閫氳繃涓婚敭鏌ヨ鍗曟潯鏁版嵁 - * - * @param id 涓婚敭 - * @return 鍗曟潯鏁版嵁 - */ - @GetMapping("{id}") - public R selectOne(@PathVariable Serializable id) { - return success(this.messageService.getById(id)); - } - /** - * 鏂板鏁版嵁 - * - * @param message 瀹炰綋瀵硅薄 - * @return 鏂板缁撴灉 - */ - @PostMapping - public R insert(@RequestBody Message message) { - return success(this.messageService.save(message)); - } - - /** - * 淇敼鏁版嵁 - * - * @param message 瀹炰綋瀵硅薄 - * @return 淇敼缁撴灉 - */ - @PutMapping - public R update(@RequestBody Message message) { - return success(this.messageService.updateById(message)); - } - - /** - * 鍒犻櫎鏁版嵁 - * - * @param idList 涓婚敭缁撳悎 - * @return 鍒犻櫎缁撴灉 - */ - @DeleteMapping - public R delete(@RequestParam("idList") List<Long> idList) { - return success(this.messageService.removeByIds(idList)); - } } -- Gitblit v1.8.0