大屏项目初始化
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.mini.mybigscreen.Model.Message;
|
||||
import com.mini.mybigscreen.Model.PageResult;
|
||||
import com.mini.mybigscreen.Model.Result;
|
||||
@@ -9,9 +10,8 @@ import com.mini.mybigscreen.biz.domain.HomeUser;
|
||||
import com.mini.mybigscreen.biz.service.HomeUserService;
|
||||
import com.mini.mybigscreen.utils.PageUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -47,17 +47,18 @@ public class HomeUserController {
|
||||
}
|
||||
|
||||
|
||||
public Result<Message> save() {
|
||||
return Result.success(new Message("数据新增成功", "200"));
|
||||
@PostMapping("save")
|
||||
public Result<Message> save(@RequestBody HomeUser homeUser) {
|
||||
boolean success = homeUser.getIsEdit()
|
||||
? userService.update(homeUser,
|
||||
new LambdaUpdateWrapper<HomeUser>().eq(HomeUser::getUserId, homeUser.getUserId())
|
||||
) : userService.save(homeUser);
|
||||
return Result.success(new Message(homeUser.getIsEdit() ? "数据修改成功" : "数据新增成功", "200"));
|
||||
}
|
||||
|
||||
|
||||
public Result<Message> update() {
|
||||
return Result.success(new Message("数据更新成功", "200"));
|
||||
}
|
||||
|
||||
|
||||
public Result<Message> delete() {
|
||||
@PostMapping("delete")
|
||||
public Result<Message> delete(String userId) {
|
||||
userService.removeById(userId);
|
||||
return Result.success(new Message("数据删除成功", "200"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user