From 668f27a4d586346c649f36146d98de09ada80514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=B6=9B?= <2841108873@qq.com> Date: Sun, 18 Dec 2022 13:19:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\346\235\203\351\231\220\350\241\250.sql" | 44 +++++++++ .../spring2/day01/Context.java" | 22 +++++ .../spring2/day01/Demo.java" | 8 ++ .../spring2/day01/Test01.java" | 20 +++++ .../spring2/day02/Demo.java" | 4 + .../spring2/day03/Demo.java" | 4 + .../task.xml" | 16 ++++ .../Beans.xml" | 90 +++++++++++++++++++ .../Demo.java" | 87 ++++++++++++++++++ .../demo.properties" | 2 + 10 files changed, 297 insertions(+) create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/1\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/\346\235\203\351\231\220\350\241\250.sql" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Context.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Demo.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Test01.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day02/Demo.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day03/Demo.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/task.xml" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Beans.xml" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Demo.java" create mode 100644 "20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/demo.properties" diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/1\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/\346\235\203\351\231\220\350\241\250.sql" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/1\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/\346\235\203\351\231\220\350\241\250.sql" new file mode 100644 index 0000000..c99c0f7 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/1\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/\346\235\203\351\231\220\350\241\250.sql" @@ -0,0 +1,44 @@ +/* + Navicat Premium Data Transfer + + Source Server : Project + Source Server Type : MySQL + Source Server Version : 50520 + Source Host : localhost:3306 + Source Schema : mi + + Target Server Type : MySQL + Target Server Version : 50520 + File Encoding : 65001 + + Date: 09/12/2022 10:42:36 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for 权限表 +-- ---------------------------- +DROP TABLE IF EXISTS `权限表`; +CREATE TABLE `权限表` ( + `ID` int(8) NOT NULL, + `名字` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `电话` int(15) NOT NULL, + `性别` varchar(4) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + `日期` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact; + +-- ---------------------------- +-- Records of 权限表 +-- ---------------------------- +INSERT INTO `权限表` VALUES (0, '', 0, '男', ''); +INSERT INTO `权限表` VALUES (1, '张一', 12345, '男', '2022年12月1日'); +INSERT INTO `权限表` VALUES (2, '张二', 123456, '女', '2022年12月2日'); +INSERT INTO `权限表` VALUES (3, '张三', 1234567, '男', '2022年12月1日'); +INSERT INTO `权限表` VALUES (4, '张五', 123456789, '女', '2022年12月2日'); +update 权限表 set 名字='李四' where id=1; +update 权限表 set 性别='女' where id=1; +delete from 权限表 where 电话=123456; +SET FOREIGN_KEY_CHECKS = 1; diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Context.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Context.java" new file mode 100644 index 0000000..afce5d0 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Context.java" @@ -0,0 +1,22 @@ +package cn.tedu.spring2.day01; + +public class Context { + private Demo demo; + + + public Demo getDemo() { + return demo; + } + + public void setDemo(Demo demo) { + this.demo = demo; + } + + + @Override + public String toString() { + return "Context{" + + "demo=" + demo + + '}'; + } +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Demo.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Demo.java" new file mode 100644 index 0000000..7e0ad02 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Demo.java" @@ -0,0 +1,8 @@ +package cn.tedu.spring2.day01; + + + +public class Demo { + + +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Test01.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Test01.java" new file mode 100644 index 0000000..a1c8612 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day01/Test01.java" @@ -0,0 +1,20 @@ +package cn.tedu.spring2.day01; + + +import org.junit.jupiter.api.Test; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +public class Test01 { + @Test + public void test01(){//模拟使用autowire:byName找到多个类 + //1.创建对象方式:Spring容器 + ApplicationContext ac = new ClassPathXmlApplicationContext("task.xml"); + //2.获取bean对象个体Bean() 返回一个object类型:产生了线上造型 + Context context = (Context) ac.getBean("context"); + System.out.println(context); + //3.关闭容器 + ((ClassPathXmlApplicationContext)ac).close(); + } + +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day02/Demo.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day02/Demo.java" new file mode 100644 index 0000000..8a6449a --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day02/Demo.java" @@ -0,0 +1,4 @@ +package cn.tedu.spring2.day02; + +public class Demo { +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day03/Demo.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day03/Demo.java" new file mode 100644 index 0000000..e48e4b8 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/spring2/day03/Demo.java" @@ -0,0 +1,4 @@ +package cn.tedu.spring2.day03; + +public class Demo { +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/task.xml" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/task.xml" new file mode 100644 index 0000000..5e79f7e --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/2\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/task.xml" @@ -0,0 +1,16 @@ + + + + + + +、 + + + + + + + \ No newline at end of file diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Beans.xml" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Beans.xml" new file mode 100644 index 0000000..592a46e --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Beans.xml" @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + v1 + v2 + v3 + + + + + + + + s1 + s2 + s3 + + + p1 + p2 + p3 + + + \ No newline at end of file diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Demo.java" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Demo.java" new file mode 100644 index 0000000..90ee0c8 --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/Demo.java" @@ -0,0 +1,87 @@ +package cn.tedu.spring.day03; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +@Component +public class Demo { + //@Value("孙涛")// + @Value("${uname}")//配置外置文件, + private String name; + ///@Value("18") + @Value("${uage}")//语法:${properties配置文件中key值} test03测试的错误,这个地方语法用错了 + private int age; + @Value("#{@list1}") + private List list; + @Value("#{@set1}") + private Set set; + @Value("#{@map1}") + private Map map; + @Value("#{@properties1}") + private Properties properties; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public Set getSet() { + return set; + } + + public void setSet(Set set) { + this.set = set; + } + + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + @Override + public String toString() { + return "Demo{" + + "name='" + name + '\'' + + ", age=" + age + + ", list=" + list + + ", set=" + set + + ", map=" + map + + ", properties=" + properties + + '}'; + } +} diff --git "a/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/demo.properties" "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/demo.properties" new file mode 100644 index 0000000..021569b --- /dev/null +++ "b/20182501212-\345\255\231\346\266\233-\344\275\234\344\270\232(\350\275\257\344\273\26620-25-\345\205\250)/3\344\275\234\344\270\232-20182501212-\345\255\231\346\266\233/demo.properties" @@ -0,0 +1,2 @@ +uname=\u5b59\u6d9b +uage=18 -- Gitee