JavaEE 图书管理系统

news2024/9/22 1:31:44

基于阿里巴巴的fastjson框架搭建的JavaEE版本的图书管理系统,项目架构如下:

fastjson包的阿里云下载镜像如下:

Central Repository: com/alibaba/fastjson2/fastjson2/2.0.8 

运行效果:

Bean

Book.java

package Bean;

public class Book {
	private String title;// 书名
	private String author;// 作者名
	private double price;// 价格
	private String type;// 书籍类型
	private boolean borrowed;// 借阅状态,默认为false

	public Book(String title, String author, double price, String type) {
		this.title = title;
		this.author = author;
		this.price = price;
		this.type = type;
		this.borrowed = false;// 默认为false
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isBorrowed() {
		return borrowed;
	}

	public void setBorrowed(boolean borrowed) {
		this.borrowed = borrowed;
	}

	@Override
	public String toString() {
		return "Book{" + "title='" + title + '\'' + ", author='" + author + '\'' + ", price=" + price + ", type='"
				+ type + '\'' + ", borrowed=" + borrowed + '}';
	}
}

 Book.java

package Bean;

public class User {
	private String username;// 用户名
	private String password;// 密码
	private String role;// 角色

	public String getUsername() {
		return username;
	}

	public User(String username, String password, String role) {
		this.username = username;
		this.password = password;
		this.role = role;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}
}

Dao

BookDao

package Dao;

import Bean.Book;
import java.util.List;

public interface BookDao {
	// 读取json文件信息
	List<Book> getAllBooks();

	// 保存图书信息
	void saveBooks(List<Book> books);

	// 添加图书
	void addBook(Book book);

	// 删除图书
	void removeBook(String title);

	// 查找图书
	Book findBook(String title);

	// 更新图书借阅状态
	void updateBookStatus(String title, boolean borrowed);

	// 更新图书信息
	void updateBookDetails(String newTitle, String newAuthor, double newPrice, String newType);
}

UserDao

package Dao;

import Bean.User;
import java.util.List;

public interface UserDao {
	// 读取文件信息
	List<User> getAllUsers();

	// 添加用户
	void addUser(User user);

	// 查找用户
	User findUser(String username);
}

Dao.Impl 

BookDaoImpl.java 

package Dao.Impl;

import Bean.Book;
import Dao.BookDao;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class BookDaoImpl implements BookDao {
	private static final String PATH = "books.txt";

	/**
	 * @author Stringzhua
	 * @exception 将books通过json解析为List集合中的数据
	 */
	@Override
	public List<Book> getAllBooks() {
		StringBuilder jsonString = new StringBuilder();
		try (BufferedReader reader = new BufferedReader(new FileReader(PATH))) {
			String line;
			while ((line = reader.readLine()) != null) {
				jsonString.append(line);
			}
		} catch (IOException e) {
			e.printStackTrace();
			return new ArrayList<>();
		}
		// 从一个json数组字符串中解析出多个jsonObjects,并将存储在一个 List<JSONObject> 中
		List<JSONObject> jsonObjects = JSON.parseArray(jsonString.toString(), JSONObject.class);
		List<Book> books = new ArrayList<>();
		// 遍历list集合
		for (JSONObject jsonObject : jsonObjects) {
			Book book = new Book(jsonObject.getString("title"), jsonObject.getString("author"),
					jsonObject.getDoubleValue("price"), jsonObject.getString("type"));
			book.setBorrowed(jsonObject.getBooleanValue("borrowed"));
			books.add(book);
		}
		return books;
	}

	/**
	 * @author Stringzhua
	 * @exception 保存集合中的所有图书信息到json文件中
	 */
	@Override
	public void saveBooks(List<Book> books) {
		List<JSONObject> jsonObjects = new ArrayList<>();
		for (Book book : books) {
			JSONObject jsonObject = new JSONObject();
			jsonObject.put("title", book.getTitle());
			jsonObject.put("author", book.getAuthor());
			jsonObject.put("price", book.getPrice());
			jsonObject.put("type", book.getType());
			jsonObject.put("borrowed", book.isBorrowed());
			jsonObjects.add(jsonObject);
		}

		try (Writer writer = new FileWriter(PATH)) {
			writer.write(JSON.toJSONString(jsonObjects));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	// 添加图书方法
	@Override
	public void addBook(Book book) {
		List<Book> books = getAllBooks();
		books.add(book);
		saveBooks(books);
	}

	// 删除图书
	@Override
	public void removeBook(String title) {
		List<Book> books = getAllBooks();
		books.removeIf(book -> book.getTitle().equals(title));
		saveBooks(books);
	}

	// 查找图书
	@Override
	public Book findBook(String title) {
		for (Book book : getAllBooks()) {
			if (book.getTitle().equals(title)) {
				return book;
			}
		}
		return null;
//		return getAllBooks().stream().filter(book -> book.getTitle().equals(title)).findFirst().orElse(null);
	}

	// 借书
	@Override
	public void updateBookStatus(String title, boolean borrowed) {
		List<Book> books = getAllBooks();
		for (Book book : books) {
			if (book.getTitle().equals(title)) {
				book.setBorrowed(borrowed);
				break;
			}
		}
		// 借书后保存信息到json文件中
		saveBooks(books);
	}

	// 更新图书
	@Override
	public void updateBookDetails(String title, String newAuthor, double newPrice, String newType) {
		List<Book> books = getAllBooks();
		for (Book book : books) {
			if (book.getTitle().equals(title)) {
				book.setAuthor(newAuthor);
				book.setPrice(newPrice);
				book.setType(newType);
				break;
			}
		}
		// 更新后保存到json文件中
		saveBooks(books);
	}
}

UserDaoImpl.java 

package Dao.Impl;

import Bean.User;
import Dao.UserDao;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class UserDaoImpl implements UserDao {
	private static final String PATH = "users.txt";

	/**
	 * @author Stringzhua
	 * @exception 将txt文件中的数据添加到users集合中
	 */
	@Override
	public List<User> getAllUsers() {
		List<User> users = new ArrayList<>();
		try (BufferedReader reader = new BufferedReader(new FileReader(PATH))) {
			String line;
			while ((line = reader.readLine()) != null) {
				String[] userInfo = line.split(",");
				if (userInfo.length == 3) {
					users.add(new User(userInfo[0], userInfo[1], userInfo[2]));
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return users;
	}

	/**
	 * @author Stringzhua
	 * @exception 将新注册的用户信息写入到books.txt文件中
	 */
	@Override
	public void addUser(User user) {
		try (BufferedWriter writer = new BufferedWriter(new FileWriter(PATH, true))) {
			writer.write(user.getUsername() + "," + user.getPassword() + "," + user.getRole());
			writer.newLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	/**
	 * @author Stringzhua
	 * @exception 根据username去遍历集合中符合条件的user对象,返回该对象
	 */
	@Override
	public User findUser(String username) {
		for (User user : getAllUsers()) {
			if (user.getUsername().equals(username)) {
				return user;
			}
		}
		// 没有找到
		return null;
//		return getAllUsers().stream().filter(user -> user.getUsername().equals(username)).findFirst().orElse(null);
	}
}

Service 

BookService.java

package Service;

import Bean.Book;
import java.util.List;

//TODO:同名的一本书借书的问题
public interface BookService {
	// 读取json文件信息
	List<Book> getAllBooks();

	// 添加图书
	void addBook(Book book);

	// 删除图书
	void removeBook(String title);

	// 查找图书
	Book findBook(String title);

	// 更新图书借阅状态
	void updateBookStatus(String title, boolean borrowed);

	// 更新图书信息
	void updateBookDetails(String title, String newAuthor, double newPrice, String newType);
}

UserService.java 

package Service;

import Bean.User;
import java.util.List;

public interface UserService {
	// 读取文件信息
	List<User> getAllUsers();

	// 添加用户
	void addUser(User user);

	// 查找用户
	User findUser(String username);
}

Service.Impl 

BookServiceImpl.java 

package Service.Impl;

import Bean.Book;
import Dao.BookDao;
import Service.BookService;
import java.util.List;

public class BookServiceImpl implements BookService {
	private BookDao bookDao;

	// 有参构造方法
	public BookServiceImpl(BookDao bookDao) {
		this.bookDao = bookDao;
	}

	// 读取json文件信息
	@Override
	public List<Book> getAllBooks() {
		return bookDao.getAllBooks();
	}

	// 添加图书
	@Override
	public void addBook(Book book) {
		bookDao.addBook(book);
	}

	// 删除图书
	@Override
	public void removeBook(String title) {
		bookDao.removeBook(title);
	}

	// 查找图书
	@Override
	public Book findBook(String title) {
		return bookDao.findBook(title);
	}

	// 更新图书借阅状态
	@Override
	public void updateBookStatus(String title, boolean borrowed) {
		bookDao.updateBookStatus(title, borrowed);
	}

	// 更新图书信息
	@Override
	public void updateBookDetails(String newtitle, String newAuthor, double newPrice, String newType) {
		bookDao.updateBookDetails(newtitle, newAuthor, newPrice, newType);
	}
}

 UserServiceImpl.java

package Service.Impl;

import Bean.User;
import Dao.UserDao;
import Service.UserService;
import java.util.List;

public class UserServiceImpl implements UserService {
	private UserDao userDao;

	// 有参构造方法
	public UserServiceImpl(UserDao userDao) {
		this.userDao = userDao;
	}

	// 读取文件信息
	@Override
	public List<User> getAllUsers() {
		return userDao.getAllUsers();
	}

	// 添加用户
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}

	// 查找用户
	@Override
	public User findUser(String username) {
		return userDao.findUser(username);
	}
}

Utils 

package Utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Message {
	// 展示用户名和当前时间
	public static void WelcomeMessage(String username) {
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String currentTime = formatter.format(new Date());
		System.out.println("欢迎 " + username + "! 当前时间: " + currentTime);
	}
}

View 

View.Impl

AdminMenu.java 

package View.Impl;

import Bean.Book;
import Service.BookService;

import java.util.Scanner;

public class AdminMenu {
	public static void adminMenu(Scanner sc, BookService bookService) {
		while (true) {
			System.out.println("图书管理员系统菜单");
			System.out.println("1. 添加图书");
			System.out.println("2. 删除图书");
			System.out.println("3. 编辑图书");
			System.out.println("4. 查询图书");
			System.out.println("5. 退出图书管理员系统");
			System.out.print("请输入选择: ");
			int choice = sc.nextInt();
			sc.nextLine(); // 换行
			switch (choice) {
			case 1:
				addBook(sc, bookService);
				break;
			case 2:
				removeBook(sc, bookService);
				break;
			case 3:
				editBook(sc, bookService);
				break;
			case 4:
				searchBook(sc, bookService);
				break;
			case 5:
				return;
			default:
				System.out.println("无效的选择,请重新选择!");
			}
		}
	}

	private static void addBook(Scanner sc, BookService bookService) {
		System.out.println("============添加书籍============");
		System.out.print("请输入书名: ");
		String title = sc.nextLine();
		System.out.print("请输入作者: ");
		String author = sc.nextLine();
		System.out.print("请输入价格: ");
		double price = sc.nextDouble();
		sc.nextLine(); // 换行
		System.out.print("请输入类型: ");
		String type = sc.nextLine();
		Book book = new Book(title, author, price, type);
		bookService.addBook(book);
		System.out.println(book.getTitle() + "图书添加成功!");
	}

	private static void removeBook(Scanner sc, BookService bookService) {
		System.out.println("============删除书籍============");
		System.out.print("请输入要删除的书名: ");
		String title = sc.nextLine();
		bookService.removeBook(title);
		System.out.println("图书删除成功!");
	}

	private static void editBook(Scanner sc, BookService bookService) {
		System.out.println("============修改书籍============");
		System.out.print("请输入要编辑的书名: ");
		String title = sc.nextLine();
		Book book = bookService.findBook(title);
		if (book != null) {
			System.out.print("请输入新的作者:( 原书作者" + book.getAuthor() + ")");
			String newAuthor = sc.nextLine();
			System.out.print("请输入新的价格: (原书价格" + book.getPrice() + ")");
			double newPrice = sc.nextDouble();
			sc.nextLine(); // 换行
			System.out.print("请输入新的类型:(原书类型" + book.getType() + ")");
			String newType = sc.nextLine();
			bookService.updateBookDetails(title, newAuthor, newPrice, newType);
			System.out.println(title + "图书信息更新成功!");
		} else {
			System.out.println("书库中未找到这本《" + title + "》,请确认书名是否正确!");
		}
	}

	static void searchBook(Scanner sc, BookService bookService) {
		System.out.println("查询图书菜单");
		System.out.println("1. 查询全部图书");
		System.out.println("2. 按书名查询");
		System.out.println("3. 按作者查询");
		System.out.println("4. 按类型查询");
		System.out.print("请输入选择: ");
		int choice = sc.nextInt();
		sc.nextLine(); // 换行
		switch (choice) {
		case 1:
			System.out.println("===========查找所有书籍=============");
			for (Book book : bookService.getAllBooks()) {
				System.out.println(book);
			}
			break;
		case 2:
			System.out.println("===========根据书名查找书籍=============");
			System.out.print("请输入书名: ");
			String title = sc.nextLine();
			for (Book book : bookService.getAllBooks()) {//根据书名查找集合中的book对象
				if (book.getTitle().contains(title)) {
					System.out.println(book);
				}
			}
			break;
		case 3:
			System.out.println("===========根据作者名查找书籍=============");
			System.out.print("请输入作者: ");
			String author = sc.nextLine();
			for (Book book : bookService.getAllBooks()) {
				if (book.getAuthor().contains(author)) {//根据作者查找集合中的book对象
					System.out.println(book);
				}
			}
			break;
		case 4:
			System.out.println("===========根据书籍类型名查找书籍=============");
			System.out.print("请输入类型: ");
			String type = sc.nextLine();
			for (Book book : bookService.getAllBooks()) {
				if (book.getType().contains(type)) {//根据书籍类型查找集合中的book对象
					System.out.println(book);
				}
			}
			break;
		default:
			System.out.println("无效的选择,请重新选择!");
		}
	}
}

 BorrowMenu.java

package View.Impl;

import Bean.Book;
import Service.BookService;

import java.util.Scanner;

public class BorrowMenu {
	public static void userMenu(Scanner sc, BookService bookService) {
		while (true) {
			System.out.println("图书借阅系统菜单");
			System.out.println("1. 借阅图书");
			System.out.println("2. 归还图书");
			System.out.println("3. 查询图书");
			System.out.println("4. 退出图书借阅系统");
			System.out.print("请输入选择: ");
			int choice = sc.nextInt();
			sc.nextLine(); // 换行
			switch (choice) {
			case 1:
				borrowBook(sc, bookService);
				break;
			case 2:
				returnBook(sc, bookService);
				break;
			case 3:
				AdminMenu.searchBook(sc, bookService);
				break;
			case 4:
				return;
			default:
				System.out.println("无效的选择,请重新选择!");
			}
		}
	}

	private static void borrowBook(Scanner sc, BookService bookService) {
		System.out.println("============借阅书籍============");
		System.out.print("请输入要借阅的书名: ");
		String title = sc.nextLine();
		Book book = bookService.findBook(title);
		if (book != null && !book.isBorrowed()) {
			bookService.updateBookStatus(title, true);
			System.out.println(title + "图书借阅成功!");
		} else if (book != null && book.isBorrowed()) {
			System.out.println(title + "该图书已被借阅!");
		} else {
			System.out.println("书库中未找到这本《" + title + "》,请确认书名是否正确!");
		}
	}

	private static void returnBook(Scanner sc, BookService bookService) {
		System.out.println("============归还书籍============");
		System.out.print("请输入要归还的书名: ");
		String title = sc.nextLine();
		Book book = bookService.findBook(title);
		if (book != null && book.isBorrowed()) {
			bookService.updateBookStatus(title, false);
			System.out.println(title + "图书归还成功!");
		} else if (book != null && !book.isBorrowed()) {
			System.out.println(title + "该图书未被借阅!");
		} else {
			System.out.println("书库中未找到这本《" + title + "》,请确认书名是否正确!");
		}
	}
}

MainMenu.java 

package View.Impl;

public class MainMenu {
    public static void MainMenu() {
        System.out.println("欢迎使用图书管理系统!");
        System.out.println("1. 登录");
        System.out.println("2. 注册");
        System.out.println("3. 退出");
        System.out.print("请输入选择: ");
    }
}

 启动类:Application.java

package View;

import java.util.Scanner;

import Bean.User;
import Dao.Impl.BookDaoImpl;
import Dao.Impl.UserDaoImpl;
import Service.BookService;
import Service.UserService;
import Service.Impl.BookServiceImpl;
import Service.Impl.UserServiceImpl;
import Utils.Message;
import View.Impl.AdminMenu;
import View.Impl.BorrowMenu;
import View.Impl.MainMenu;

public class Application {
	private static BookService bookService = new BookServiceImpl(new BookDaoImpl());
	private static UserService userService = new UserServiceImpl(new UserDaoImpl());
	private static User user;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			MainMenu.MainMenu();
			int choice = sc.nextInt();
			sc.nextLine(); // 换行
			switch (choice) {
			case 1:
				login(sc);
				break;
			case 2:
				register(sc);
				break;
			case 3:
				System.out.println("正在退出系统中........");
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				System.out.println();
				System.out.println("已退出系统,感谢您的使用!再见!");
				return;
			default:
				System.out.println("无效的选择,请重新选择!");
			}
		}
	}

	private static void login(Scanner sc) {
		System.out.println("============登录============");
		System.out.println("管理员用户请使用管理员账户登录");
		System.out.println("普通用户请使用个人账户登录");
		System.out.println("==========================");
		System.out.print("请输入用户名: ");
		String username = sc.nextLine();
		System.out.print("请输入密码: ");
		String password = sc.nextLine();
		User user = userService.findUser(username);
		if (user != null && user.getPassword().equals(password)) {
			user = user;
			Message.WelcomeMessage(username);
			// 判断是管理员还是普通用户
			if ("admin".equals(user.getRole())) {
				AdminMenu.adminMenu(sc, bookService);
			} else if ("user".equals(user.getRole())) {
				BorrowMenu.userMenu(sc, bookService);
			}
		} else {
			System.out.println("用户名或密码错误,请重试!");
		}
	}

	// 用户注册
	private static void register(Scanner scanner) {
		System.out.println("============注册============");
		System.out.print("请输入用户名: ");
		String username = scanner.nextLine();
		System.out.print("请输入密码: ");
		String password = scanner.nextLine();
		User user = new User(username, password, "user"); // 默认角色是普通用户
		userService.addUser(user);
		System.out.println(username + "注册成功,请登录!");
	}
}

Books.txt

[{"title":"三国演义","author":"罗贯中","price":89.9,"type":"小说","borrowed":false},{"title":"红楼梦","author":"曹雪芹","price":49.8,"type":"小说","borrowed":false},{"title":"java从入门到放弃","author":"黑马程序员","price":90.6,"type":"科学与技术","borrowed":true},{"title":"测试","author":"我","price":96.8,"type":"测试","borrowed":false},{"title":"4","author":"4","price":4.0,"type":"4","borrowed":false},{"title":"1","author":"1","price":1.0,"type":"1","borrowed":true},{"title":"1","author":"1","price":1.0,"type":"1","borrowed":false}]

Users.txt 

admin,admin,admin
user,user,user
1,1,user
2,2,user
3,3,user
4,4,user
1,1,user

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1982711.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

2024华数杯大学生数学建模竞赛(C题)数学建模完整思路+完整代码全解全析

你是否在寻找数学建模比赛的突破点&#xff1f;数学建模进阶思路&#xff01; 作为经验丰富的数学建模团队&#xff0c;我们将为你带来2024华数杯数学建模竞赛&#xff08;C题&#xff09;的全面解析。这个解决方案包不仅包括完整的代码实现&#xff0c;还有详尽的建模过程和解…

按照指定格式打印pprint()

【小白从小学Python、C、Java】 【考研初试复试毕业设计】 【Python基础AI数据分析】 按照指定格式打印 pprint() [太阳]选择题 根据给定的Python代码&#xff0c;哪个选项是正确的&#xff1f; from pprint import pprint data { name: A, age: 30, hobbies:…

Vue项目学习(项目的开发流程)(2)

1、vue项目的默认首页和入口文件 2、两种书写的方式是表达一样的意思——>el&#xff1a;指定当前Vue实例挂载到哪个区域里 3、如果属性值和属性名一致&#xff0c;冒号和后面可以省略不写 &#xff08;所以有两种写法&#xff09; 4、以".vue"文件结尾的文件在项…

3个步骤上⼿Midjourney表情包教程,并上传到微信实现变现!

羡慕别⼈设计的表情包,有趣⼜好玩~也想拥有⾃⼰的个性表情包,可是⾯对复杂的设计流程,却不知从何开始?现在⽤Midjourney,你就可以轻松制作,各种⻛格的表情包,变钱赚钱,这些⽅法分享给 你~ 通⽤公式: 我们⽤表情包魔法公式,加⼊你想要的风格,⽐如漫画、卡通、插画、…

rpc框架怎么使用

这是我们提供RPC的服务类&#xff1a; class MprpcApplication { public:static void Init(int argc, char **argv);static MprpcApplication& GetInstance();static MprpcConfig& GetConfig(); private:static MprpcConfig m_config;MprpcApplication(){}MprpcApplica…

cuda逐步优化实现reduce sum 操作

归约是一种常见的数据并行原语&#xff0c;它将数组中的元素通过某种二元操作&#xff08;如加法&#xff09;合并成一个单一的值。通过逐步展示不同的CUDA实现版本&#xff0c;来演示重要的优化策略。 由于规约的算术操作很简单&#xff0c;对算力要求不高&#xff0c;因此我们…

文件上传和下载

要想实现文件上传和下载&#xff0c;其实只需要下述代码即可&#xff1a; 文件上传和下载 import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; import com.example.common.Result; import org.springframework.web.bind.annotation.*; import org.sprin…

SQL注入sqli-labs-master关卡二

第二关如下&#xff1a; 查看页面与第一关差不多的样子&#xff0c;再查看PHP源码&#xff0c;与第一关差不多只是其中的查询处有不同。&#xff08;查看源码是为了更好的判断出该页面有什么漏洞&#xff09;其中没有单引号所以不用添加单引号去闭合去逃离单引号&#xff0c;说…

【生成式AI-一-生成式AI到底在说什么】

成式AI到底在说什么 什么是生成式人工智能生成式人工智能、机器学习、深度学习的关系chat-gpt 到底是如何实现对话的&#xff1f; 今天主要来看到底生成式AI是什么&#xff0c;语言模型是如何实现生成这个功能的&#xff1f; 什么是生成式人工智能 现在人工智能能做的事情很多…

pxe环境下的无人值守自动安装

0. 环境部署前的准备 1.rhel7的主机 2.开启主机图形 3.配置网络可用 4.关闭vmware dhcp功能 5.关闭防火墙以及selinux getenforce要为disable状态 grubby --update-kernel ALL --args selinux0 systemctl disable --now firewalld 1.kickstart自动安装脚本制作 我们想要…

SQL注入之webshell上传

首先webshell上传就是利用MySQL的文件读写注入而实现,要想上传webshell就得了解文件读写注入的原理。文件读写注入就是利用文件的读写权限进行注入&#xff0c;它可以写一句话木马&#xff0c;也可以读取文件系统的敏感信息。 文件读写注入的条件&#xff1a; 1.高版本的MYSQ…

Axure导入ElementUI元件库——提升原型设计效率与质量

在快速迭代的互联网产品开发过程中&#xff0c;高质量的原型设计是确保项目顺利进行的关键一步。Axure RP&#xff0c;作为一款强大的原型设计工具&#xff0c;以其丰富的交互功能和易用的界面设计&#xff0c;深受设计师和开发者的喜爱。而ElementUI&#xff0c;作为一套为开发…

Ubuntu配置carla docker环境

前言: 本文只在以下设备成功运行, 其他设备不保证能成功, 可以参考在自己设备进行配置 环境 ubuntu 20.04carla 0.9.15gpu 3060(notebook) 安装显卡驱动&nvidia-container-toolkit 显卡驱动 安装完成系统后直接在’软件和更新->附加驱动’直接选择470(proprietary…

工程化实践:工程配置化设计

文内项目 Github&#xff1a;XIAOJUSURVEY 配置化是很灵活且很常见的使用&#xff0c;那XIAOJUSURVEY里有哪些地方应用到了呢&#xff1f; 基础模板​ 问卷模板​ 在创建问卷时&#xff0c;我们提供了多种问卷类型选择&#xff0c;例如普通问卷、投票、报名、NPS等。 为了实…

安卓碎片Fragment

文章目录 Fragment的简单用法动态添加Fragment在Fragment中实现返回栈碎片与活动之间的通信 Fragment是一种可以嵌入在Activity当中的UI片段&#xff0c;它能让程序更加合理和充分地利用大屏幕的空间。 Fragment的简单用法 先建一个空的项目&#xff0c;然后创建两个fragment文…

单片机振荡电路晶振不起振原因分析与解决方法

晶发电子专注17年晶振生产,晶振产品包括石英晶体谐振器、振荡器、贴片晶振、32.768Khz时钟晶振、有源晶振、无源晶振等&#xff0c;产品性能稳定,品质过硬,价格好,交期快.国产晶振品牌您值得信赖的晶振供应商。 晶振在单片机系统中扮演着至关重要的角色&#xff0c;它为单片机提…

大模型分不清 9.9 与 9.11 谁大,那 Embedding 模型呢?

这是我今天在维也纳举行的 ICML 会议上被问到的问题。 在茶歇期间&#xff0c;一位 Jina 用户向我提出了一个源自 LLM 社区最近讨论的问题。他问我们 Jina Embeddings 能不能判断 9.11 比 9.9 更小&#xff0c;很多大模型在这个小问题上翻了车。 我说&#xff1a;“老实说&am…

Flink 实时数仓(七)【DWS 层搭建(一)流量域汇总表创建】

前言 今天开始 DWS 层的搭建&#xff0c;不知不觉又是周一&#xff0c;都忘了昨天是周末&#xff0c;近两年对我来说&#xff0c;周六日晚上八九点能打一小会篮球就算一周的休息了。不得不说自己真的是天生打工体质&#xff0c;每天不管多累&#xff0c;晚上十二点睡&#xff0…

SpringBoot自动配置和执行过程

Spring的执行流程 1. 加载容器&#xff08;加载配置文件&#xff09; 2. 根据配置完成Bean的初始化&#xff08;扫描配置范围内的五大类注解&#xff09; 3. 将被五大类注解修饰的类注册到Spring容器中 (将对象交给Spring IoC容器管理) 4.注入Bean对象&#xff08;Autowired、R…

Linux - - - Linux 添加环境变量

1.添加环境变量 编辑环境变量配置文件。 vim /etc/profile在最后面新增一行&#xff0c;导出 PATH 变量并在之前的 PATH 变量后面添加冒号&#xff0c;然后添加上你的可执行文件的目录。 export PATH$PATH:/usr/local/aspnetcore/aspnetcore-runtime-8.0.7-linux-x64/2.加载…