当前位置: 首页 > news >正文

springboot系列八: springboot静态资源访问,Rest风格请求处理, 接收参数相关注解

文章目录

  • WEB开发-静态资源访问
    • 官方文档
    • 基本介绍
    • 快速入门
    • 注意事项和细节
  • Rest风格请求处理
    • 基本介绍
    • 应用实例
    • 注意事项和细节
    • 思考题
  • 接收参数相关注解
    • 基本介绍
    • 应用实例
      • @PathVariable
      • @RequestHeader
      • @RequestParam
      • @CookieValue
      • @RequestBody
      • @RequestAttribute
      • @SessionAttribute

在这里插入图片描述


⬅️ 上一篇: springboot系列七: Lombok注解,Spring Initializr,yaml语法


🎉 欢迎来到 springboot系列八: springboot静态资源访问,Rest风格请求处理, 接收参数相关注解 🎉

在本篇文章中,我们将探讨如何在 Spring Boot 中处理静态资源访问、实现 Rest 风格的请求处理以及使用接收参数相关的注解。这些功能将帮助您更高效地开发和管理 Spring Boot 应用程序。


🔧 本篇需要用到的项目:


WEB开发-静态资源访问

官方文档

在线文档:

在这里插入图片描述

基本介绍

1.只要静态资源放在类路径下: /static, /public, /resources, /META-INF/resources 可以被直接访问 - 对应文件 WebProperties.java

private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { “classpath:/META-INF/resources/”, “classpath:/resources/”, “classpath:/static/”, “classpath:/public/” };

2.常见静态资源: JS, CSS, 图片(.jpg, .png, .gif, .bmp, .svg), 字体文件(Fonts)等

3.访问方式: 默认: 项目根路径 / + 静态资源名, 比如 http://localhost:8080/1.jpg - 设置WebMvcProperties.java
private String staticPathPattern = “/**”;

在这里插入图片描述

快速入门

1.创建SpringBoot项目springbootweb, 这里使用灵活配置方式来创建项目, 参考springboot快速入门

2.创建相关静态资源目录, 并放入测试图片, 没有目录, 自己创建即可, 浏览器访问 http://localhost:8080/4.png , 完成测试.

在这里插入图片描述

注意事项和细节

1.静态资源访问原理: 静态映射是 /** , 也就是对所有请求拦截. 请求进来, 先看Controller能不能处理, 不能处理的请求交给静态资源处理器, 如果静态资源找不到则响应404页面.

在这里插入图片描述

2.改变静态资源访问前缀, 比如我们希望 http://localhost:8080/image/1.png 去请求静态资源.

应用场景: http://localhost:8080/1.png, 静态资源访问前缀和控制器请求路径冲突

在这里插入图片描述

被Controller拦截

在这里插入图片描述

解决方案:
1)创建src/main/resources/application.yml

spring:mvc:static-path-pattern: /image/**

2)启动, http://localhost:8080/image/1.png 测试

在这里插入图片描述

3.改变默认的静态资源路径, 比如希望在类路径下增加zzwimg目录 作为静态资源路径, 并完成测试.

1)如图所示
在这里插入图片描述

2)配置 application.yml, 增加路径

spring:mvc:static-path-pattern: /image/** #修改静态资源访问 路径/前缀web:resources:#修改/指定 静态资源的访问路径/位置static-locations: [classpath:/zzwimg/] #String[] staticLocations

在这里插入图片描述

3)测试, 浏览器输入 http://localhost:8080/image/6.png(没错, 是image/6.png, 不是image/zzwimg/6.png), 一定要保证工作目录target下 有 6.png, 如果没有, 请rebuild下项目, 再重启项目.

4)如果你配置 static-locations, 原来的访问路径就会被覆盖, 如果需要保留, 再指定一下即可.

  web:resources:#修改/指定 静态资源的访问路径/位置 String[] staticLocationsstatic-locations: ["classpath:/zzwimg/", "classpath:/META-INF/resources/","classpath:/resources/", "classpath:/static/", "classpath:/public/"]

Rest风格请求处理

基本介绍

1.Rest风格支持 (使用HTTP请求方式来表示对资源的操作)

2.举例说明
请求方式: /monster
GET-获取妖怪
DELETE-删除妖怪
PUT-修改妖怪
POST-保存妖怪

应用实例

1.创建src/main/java/com/zzw/springboot/controller/MonsterController.java

@RestController
public class MonsterController {//等价的写法//@RequestMapping(value = "/monster", method= RequestMethod.GET)@GetMapping("/monster")public String getMonster() {return "GET-查询妖怪";}//等价写法//@RequestMapping(value = "/monster", method = RequestMethod.POST)@PostMapping("/monster")public String saveMonster() {return "POST-保存妖怪";}//等价写法@RequestMapping(value = "/monster", method = RequestMethod.PUT)@PutMapping("/monster")public String putMonster() {return "PUT-修改妖怪";}//等价写法@RequestMapping(value = "/monster", method = RequestMethod.DELETE)@DeleteMapping("/monster")public String deleteMonster() {return "DELETE-删除妖怪";}
}

2.使用Postman完成测试, 请求url: http://localhost:8080/monster

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

注意事项和细节

在SpringMVC中我们学过,SpringMVC系列四: Rest-优雅的url请求风格

1.客户端是Postman 可以直接发送 Put, Delete等方式请求, 可不设置Filter.

2.如果要SpringBoot支持 页面表单的Rest功能, 则需要注意如下细节

1)Rest风格请求核心Filter: HiddenHttpMethodFilter, 表单请求会被HiddenHttpMethodFilter拦截, 获取到表单_method的值, 再判断是PUT/DELETE/PATCH(注意: PATCH方法是新引入的, 是对PUT方法的补充, 用来对已知资源进行局部更新, PATCH和PUT方法的区别)

2)如果要SpringBoot支持 页面表单的Rest功能, 需要在application.yml启用filter功能, 否则无效.

3)修改application.yml, 启用filter功能

spring:mvc:static-path-pattern: /image/** #修改静态资源访问 路径/前缀hiddenmethod:filter:enabled: true #启动HiddenHttpMethodFilter, 支持rest

4)修改对应的页面, 然后测试.

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>rest</title>
</head>
<body>
<h1>测试rest风格的url, 完成get请求</h1>
<form action="/monster" method="get">u: <input type="text" name="name"><br/><input type="submit" value="点击提交">
</form>
<h1>测试rest风格的url, 完成post请求</h1>
<form action="/monster" method="post">u: <input type="text" name="name"><br/><input type="submit" value="点击提交">
</form>
<h1>测试rest风格的url, 完成put请求</h1>
<form action="/monster" method="post"><!--通过隐藏域传递_method参数指定值--><input type="hidden" name="_method" value="PUT">u: <input type="text" name="name"><br/><input type="submit" value="点击提交">
</form>
<h1>测试rest风格的url, 完成delete请求</h1>
<form action="/monster" method="post"><input type="hidden" name="_method" value="delete">u: <input type="text" name="name"><br/><input type="submit" value="点击提交">
</form>
</body>
</html>

思考题

1.为什么这里 return “GET-查询妖怪”,返回的是字符串,而不是转发到对应的资源文件?

1)修改src/main/java/com/zzw/springboot/controller/MonsterController.java

//@RestController
@Controller
public class MonsterController {/*** 解读* 因为@RestController是一个复合注解,含有@ResponseBody注解,所以sprintboot底层(springmvc),* 在处理return "xxx"时, 会以 @ResponseBody 注解的方式进行解析处理, 即返回字符串"xxx". 而不会使用* 视图解析器来处理. 如果我们把 @RestController 改成 @Controller, 当你访问getMonster()时, * 会使用到视图解析器(如果配置了的话),即如果你有xxx.html, 就会请求转发到xxx.html, 如果没有xxx.html, 就会报404.* @return*/@GetMapping("/monster")public String getMonster() {return "GET-查询妖怪";}@RequestMapping("/go")public String go() {//顺序 http://localhost:8088/go// => 1.如果没有配置视图解析器, 就看Controller有没有 /hello// => 2.如果有, 就请求转发到 /hello, 如果没有 /hello 映射, 就报错// => 4.如果配置了视图解析器, 就走视图解析器return "hello";}
}

2)浏览器请求 http://localhost:8088/go,报 404 错误,因为找不到资源文件 hello.html

解决方案

1.如果没有配置视图解析器, 访问 http://localhost:8088/go, 会请求转发到 /hello
1)修改src/main/java/com/zzw/springboot/controller/HiController.java

@RestController
public class HiController {//@RequestMapping("/hi") //模拟一下, 发现默认请求的路径和资源的名字冲突@RequestMapping("/hello")public String hi(){return "hi~";}
}

2)测试

在这里插入图片描述

2.如果配置了视图解析器, 访问 http://localhost:8088/go, 就会请求转发到 hello.html
1)新建src/main/resources/public/hello.html

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>hello页面</title>
</head>
<body>
<h2>hello页面</h2>
</body>
</html>

2)application.yml配置视图解析器

spring:mvc:#尽量用默认的, 因为springboot有个约定优于配置的思想#static-path-pattern: /image/** #修改静态资源访问 路径/前缀hiddenmethod:filter:enabled: true #启动HiddenHttpMethodFilter, 支持restview: #修改默认的视图配置
#      prefix: / # No mapping for GET /hello.htmlprefix: / #这里需要注意prefix 需要和当前的static-path-pattern保持一致suffix: .html

3)测试

在这里插入图片描述

接收参数相关注解

基本介绍

1.SpringBoot 接收客户端提交数据 / 参数会使用到相关注解.

2.详细学习 @PathVariable, @RequestHeader, @ModelAttribute, @RequestParam, @CookieValue, @RequestBody

应用实例

●需求:
演示各种方式提交数据/参数给服务器, 服务器如何使用注解接收

@PathVariable

1.创建src/main/resources/public/index.html
JavaWeb系列十: web工程路径专题

<h1>跟着老韩学springboot</h1>
基本注解:
<hr/>
<!--1. web工程路径知识:2. / 会解析成 http://localhost:80803. /monster/100/king => http://localhost:8080/monster/100/king4. 如果不带 /, 会以当前路径为基础拼接
/-->
<a href="/monster/100/king">@PathVariable-路径变量 monster/100/king</a><br/><br/>
</body>

2.创建src/main/java/com/zzw/springboot/controller/ParameterController.java
url占位符回顾

@RestController
public class ParameterController {/*** 1./monster/{id}/{name} 构成完整请求路径* 2.{id} {name} 就是占位变量* 3.@PathVariable("name"): 这里 name 和 {name} 命名保持一致* 4.String name_ 这里自定义, 这里韩老师故意这么写* 5.@PathVariable Map<String, String> map 把所有传递的值传入map* 6.可以看下@pathVariable源码* @return*/@GetMapping("/monster/{id}/{name}")public String pathVariable(@PathVariable("id") Integer id,@PathVariable("name") String name,@PathVariable Map<String, String> map) {System.out.println("id = " + id + "\nname = " + name + "\nmap = " + map);return "success";}
}

3.测试 http://localhost:8088/monster/100/king

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

@RequestHeader

需求: 演示@RequestHeader使用.

1.修改src/main/resources/public/index.html

<a href="/requestHeader">@RequestHeader-获取http请求头</a><br/><br/>

2.修改ParameterController.java
JavaWeb系列八: WEB 开发通信协议(HTTP协议)

/*** 1. @RequestHeader("Cookie") 获取http请求头的 cookie信息* 2. @RequestHeader Map<String, String> header 获取到http请求的所有信息*/
@GetMapping("/requestHeader")
public String requestHeader(@RequestHeader("Host") String host,@RequestHeader Map<String, String> header) {System.out.println("host = " + host + "\nheader = " + header);return "success";
}

3.测试

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

@RequestParam

需求: 演示@RequestParam使用.

1.修改src/main/resources/public/index.html

<a href="/hi?name=赵志伟&fruit=apple&fruit=pear&address=上海&id=3">@RequestParam-获取请求参数</a><br/><br/>

2.修改ParameterController.java
SpringMVC系列五: SpringMVC映射请求数据

/*** 如果我们希望将所有的请求参数的值都获取到, 可以通过* @RequestParam Map<String, String> params*/
@GetMapping("/hi")
public String hi(@RequestParam(value = "name") String username,@RequestParam(value = "fruit") List<String> fruits,@RequestParam Map<String, String> params) {System.out.println("username = " + username + "\nfruits = "+ fruits + "\nparams = " + params);return "success";
}

3.测试

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

@CookieValue

需求: 演示@CookieValue使用.

1.修改src/main/resources/public/index.html

<a href="/cookie">@CookieValue-获取cookie值</a>

2.修改ParameterController.java
JavaWeb系列十一: Web 开发会话技术(Cookie, Session)

/*** 因为我们的浏览器目前没有cookie, 我们可以自己设置cookie* 如果要测试, 可以先写一个方法, 在浏览器创建对应的cookie* 说明:* 1. value = "cookie_key" 表示接收名字为 cookie_key的cookie* 2. 如果浏览器携带来对应的cookie, 那么后面的参数是String, 则接收到的是对应的value* 3. 后面的参数是Cookie, 则接收到的是封装好的对应的cookie*/
@GetMapping("/cookie")
public String cookie(@CookieValue(value = "cookie_key") String cookie_value,@CookieValue(value = "username") Cookie cookie,HttpServletRequest request) {System.out.println("cookie_value = " + cookie_value+ "\nusername = " + cookie.getName() + "-" + cookie.getValue());Cookie[] cookies = request.getCookies();for (Cookie cookie1 : cookies) {System.out.println("cookie1 = " + cookie1.getName() + "-" + cookie1.getValue());}return "success";
}

3.测试
在这里插入图片描述
在这里插入图片描述

@RequestBody

需求: 演示@RequestBody使用.

1.修改src/main/resources/public/index.html

<h1>测试@RequestBody获取数据: 获取POST请求体</h1>
<form action="/save" method="post">名字: <input type="text" name="name"><br/>年龄: <input type="text" name="age"><br/><input type="submit" value="提交"/>
</form>

2.修改ParameterController.java
SpringMVC系列十: 中文乱码处理与JSON处理

/*** @RequestBody 是整体取出Post请求内容*/
@PostMapping("/save")
public String postMethod(@RequestBody String content) {System.out.println("content = " + content);//content = name=zzw&age=23return "sucess";
}

3.测试

在这里插入图片描述

content = name=zzw&age=123

@RequestAttribute

需求: 演示@RequestAttribute使用. 获取request域的属性.

1.修改src/main/resources/public/index.html

<a href="/login">@RequestAttribute-获取request域属性</a>

2.创建RequestController.java
SpringMVC系列十: 中文乱码处理与JSON处理

@Controller
public class RequestController {@RequestMapping("/login")public String login(HttpServletRequest request) {request.setAttribute("user", "赵志伟");//向request域中添加的数据return "forward:/ok";//请求转发到 /ok}@GetMapping("/ok")@ResponseBodypublic String ok(@RequestAttribute(value = "user", required = false) String username,HttpServletRequest request) {//获取到request域中的数据System.out.println("username--" + username);System.out.println("通过servlet api 获取 username-" + request.getAttribute("user"));return "success"; //返回字符串, 不用视图解析器}
}

3.测试…

@SessionAttribute

需求: 演示@SessionAttribute使用. 获取session域的属性.

1.修改src/main/resources/public/index.html

<a href="/login">@SessionAttribute-获取session域属性</a>

2.创建RequestController.java
JavaWeb系列十一: Web 开发会话技术(Cookie, Session)

@Controller
public class RequestController {@RequestMapping("/login")public String login(HttpServletRequest request, HttpSession session) {request.setAttribute("user", "赵志伟");//向request域中添加的数据session.setAttribute("mobile", "黑莓");//向session域中添加的数据return "forward:/ok";//请求转发到 /ok}@GetMapping("/ok")@ResponseBodypublic String ok(@RequestAttribute(value = "user", required = false) String username,HttpServletRequest request,@SessionAttribute(value = "mobile", required = false) String mobile,HttpSession session) {//获取到request域中的数据System.out.println("username--" + username);System.out.println("通过servlet api 获取 username-" + request.getAttribute("user"));//获取session域中的数据System.out.println("mobile--" + mobile);System.out.println("通过HttpSession 获取 mobile-" + session.getAttribute("mobile"));return "success"; //返回字符串, 不用视图解析器}
}

3.测试…


🔜 下一篇预告: [即将更新,敬请期待]


📚 目录导航 📚

  1. springboot系列一: springboot初步入门
  2. springboot系列二: sprintboot依赖管理
  3. springboot系列三: sprintboot自动配置
  4. springboot系列四: sprintboot容器功能
  5. springboot系列五: springboot底层机制实现 上
  6. springboot系列六: springboot底层机制实现 下
  7. springboot系列七: Lombok注解,Spring Initializr,yaml语法
  8. springboot系列八: springboot静态资源访问,Rest风格请求处理, 接收参数相关注解

💬 读者互动 💬
在学习 Spring Boot 静态资源访问和 Rest 风格请求处理的过程中,您有哪些新的发现或疑问?欢迎在评论区留言,让我们一起讨论吧!😊


相关文章:

springboot系列八: springboot静态资源访问,Rest风格请求处理, 接收参数相关注解

文章目录 WEB开发-静态资源访问官方文档基本介绍快速入门注意事项和细节 Rest风格请求处理基本介绍应用实例注意事项和细节思考题 接收参数相关注解基本介绍应用实例PathVariableRequestHeaderRequestParamCookieValueRequestBodyRequestAttributeSessionAttribute ⬅️ 上一篇…...

# 职场生活之道:善于团结

在职场这个大舞台上&#xff0c;每个人都是演员&#xff0c;也是观众。要想在这个舞台上站稳脚跟&#xff0c;除了专业技能&#xff0c;更要学会如何与人相处&#xff0c;如何团结他人。团结&#xff0c;是职场生存的重要法则之一。 1. 主动团结&#xff1a;多一个朋友&#x…...

go sync包(五) WaitGroup

WaitGroup sync.WaitGroup 可以等待一组 Goroutine 的返回&#xff0c;一个比较常见的使用场景是批量发出 RPC 或者 HTTP 请求&#xff1a; requests : []*Request{...} wg : &sync.WaitGroup{} wg.Add(len(requests))for _, request : range requests {go func(r *Reque…...

基于深度学习的相机内参标定

基于深度学习的相机内参标定 相机内参标定&#xff08;Camera Intrinsic Calibration&#xff09;是计算机视觉中的关键步骤&#xff0c;用于确定相机的内部参数&#xff08;如焦距、主点位置、畸变系数等&#xff09;。传统的标定方法依赖于已知尺寸的标定板&#xff0c;通常…...

适合金融行业的国产传输软件应该是怎样的?

对于金融行业来说&#xff0c;正常业务开展离不开文件传输场景&#xff0c;一般来说&#xff0c;金融行业常用的文件传输工具有IM通讯、邮件、自建文件传输系统、FTP应用、U盘等&#xff0c;这些传输工具可以基础实现金融机构的文件传输需求&#xff0c;但也存在如下问题&#…...

昇思25天学习打卡营第9天|MindSpore使用静态图加速(基于context的开启方式)

在Graph模式下&#xff0c;Python代码并不是由Python解释器去执行&#xff0c;而是将代码编译成静态计算图&#xff0c;然后执行静态计算图。 在静态图模式下&#xff0c;MindSpore通过源码转换的方式&#xff0c;将Python的源码转换成中间表达IR&#xff08;Intermediate Repr…...

class类和style内联样式的绑定

这里的绑定其实就是v-bind的绑定&#xff0c;如代码所示&#xff0c;div后面的引号就是v-bind绑定&#xff0c;然后大括号将整个对象括起来&#xff0c;对象内先是属性&#xff0c;属性后接的是变量&#xff0c;这个变量是定义在script中的&#xff0c;后通过这个变量&#xff…...

3033.力扣每日一题7/5 Java

博客主页&#xff1a;音符犹如代码系列专栏&#xff1a;算法练习关注博主&#xff0c;后期持续更新系列文章如果有错误感谢请大家批评指出&#xff0c;及时修改感谢大家点赞&#x1f44d;收藏⭐评论✍ 目录 思路 解题方法 时间复杂度 空间复杂度 Code 思路 首先创建一个与…...

GPT-5:下一代AI如何彻底改变我们的未来

GPT-5 发布前瞻&#xff1a;技术突破与未来展望 随着科技的飞速发展&#xff0c;人工智能领域不断迎来新的突破。根据最新消息&#xff0c;OpenAI 的首席技术官米拉穆拉蒂在一次采访中确认&#xff0c;GPT-5 将在一年半后发布&#xff0c;并描述了其从 GPT-4 到 GPT-5 的飞跃如…...

重载一元运算符

自增运算符 #include<iostream> using namespace std; class CGirl { public:string name;int ranking;CGirl() { name "zhongge"; ranking 5; }void show() const{ cout << "name : "<<name << " , ranking : " <…...

10元 DIY 一个柔性灯丝氛围灯

之前TikTok上特别火的线性氛围灯Augelight刚出来的时候一度卖到80多美金&#xff0c;国内1688也能到400多人民币。 随着各路国内厂商和DIY创客的跟进&#xff0c;功能变多的同时价格一路下滑&#xff0c;虽然有的质感的确感人&#xff0c;但是便宜啊。 甚至关注的up有把成本搞到…...

表单自定义组件 - 可选择卡片SelectCard

import React from react; import styles from ./index.module.less;type OptionsType {/*** 每个item渲染一行&#xff0c;第0项为标题*/labels?: any[];/*** 自定义渲染内容*/label?: string | React.ReactNode;value: any; }; interface IProps {value?: any;onChange?…...

Ubuntu / Debian安装FTP服务

本章教程,记录在Ubuntu中安装FTP服务的具体步骤。FTP默认端口:21 1、安装 pure-ftpd sudo apt-get install pure-ftpd2、修改默认配置 # 与 centos 不同,这里需要在 /etc/pure-ftpd/conf 文件夹下执行下列命令,增加对应配置文件: # 创建 /etc/pure-ftpd/conf/PureDB 文件…...

若依 Vue 前端分离 3.8.8 版中生成的前端代码中关于下拉框只有下拉箭头的问题

生成代码修改前 <el-form-item label"课程学科" prop"subject"><el-select v-model"queryParams.subject" placeholder"请选择课程学科" clearable><el-optionv-for"dict in course_subject":key"dict…...

C++把一个类封装成动态链接库

一、步骤 1. 创建类头文件 首先&#xff0c;定义你要封装的类。例如&#xff0c;创建一个名为MyClass的类&#xff1a; // MyClass.h #pragma once#ifdef MYCLASS_EXPORTS #define MYCLASS_API __declspec(dllexport) #else #define MYCLASS_API __declspec(dllimport) #end…...

每天一个项目管理概念之项目章程

项目管理中&#xff0c;项目章程扮演着至关重要的角色。它是项目正式启动的标志&#xff0c;为项目的执行提供法律和组织上的认可。项目章程是项目管理知识体系&#xff08;PMBOK&#xff09;中定义的关键文档之一&#xff0c;对于确保项目的顺利进行具有决定性的影响。 定义与…...

c++11新特性-4-返回类型后置

文章目录 返回类型后置1.基本语法 返回类型后置 1.基本语法 auto func(参数1&#xff0c;参数2&#xff0c;参数3&#xff0c;...)->decltype(参数表达式) {...... }例如&#xff1a; template<typename T,typename U> auto add(T t,U u)->decltype(t u) {retu…...

Linux-C语言实现一个进度条小项目

如何在linux中用C语言写一个项目来实现进度条&#xff1f;&#xff08;如下图所示&#xff09; 我们知道\r是回车&#xff0c;\n是换行&#xff08;且会刷新&#xff09; 我们可以用 \r 将光标移回行首&#xff0c;重新打印一样格式的内容&#xff0c;覆盖旧的内容&#xff0c;…...

vue使用glide.js实现轮播图(可直接复制使用)

效果图 可以实现自动轮播&#xff0c;3种切换方式&#xff1a;直接滑动图片、点击两侧按钮、点击底部按钮 体验链接:http://website.livequeen.top 实现 一、引入依赖 1、控制台引入依赖 npm install glidejs/glide 2、在css中引用 <style scoped> import glidejs/g…...

TK养号工具开发会用上的源代码科普!

在当今数字化时代&#xff0c;社交媒体平台的崛起使得网络账号的维护与管理变得日益重要&#xff0c;其中&#xff0c;TK作为一款备受欢迎的社交媒体平台&#xff0c;吸引了大量用户。 在TK上进行账号养护&#xff0c;即通过各种方式提升账号权重、增加曝光量&#xff0c;已成…...

在软件开发中正确使用MySQL日期时间类型的深度解析

在日常软件开发场景中&#xff0c;时间信息的存储是底层且核心的需求。从金融交易的精确记账时间、用户操作的行为日志&#xff0c;到供应链系统的物流节点时间戳&#xff0c;时间数据的准确性直接决定业务逻辑的可靠性。MySQL作为主流关系型数据库&#xff0c;其日期时间类型的…...

基于大模型的 UI 自动化系统

基于大模型的 UI 自动化系统 下面是一个完整的 Python 系统,利用大模型实现智能 UI 自动化,结合计算机视觉和自然语言处理技术,实现"看屏操作"的能力。 系统架构设计 #mermaid-svg-2gn2GRvh5WCP2ktF {font-family:"trebuchet ms",verdana,arial,sans-…...

日语学习-日语知识点小记-构建基础-JLPT-N4阶段(33):にする

日语学习-日语知识点小记-构建基础-JLPT-N4阶段(33):にする 1、前言(1)情况说明(2)工程师的信仰2、知识点(1) にする1,接续:名词+にする2,接续:疑问词+にする3,(A)は(B)にする。(2)復習:(1)复习句子(2)ために & ように(3)そう(4)にする3、…...

R语言AI模型部署方案:精准离线运行详解

R语言AI模型部署方案:精准离线运行详解 一、项目概述 本文将构建一个完整的R语言AI部署解决方案,实现鸢尾花分类模型的训练、保存、离线部署和预测功能。核心特点: 100%离线运行能力自包含环境依赖生产级错误处理跨平台兼容性模型版本管理# 文件结构说明 Iris_AI_Deployme…...

学校招生小程序源码介绍

基于ThinkPHPFastAdminUniApp开发的学校招生小程序源码&#xff0c;专为学校招生场景量身打造&#xff0c;功能实用且操作便捷。 从技术架构来看&#xff0c;ThinkPHP提供稳定可靠的后台服务&#xff0c;FastAdmin加速开发流程&#xff0c;UniApp则保障小程序在多端有良好的兼…...

剑指offer20_链表中环的入口节点

链表中环的入口节点 给定一个链表&#xff0c;若其中包含环&#xff0c;则输出环的入口节点。 若其中不包含环&#xff0c;则输出null。 数据范围 节点 val 值取值范围 [ 1 , 1000 ] [1,1000] [1,1000]。 节点 val 值各不相同。 链表长度 [ 0 , 500 ] [0,500] [0,500]。 …...

Java多线程实现之Callable接口深度解析

Java多线程实现之Callable接口深度解析 一、Callable接口概述1.1 接口定义1.2 与Runnable接口的对比1.3 Future接口与FutureTask类 二、Callable接口的基本使用方法2.1 传统方式实现Callable接口2.2 使用Lambda表达式简化Callable实现2.3 使用FutureTask类执行Callable任务 三、…...

CocosCreator 之 JavaScript/TypeScript和Java的相互交互

引擎版本&#xff1a; 3.8.1 语言&#xff1a; JavaScript/TypeScript、C、Java 环境&#xff1a;Window 参考&#xff1a;Java原生反射机制 您好&#xff0c;我是鹤九日&#xff01; 回顾 在上篇文章中&#xff1a;CocosCreator Android项目接入UnityAds 广告SDK。 我们简单讲…...

Rust 异步编程

Rust 异步编程 引言 Rust 是一种系统编程语言,以其高性能、安全性以及零成本抽象而著称。在多核处理器成为主流的今天,异步编程成为了一种提高应用性能、优化资源利用的有效手段。本文将深入探讨 Rust 异步编程的核心概念、常用库以及最佳实践。 异步编程基础 什么是异步…...

鱼香ros docker配置镜像报错:https://registry-1.docker.io/v2/

使用鱼香ros一件安装docker时的https://registry-1.docker.io/v2/问题 一键安装指令 wget http://fishros.com/install -O fishros && . fishros出现问题&#xff1a;docker pull 失败 网络不同&#xff0c;需要使用镜像源 按照如下步骤操作 sudo vi /etc/docker/dae…...