轮播图添加删除

轮播图页面和对话框搭建

页面简单布局

<template><div id="banner"><el-space direction="vertical" :size="20" style="width: 100%"><h1>轮播图管理</h1><div style="text-align: right"><el-button type="primary" @click="onAddButtonClick"><el-icon><plus /></el-icon>添加轮播图</el-button></div></el-space><el-dialog v-model="bannerDialogVisible" title="添加修改轮播图" width="30%"><el-form :model="form"><el-form-item label="名称" ><el-input v-model="form.name" autocomplete="off" /></el-form-item><el-form-item label="图片" ><div style="display: flex"><el-input v-model="form.image_url" autocomplete="off" style="margin-right:10px"/><!-- 上传的地址 --><el-upload:show-file-list="false":action="$http.server_host + '/cmsapi/banner/image/upload'":headers="{'Authorization': 'Bearer '+$auth.token}"name="image"accept="image/jpeg, image/png":on-success="onImageUploadSuccess":on-error="onImageUploadError"><el-button type="primary" size="small">上传图片</el-button></el-upload></div></el-form-item><el-form-item label="跳转" ><el-input v-model="form.link_url" autocomplete="off" /></el-form-item><el-form-item label="优先级" ><el-input v-model="form.priority" autocomplete="off" type="number" /></el-form-item></el-form><template #footer><span class="dialog-footer"><el-button @click="bannerDialogVisible = false">取消</el-button><el-button type="primary"> Confirm </el-button></span></template></el-dialog></div>
</template><script>
import { Plus } from "@element-plus/icons-vue";
export default {name: "Banner",components: {Plus,},data() {return {bannerDialogVisible: false,form: {name: "",image_url: "",link_url: "",priority: "",},};},mounted() {},methods: {onAddButtonClick() {this.bannerDialogVisible = true;},onImageUploadSuccess(response){if(response['code'] == 200){var image_name = response['data']['image_url'];var image_url = "/media/banner/" + image_namethis.form.image_url = image_url;}},onImageUploadError(err, file, fileList){console.log(err);console.log(file);console.log(fileList);},},
};
</script><style scoped>
.el-space {display: block;
}
</style>

在这里插入图片描述

上传轮播图

新建目录存储轮播图
在这里插入图片描述
配置路径
在这里插入图片描述
配置图片前缀
在这里插入图片描述

上传文件校验
在这里插入图片描述

from flask_wtf.file import FileAllowed, FileSize
from wtforms import FileFieldfrom apps.front.forms import BaseFormclass UploadImageForm(BaseForm):image = FileField(validators=[FileAllowed(['jpg', 'jpeg', 'png'], message="图片格式不符合要求!"), FileSize(max_size=1024*1024*5, message="图片最大不能超过5M!")])

上传接口
在这里插入图片描述

'''
-*- coding: utf-8 -*-
@File  : views.py
@author: Lx
@Time  : 2023/07/17 15:08
'''
import time
from hashlib import md5from flask import Blueprint, request, current_app, gfrom apps.cmsapi.forms import UploadImageForm
from utils import restful
from flask_jwt_extended import jwt_required,get_jwt_identity
import os
bp = Blueprint("cmsapi", __name__, url_prefix="/cmsapi")@bp.get('/')
@jwt_required()
def mytest():# 这个identity是通过create_access_token传入的identity 获取的是User.ididentity = get_jwt_identity()return restful.ok(message="成功!")@bp.post("/banner/image/upload")
def upload_banner_image():form = UploadImageForm(request.files)if form.validate():image = form.image.data# 不要使用用户上传上来的文件名,否则容易被黑客攻击filename = image.filename# xxx.png,xx.jpeg_, ext = os.path.splitext(filename)filename = md5((g.user.email + str(time.time())).encode("utf-8")).hexdigest() + extimage_path = os.path.join(current_app.config['BANNER_IMAGE_SAVE_PATH'], filename)image.save(image_path)return restful.ok(data={"image_url": filename})else:message = form.messages[0]return restful.params_error(message=message)

此时会报跨域错误
在这里插入图片描述

pip install flask-cors

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

此时上传文件会出现问题因为g.user 没有这个属性
在这里插入图片描述

# 调用cmsapi之前先获取jwt  通过之后绑定user属性
@bp.before_request
@jwt_required()
def cmsapi_before_request():if request.method == 'OPTIONS':returnidentity = get_jwt_identity()user = UserModel.query.filter_by(id=identity).first()if user:setattr(g, "user", user)

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

	#做个判断if request.method == 'OPTIONS':return

在这里插入图片描述

onImageUploadSuccess(response){if(response['code'] == 200){var image_name = response['data']['image_url'];var image_url = "/media/banner/" + image_namethis.form.image_url = image_url;}},onImageUploadError(err, file, fileList){console.log(err);console.log(file);console.log(fileList);},

添加轮播图
前端实现
在这里插入图片描述

轮播图添加
在这里插入图片描述

onDialogSubmitEvent(){this.$refs["dialogForm"].validate((valid) => {if(!valid){ElMessage.error("请确保数据输入正确!");return;}// 走添加操作this.$http.addBanner(this.form).then((result) => {let code = result['code'];if(code === 200){let banner = result['data'];// 返回的轮播图添加到数组中this.banners.push(banner);ElMessage.success("轮播图添加成功!");this.bannerDialogVisible = false;}}).catch(() => {ElMessage.error("服务器开小差了,请稍后再试!");this.bannerDialogVisible = false})})},

在这里插入图片描述

轮播图列表展示
后端

@bp.get("/banner/list")
def banner_list():banners = BannerModel.query.order_by(BannerModel.create_time.desc()).all()# BannerModelbanner_dicts = [banner.to_dict() for banner in banners]return restful.ok(data=banner_dicts)

轮播图列表前端实现
前端
http.js

getBannerList(){const url = "/banner/list"return this.http.get(url);}

在这里插入图片描述

mounted() {this.$http.getBannerList().then(res => {if(res['code'] == 200){let banners = res['data'];this.banners = banners;}else{ElMessage.error(res['message']);}})},
<el-table :data="banners" style="width: 100%"><el-table-column prop="name" label="名称" width="250px" /><el-table-column label="图片"><template #default="scope"><img :src="formatImageUrl(scope.row.image_url)" style="width: 200px;height: 60px;" /></template></el-table-column><el-table-column label="跳转链接"><template #default="scope"><a :href="scope.row.link_url" target="_blank">{{scope.row.link_url}}</a></template></el-table-column><el-table-column prop="priority" label="优先级" width="100px" /><el-table-column><template #default="scope"><el-button type="primary" circle @click="onEditEvent(scope.$index)"><el-icon><edit /></el-icon></el-button><el-button type="danger" circle @click="onDeleteEvent(scope.$index)"><el-icon><delete /></el-icon></el-button></template></el-table-column></el-table>

在这里插入图片描述

添加轮播的时候上传本地需要拼接完整Url
如果是在输入框输入完整url则不需要拼接


<el-table-column label="图片"><template #default="scope"><img :src="formatImageUrl(scope.row.image_url)" style="width: 200px;height: 60px;" /></template></el-table-column>formatImageUrl(image_url){if(image_url.startsWith("http")){return image_url;}else{return this.$http.server_host + image_url;}},

在这里插入图片描述

删除轮播图前后端实现

deleteBanner(banner_id){const url = "/banner/delete"return this._post(url, {"id": banner_id})}
 onDeleteEvent(index){this.deleteingIndex = index;this.deleteDialogVisible = true;},onConfirmDeleteEvent(){let banner = this.banners[this.deleteingIndex];this.$http.deleteBanner(banner.id).then(res => {let result = res['data'];let code = result['code'];if(code === 200){this.deleteDialogVisible = false;this.banners.splice(this.deleteingIndex, 1);ElMessage.success("轮播图删除成功!");}})}
@bp.post("/banner/delete")
def delete_banner():banner_id = request.form.get("id")if not banner_id:return restful.params_error(message="没有传入id!")try:banner_model = BannerModel.query.get(banner_id)except Exception as e:return restful.params_error(message="此轮播图不存在!")db.session.delete(banner_model)db.session.commit()return restful.ok()

编辑轮播图

forms

class EditBannerForm(AddBannerForm):id = IntegerField(validators=[InputRequired(message="请输入轮播图的id!")])
@bp.post("/banner/edit")
def edit_banner():form = EditBannerForm(request.form)if form.validate():banner_id = form.id.datatry:banner_model = BannerModel.query.get(banner_id)except Exception as e:return restful.params_error(message="轮播图不存在!")name = form.name.dataimage_url = form.image_url.datalink_url = form.link_url.datapriority = form.priority.databanner_model.name = namebanner_model.image_url = image_urlbanner_model.link_url = link_urlbanner_model.priority = prioritydb.session.commit()return restful.ok(data=banner_model.to_dict())else:return restful.params_error(message=form.messages[0])

前端页面点击编辑按钮,数据回显
在这里插入图片描述

在这里插入图片描述

// 如果有值说明是编辑轮播图initForm(banner){if(banner){// 这里加轮播图id 验证是添加轮播图还是编辑this.form.id = banner.id;this.form.name = banner.name;this.form.image_url = banner.image_url;this.form.link_url = banner.link_url;this.form.priority = banner.priority;}else{// 如果没有则说明是添加轮播图,则把表单清空this.form = {name: "",image_url: "",link_url: "",priority: 0}}},onEditEvent(index){this.editingIndex = index;let banner = this.banners[index];this.initForm(banner);this.bannerDialogVisible = true;},

添加轮播图做修改

onDialogSubmitEvent(){this.$refs["dialogForm"].validate((valid) => {if(!valid){ElMessage.error("请确保数据输入正确!");return;}if(this.form.id){// 走编辑操作this.$http.editBanner(this.form).then((result) => {let code = result['code'];if(code === 200){let banner = result['data'];// this.banners.push(banner);// 需要使用splice才能完成替换操作,不能直接通过下标修改元素// 直接通过下标修改元素,页面上不会自动改变this.banners.splice(this.editingIndex, 1, banner);ElMessage.success("轮播图编辑成功!");this.bannerDialogVisible = false;}})}else{// 走添加操作this.$http.addBanner(this.form).then((result) => {let code = result['code'];if(code === 200){let banner = result['data'];this.banners.push(banner);ElMessage.success("轮播图添加成功!");this.bannerDialogVisible = false;}}).catch(() => {ElMessage.error("服务器开小差了,请稍后再试!");this.bannerDialogVisible = false})}})},

http.js

editBanner(data){const url = "/banner/edit"return this._post(url, data);}

前台加载真实轮播图数据

@bp.route('/')
def index():sort = request.args.get("st", type=int, default=1)board_id = request.args.get("bd", type=int, default=None)boards = BoardModel.query.order_by(BoardModel.priority.desc()).all()post_query = Noneif sort == 1:post_query = PostModel.query.order_by(PostModel.create_time.desc())else:# 根据评论数量进行排序post_query = db.session.query(PostModel).outerjoin(CommentModel).group_by(PostModel.id).order_by(func.count(CommentModel.id).desc(), PostModel.create_time.desc())page = request.args.get(get_page_parameter(), type=int, default=1)# 10-9# 210-19start = (page - 1) * current_app.config['PER_PAGE_COUNT']end = start + current_app.config['PER_PAGE_COUNT']if board_id:# "mapped class CommentModel->comment" has no property "board_id"# CommentModel中寻找board_id,然后进行过滤# post_query = post_query.filter_by(board_id=board_id)post_query = post_query.filter(PostModel.board_id==board_id)total = post_query.count()posts = post_query.slice(start, end)pagination = Pagination(bs_version=3, page=page, total=total, prev_label="上一页")banners = BannerModel.query.order_by(BannerModel.priority.desc()).all()context = {"boards": boards,"posts": posts,"pagination": pagination,"st": sort,"bd": board_id,"banners": banners}return render_template("front/index.html", **context)

在这里插入图片描述

前端轮播图展示功能
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

<template><div id="banner"><el-space direction="vertical" :size="20" style="width: 100%"><h1>轮播图管理</h1><div style="text-align: right"><el-button type="primary" @click="onAddButtonClick"><el-icon><plus /></el-icon>添加轮播图</el-button></div><el-table :data="banners" style="width: 100%"><el-table-column prop="name" label="名称" width="250px" /><el-table-column label="图片"><template #default="scope"><img :src="formatImageUrl(scope.row.image_url)" style="width: 200px;height: 60px;" /></template></el-table-column><el-table-column label="跳转链接"><template #default="scope"><a :href="scope.row.link_url" target="_blank">{{scope.row.link_url}}</a></template></el-table-column><el-table-column prop="priority" label="优先级" width="100px" /><el-table-column><template #default="scope"><el-button type="primary" circle @click="onEditEvent(scope.$index)"><el-icon><edit /></el-icon></el-button><el-button type="danger" circle @click="onDeleteEvent(scope.$index)"><el-icon><delete /></el-icon></el-button></template></el-table-column></el-table></el-space><el-dialog v-model="bannerDialogVisible" title="添加/修改轮播图" width="30%"><el-form :model="form" :rules="rules" ref="dialogForm"><el-form-item label="名称" prop="name"><el-input v-model="form.name" autocomplete="off"></el-input></el-form-item><el-form-item label="图片" prop="image_url"><div style="display: flex;"><el-input v-model="form.image_url" autocomplete="off" style="margin-right:10px;"></el-input><el-upload:action="$http.server_host+'/cmsapi/banner/image/upload'"name="image":headers="{'Authorization': 'Bearer '+$auth.token}":show-file-list="false"accept="image/jpeg, image/png":on-success="onImageUploadSuccess":on-error="onImageUploadError"><el-button size="small" type="primary">上传图片</el-button></el-upload></div></el-form-item><el-form-item label="跳转" prop="link_url"><el-input v-model="form.link_url" autocomplete="off"></el-input></el-form-item><el-form-item label="优先级" prop="priority"><el-input v-model="form.priority" autocomplete="off" type="number"></el-input></el-form-item></el-form><template #footer><span class="dialog-footer"><el-button @click="bannerDialogVisible = false">取消</el-button><el-button type="primary" @click="onDialogSubmitEvent">确认</el-button></span></template></el-dialog><!-- 删除轮播图确认对话框 --><el-dialogv-model="deleteDialogVisible"title="提示"width="30%"><span>您确定要删除这个轮播图吗?</span><template #footer><span class="dialog-footer"><el-button @click="deleteDialogVisible = false">取消</el-button><el-button type="primary" @click="onConfirmDeleteEvent">确定</el-button></span></template></el-dialog></div>
</template><script>
import { Plus, Edit, Delete } from "@element-plus/icons";
import {ElMessage} from "element-plus";
export default {name: "Banner",components: {Plus,Edit,Delete},data(){return {bannerDialogVisible: false,deleteDialogVisible: false,deleteingIndex: 0,editingIndex: 0,banners: [],form: {name: "",image_url: "",link_url: "",priority: 0},rules: {name: [{required: true,message: '请输入轮播图名称!',trigger: 'blur'}],image_url: [{required: true,message: '请上传轮播图!',trigger: 'blur'}],link_url: [{required: true,message: '请输入轮播图跳转链接!',trigger: 'blur'}],priority: [{required: true,message: '请输入轮播图优先级!',trigger: 'blur'}],}}},mounted() {this.$http.getBannerList().then(res => {if(res['code'] == 200){let banners = res['data'];this.banners = banners;}else{ElMessage.error(res['message']);}})},methods: {formatImageUrl(image_url){if(image_url.startsWith("http")){return image_url;}else{return this.$http.server_host + image_url;}},initForm(banner){if(banner){this.form.id = banner.id;this.form.name = banner.name;this.form.image_url = banner.image_url;this.form.link_url = banner.link_url;this.form.priority = banner.priority;}else{this.form = {name: "",image_url: "",link_url: "",priority: 0}}},onAddButtonClick(){this.initForm();this.bannerDialogVisible = true;},onImageUploadSuccess(response){if(response['code'] == 200){var image_name = response['data']['image_url'];var image_url = "/media/banner/" + image_namethis.form.image_url = image_url;}},onImageUploadError(err, file, fileList){console.log(err);console.log(file);console.log(fileList);},onDialogSubmitEvent(){this.$refs["dialogForm"].validate((valid) => {if(!valid){ElMessage.error("请确保数据输入正确!");return;}if(this.form.id){// 走编辑操作this.$http.editBanner(this.form).then((result) => {let code = result['code'];if(code === 200){let banner = result['data'];// this.banners.push(banner);// 需要使用splice才能完成替换操作,不能直接通过下标修改元素// 直接通过下标修改元素,页面上不会自动改变this.banners.splice(this.editingIndex, 1, banner);ElMessage.success("轮播图编辑成功!");this.bannerDialogVisible = false;}})}else{// 走添加操作this.$http.addBanner(this.form).then((result) => {let code = result['code'];if(code === 200){let banner = result['data'];this.banners.push(banner);ElMessage.success("轮播图添加成功!");this.bannerDialogVisible = false;}}).catch(() => {ElMessage.error("服务器开小差了,请稍后再试!");this.bannerDialogVisible = false})}})},// 编辑轮播图onEditEvent(index){this.editingIndex = index;let banner = this.banners[index];this.initForm(banner);this.bannerDialogVisible = true;},// 每次点击添加轮播图就初始化表单onAddButtonClick(){this.initForm();this.bannerDialogVisible = true;},onDeleteEvent(index){this.deleteingIndex = index;this.deleteDialogVisible = true;},onConfirmDeleteEvent(){let banner = this.banners[this.deleteingIndex];this.$http.deleteBanner(banner.id).then(res => {let result = res['data'];let code = result['code'];if(code === 200){this.deleteDialogVisible = false;this.banners.splice(this.deleteingIndex, 1);ElMessage.success("轮播图删除成功!");}})}}
};
</script><style scoped>
.el-space {display: block;
}
</style>

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

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

相关文章

商城-学习整理-基础-分布式组件(三)

目录 一、前言二、Spring Cloud&Spring Cloud Alibaba1、Spring Cloud 与Spring Cloud Alibaba简介2、为什么使用Spring Cloud Alibaba3、版本选择4、项目中的依赖 三、Spring Cloud Alibaba-Nacos作为注册中心1、Nacos1&#xff09;、下载 nacos-server2&#xff09;、启动…

42. 接雨水

42.接雨水 这是一个简单的动态规划问题&#xff0c;虽然leetcode将它归结为困难。 但是我感觉它难度应该达不到&#xff0c;可能归结为中等比较合适0x1 题目 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图&#xff0c;计算按此排列的柱子&#xff0c;下雨之后能接多少雨…

python flask 返回中文乱码

使用flask返回数据中带有中文的时候会显示成乱码(ascii)&#xff0c; 中文报文&#xff1a; ABAP中的三大财务报表是&#xff1a;* **资产负债表** * **收入证明** * **现金流量表**这些报表全面概述了公司的财务状况和业绩。* **资产负债表**显示公司在特定时间点的资产、负…

【Python数据分析】Python基础知识篇

&#x1f389;欢迎来到Python专栏~Python基础知识篇 ☆* o(≧▽≦)o *☆嗨~我是小夏与酒&#x1f379; ✨博客主页&#xff1a;小夏与酒的博客 &#x1f388;该系列文章专栏&#xff1a;Python学习专栏 文章作者技术和水平有限&#xff0c;如果文中出现错误&#xff0c;希望大…

LeetCode[1508]子数组和排序后的区间和

难度&#xff1a;Medium 题目&#xff1a; 给你一个数组 nums &#xff0c;它包含 n 个正整数。你需要计算所有非空连续子数组的和&#xff0c;并将它们按升序排序&#xff0c;得到一个新的包含 n * (n 1) / 2 个数字的数组。 请你返回在新数组中下标为 left 到 right &#…

将请求参数数据推送至RabbitMQ队列中并且捕捉消息没有到达交换机的异常

1&#xff1a;自定义mq信息类&#xff08;我的交换这些信息都从nacos上直接取的&#xff0c;怎么从nacos取配置信息看上篇文章&#xff09;&#xff1a; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor;impo…

GB2312编码

说明 GB2312代码表用两个字节表示一个图形字符&#xff0c;两个字节中前面的字节为第一字节&#xff0c;后面的字节为第二字节。 区位码&#xff1a; GB2312代码表分成94个区&#xff0c;范围为1-94&#xff0c;区的编号由第一字节表示&#xff1b;每个区有94位&#xff0c;范…

AE 3D粒子插件trapcode particular 新版本

Trapcode Particular for Mac是目前AE系列的插件中最火爆最流行的一款三维粒子插件&#xff0c;是属于Red Giant Trapcode Suite&#xff08;红巨人粒子特效套装插件&#xff09;中的一款粒子插件。该软件提供了多达一百余种粒子效果供用户使用&#xff0c;可以产生各种各样的自…

【mac系统】mac系统调整妙控鼠标速度

当下环境&#xff1a; mac系统版本&#xff0c;其他系统应该也可以&#xff0c;大家可以自行试下&#xff1a; 鼠标 mac妙控鼠标&#xff0c;型号A1657 问题描述&#xff1a; 通过mac系统自带的鼠标速度调节按钮&#xff0c;调到最大后还是感觉移动速度哦过慢 问题解决&…

【Docker】什么是Docker呢?本文带你洞悉

&#x1f680;欢迎来到本文&#x1f680; &#x1f349;个人简介&#xff1a;陈童学哦&#xff0c;目前专攻C/C、Python、Java等方向&#xff0c;一个正在慢慢前行的普通人。 &#x1f3c0;系列专栏&#xff1a;陈童学的日记 &#x1f4a1;其他专栏&#xff1a;CSTL、蓝桥杯&am…

学习day49

computed和watch的区别 1.computed能完成的功能&#xff0c;watch都可以实现 2.watch能完成的&#xff0c;computed不一定能实现&#xff0c;例如&#xff1a;watch可以进行异步操作 两个重要的小原则 1.所被Vue管理的函数&#xff0c;最好写成普通函数&#xff0c;这样this的指…

90道渗透测试面试题(附答案)

2023年已经快过去一半了&#xff0c;不知道小伙伴们有没有找到自己心仪的工作呀。最近后台收到不少小伙伴说要我整理一些渗透测试的面试题&#xff0c;今天它来了&#xff01;觉得对你有帮助的话记得点个赞再走哦~ 1、什么是渗透测试&#xff1f; 渗透测试是一种评估计算机系统…

【MATLAB】 二维绘图,三维绘图的方法与函数

目录 MATLAB的4种二维图 1.线图 2.条形图 3.极坐标图 4.散点图 三维图和子图 1.三维曲面图 2.子图 MATLAB的4种二维图 1.线图 plot函数用来创建x和y值的简单线图 x 0:0.05:30; %从0到30&#xff0c;每隔0.05取一次值 y sin(x); plot(x,y) %若(x,y,LineWidth,2) 可…

【ShaderToy中图形效果转译到UnityShaderlab案例分享,实现粒子场_ParticleField】

Shader"ShaderToy/ParticleField" {Properties{_iMouse("iMouse", Vector) = (0,0,0,0)}SubSha

解密动态内存管理的奥秘(含内存4个函数)

目录 一.为什么存在动态内存管理 二.动态内存函数的介绍 1. malloc函数&#xff08;memory alloc 内存开辟&#xff09; 函数介绍&#xff1a; malloc函数使用举例代码&#xff1a; 2.free&#xff08;释放&#xff09; 函数介绍&#xff1a; 代码的示例&#xff1a…

C#WinForm获取当前活动子窗体使用鼠标滚轮事件改变窗体大小

获取当前活动子窗体使用鼠标滚轮事件改变窗体大小&#xff0c;实例在文末&#xff0c;可下载。 这个主要分三个重点 第一步 我们需要让子窗体显示在父窗体中 Form22 new Form2(); Form22.TopLevel false; // 不是顶级窗体 //Form22.Parent this;// 设置父窗体 一定不要…

配置NFS服务

环境 环境 ubuntu 10.4 vm 7.1 终端 ifconfig 得到 ubuntu资料 INET ADDR 192.168.0.4 BCAST 192.168.0.255 MASK 255.255.255.0 操作前先关闭防火墙 关闭防火墙&#xff1a; 命令&#xff1a;sudo ufw disable 打开防火墙 命令&#xff1a;sudo ufw enable 配置过程 一 安…

机器人SLAM导航学习-All in one

参考引用 张虎&#xff0c;机器人SLAM导航核心技术与实战[M]. 机械工业出版社&#xff0c;2022.本博客未详尽之处可自行查阅上述书籍 一、编程基础篇 1. ROS 入门必备知识 ROS学习笔记&#xff08;文章链接汇总&#xff09; 2. C 编程范式 《21天学通C》读书笔记&#xff0…

RabbitMQ

文章目录 RabbitMQ初识MQ同步和异步通讯同步通讯异步通讯 技术对比 RabbitMq安装RabbitMQ架构RabbitMQ消息模型publisher实现consumer实现总结 SpringAMQPBasic Queue 简单队列模型WorkQueue发布/订阅FanoutDirectTopic 消息转换器 RabbitMQ 初识MQ 同步和异步通讯 微服务间…

力扣刷题SQL-197. 上升的温度---分步解题

表&#xff1a; Weather ------------------------ | Column Name | Type | ------------------------ | id | int | | recordDate | date | | temperature | int | ------------------------ id 是这个表的主键 该表包含特定日期的温度信息编…