|
@@ -0,0 +1,98 @@
|
|
|
+package com.ylx.web.controller.massage;
|
|
|
+
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.ylx.common.core.controller.BaseController;
|
|
|
+import com.ylx.common.core.domain.R;
|
|
|
+import com.ylx.massage.domain.TCommentUser;
|
|
|
+import com.ylx.massage.service.TCommentUserService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiModel;
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.io.Serializable;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 用户评论表(TCommentUser)表控制层
|
|
|
+ *
|
|
|
+ * @author makejava
|
|
|
+ * @since 2024-08-08 10:32:07
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("tCommentUser")
|
|
|
+@Api(tags = {"用户评论表(TCommentUser)表控制层"})
|
|
|
+public class TCommentUserController extends BaseController {
|
|
|
+ /**
|
|
|
+ * 服务对象
|
|
|
+ */
|
|
|
+ @Resource
|
|
|
+ private TCommentUserService tCommentUserService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询所有数据
|
|
|
+ *
|
|
|
+ * @param page 分页对象
|
|
|
+ * @param tCommentUser 查询实体
|
|
|
+ * @return 所有数据
|
|
|
+ */
|
|
|
+ @GetMapping("selectAll")
|
|
|
+ @ApiOperation("分页查询所有数据")
|
|
|
+ public R selectAll(Page<TCommentUser> page, TCommentUser tCommentUser) {
|
|
|
+ return R.ok(this.tCommentUserService.page(page, new QueryWrapper<>(tCommentUser)));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过主键查询单条数据
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ * @return 单条数据
|
|
|
+ */
|
|
|
+ @GetMapping("{id}")
|
|
|
+ @ApiOperation("通过主键查询单条数据")
|
|
|
+ public R selectOne(@PathVariable Serializable id) {
|
|
|
+ return R.ok(this.tCommentUserService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增数据
|
|
|
+ *
|
|
|
+ * @param tCommentUser 实体对象
|
|
|
+ * @return 新增结果
|
|
|
+ */
|
|
|
+ @PostMapping("add")
|
|
|
+ @ApiOperation("新增数据")
|
|
|
+ public R insert(@RequestBody TCommentUser tCommentUser) {
|
|
|
+ return R.ok(this.tCommentUserService.save(tCommentUser));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改数据
|
|
|
+ *
|
|
|
+ * @param tCommentUser 实体对象
|
|
|
+ * @return 修改结果
|
|
|
+ */
|
|
|
+ @PostMapping("update")
|
|
|
+ @ApiOperation("修改数据")
|
|
|
+ public R update(@RequestBody TCommentUser tCommentUser) {
|
|
|
+ return R.ok(this.tCommentUserService.updateById(tCommentUser));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除数据
|
|
|
+ *
|
|
|
+ * @param idList 主键结合
|
|
|
+ * @return 删除结果
|
|
|
+ */
|
|
|
+ @PostMapping("delete")
|
|
|
+ @ApiOperation("删除数据")
|
|
|
+ public R delete(@RequestBody List<String> idList) {
|
|
|
+ return R.ok(this.tCommentUserService.removeByIds(idList));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|