大屏页面初始化
This commit is contained in:
@@ -39,7 +39,7 @@ public class desktopController {
|
||||
public Result<?> getNoteList() {
|
||||
LambdaQueryWrapper<Notes> query = new LambdaQueryWrapper<Notes>()
|
||||
.notIn(Notes::getUstatus, "done")
|
||||
.orderByDesc(Notes::getCreateUser);
|
||||
.orderByDesc(Notes::getCreateTime);
|
||||
return Result.success(notesService.list(query));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,18 @@
|
||||
package com.mini.mybigscreen.biz.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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;
|
||||
import com.mini.mybigscreen.biz.domain.Notes;
|
||||
import com.mini.mybigscreen.biz.service.NotesService;
|
||||
import com.mini.mybigscreen.utils.PageUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -15,4 +26,38 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/biz/notes")
|
||||
public class NotesController {
|
||||
|
||||
|
||||
@Resource
|
||||
private NotesService notesService;
|
||||
|
||||
|
||||
@GetMapping("list")
|
||||
public Result<?> getList(Integer pageNum, Integer pageSize,
|
||||
String title, String priority, String ustatus, String type) {
|
||||
LambdaQueryWrapper<Notes> query = new LambdaQueryWrapper<Notes>()
|
||||
.like(StrUtil.isNotBlank(title), Notes::getTitle, title)
|
||||
.eq(StrUtil.isNotBlank(priority), Notes::getPriority, priority)
|
||||
.eq(StrUtil.isNotBlank(ustatus), Notes::getUstatus, ustatus)
|
||||
.eq(StrUtil.isNotBlank(type), Notes::getType, type)
|
||||
.orderByDesc(Notes::getCreateTime);
|
||||
List<Notes> list = notesService.list(query);
|
||||
PageUtil<?> util = new PageUtil<>(pageNum, pageSize, list);
|
||||
PageResult<?> result = new PageResult<>(util.OkData(), pageNum, pageSize, list.size());
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@PostMapping("save")
|
||||
public Result<Message> save(@RequestBody Notes notes) {
|
||||
boolean success = notes.getIsEdit()
|
||||
? notesService.update(notes,
|
||||
new LambdaUpdateWrapper<Notes>().eq(Notes::getId, notes.getId())
|
||||
) : notesService.save(notes);
|
||||
return Result.success(new Message(notes.getIsEdit() ? "数据修改成功" : "数据新增成功", 200));
|
||||
}
|
||||
|
||||
@PostMapping("delete")
|
||||
public Result<Message> delete(String id) {
|
||||
notesService.removeById(id);
|
||||
return Result.success(new Message("数据删除成功", 200));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
@@ -22,6 +24,7 @@ import lombok.Setter;
|
||||
@TableName("biz_home_module")
|
||||
public class HomeModule implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField("create_time")
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -24,6 +26,7 @@ import lombok.Setter;
|
||||
@TableName("biz_home_user")
|
||||
public class HomeUser extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.mini.mybigscreen.Model.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -20,8 +24,9 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("biz_notes")
|
||||
public class Notes implements Serializable {
|
||||
public class Notes extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.mini.mybigscreen.Model.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -20,8 +24,9 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("biz_quick_login")
|
||||
public class QuickLogin implements Serializable {
|
||||
public class QuickLogin extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.mini.mybigscreen.Model.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@@ -20,8 +24,9 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("biz_warning_alert")
|
||||
public class WarningAlert implements Serializable {
|
||||
public class WarningAlert extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user