正义联盟的Spring靴

正义联盟的黑暗时代已经来临,强大的Darkseid即将征服人类。 蝙蝠侠在《神力女超人》的帮助下,努力使联盟与一个关键方面失联。 适当的正义联盟成员管理系统。 由于时间不在他们身边,他们不想经历繁琐的过程,从头开始用他们需要的所有东西来建立项目。 蝙蝠侠将艰巨的任务交给了他心爱的值得信赖的阿尔弗雷德·阿尔弗雷德(因为罗宾是如此不可预测),他告诉蝙蝠侠他想起了一个叫做Spring Boot的东西,它可以帮助您设置所需的一切,从而可以编写代码您的应用程序,而不会因为项目设置配置的细微差别而陷入困境。 于是他进入了。 让我们与心爱的阿尔弗雷德(Alfred)谈谈,他将立即利用Spring Boot建立正义联盟成员管理系统。 自从蝙蝠侠喜欢直接使用REST API以来,至少现在是后端部分。

有许多方便的方法来设置Spring Boot应用程序。 在本文中,我们将重点介绍下载软件包(Spring CLI)并在Ubuntu上从头进行设置的传统方式。 Spring还支持通过其工具在线打包项目。 您可以从此处下载最新的稳定版本。 对于本文,我使用的是1.3.0.M1版本。

解压缩下载的存档后,首先,在配置文件中设置以下参数;

SPRING_BOOT_HOME=<extracted path>/spring-1.3.0.M1PATH=$SPRING_BOOT_HOME/bin:$PATH

然后在您的“ bashrc”文件中包括以下内容;

. <extracted-path>/spring-1.3.0.M1/shell-completion/bash/spring

最后执行的操作是,当您处理spring-cli以创建您的spring boot应用程序时,它将使您在命令行上自动完成。 请记住同时“提供”配置文件和“ bashrc”文件,以使更改生效。

本文使用的技术栈如下:

  • SpringREST
  • Spring数据
  • MongoDB

因此,让我们通过发出以下命令开始为应用程序创建模板项目。 请注意,可以通过找到的GitHub存储库下载示例项目
在这里 ;

spring init -dweb,data-mongodb,flapdoodle-mongo  --groupId com.justiceleague --artifactId justiceleaguemodule --build maven justiceleaguesystem

这将使用Spring MVC和Spring Data以及嵌入式MongoDB生成一个maven项目。

默认情况下,spring-cli创建一个名称设置为“ Demo”的项目。 因此,我们将需要重命名生成的相应应用程序类。 如果您从上述我的GitHub存储库中签出了源代码,那么将完成此操作。

使用Spring boot,运行应用程序就像运行项目创建的jar文件一样简单,该jar文件实际上是调用应用程序的
用@SpringBootApplication注释的类可引导Spring。 让我们看看它的样子。

package com.justiceleague.justiceleaguemodule;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*** The main spring boot application which will start up a web container and wire* up all the required beans.* * @author dinuka**/
@SpringBootApplication
public class JusticeLeagueManagementApplication {public static void main(String[] args) {SpringApplication.run(JusticeLeagueManagementApplication.class, args);}
}

然后,我们进入域类,在其中使用spring-data和mongodb来定义数据层。 域类如下;

package com.justiceleague.justiceleaguemodule.domain;import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;/*** This class holds the details that will be stored about the justice league* members on MongoDB.* * @author dinuka**/
@Document(collection = "justiceLeagueMembers")
public class JusticeLeagueMemberDetail {@Idprivate ObjectId id;@Indexedprivate String name;private String superPower;private String location;public JusticeLeagueMemberDetail(String name, String superPower, String location) {this.name = name;this.superPower = superPower;this.location = location;}public String getId() {return id.toString();}public void setId(String id) {this.id = new ObjectId(id);}public String getName() {return name;}public void setName(String name) {this.name = name;}public String getSuperPower() {return superPower;}public void setSuperPower(String superPower) {this.superPower = superPower;}public String getLocation() {return location;}public void setLocation(String location) {this.location = location;}}

当我们使用spring数据时,它非常直观,特别是如果您来自JPA / Hibernate背景。 注释非常相似。 唯一的新事物是@Document批注,它表示我们mongo数据库中集合的名称。 我们还会在超级英雄的名字上定义一个索引,因为更多的查询将围绕按名字搜索。

借助Spring-data,可以轻松定义存储库的功能,这些存储库支持通常的CRUD操作和一些读取操作,而无需直接编写即可。 因此,我们在应用程序中也利用了Spring数据存储库的功能,存储库类如下:

package com.justiceleague.justiceleaguemodule.dao;import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;import com.justiceleague.justiceleaguemodule.domain.JusticeLeagueMemberDetail;public interface JusticeLeagueRepository extends MongoRepository<JusticeLeagueMemberDetail, String> {/*** This method will retrieve the justice league member details pertaining to* the name passed in.* * @param superHeroName*            the name of the justice league member to search and retrieve.* @return an instance of {@link JusticeLeagueMemberDetail} with the member*         details.*/@Query("{ 'name' : {$regex: ?0, $options: 'i' }}")JusticeLeagueMemberDetail findBySuperHeroName(final String superHeroName);
}

常规的保存操作由Spring在运行时通过使用代理实现,我们只需要在存储库中定义域类即可。

如您所见,我们仅定义了一种方法。 使用@Query批注,我们尝试与正则表达式用户一起寻找超级英雄。 选项“ i”表示尝试在mongo db中查找匹配项时,我们应忽略大小写。

接下来,我们继续执行我们的逻辑以通过我们的服务层存储新的正义联盟成员。

package com.justiceleague.justiceleaguemodule.service.impl;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import com.justiceleague.justiceleaguemodule.constants.MessageConstants.ErrorMessages;
import com.justiceleague.justiceleaguemodule.dao.JusticeLeagueRepository;
import com.justiceleague.justiceleaguemodule.domain.JusticeLeagueMemberDetail;
import com.justiceleague.justiceleaguemodule.exception.JusticeLeagueManagementException;
import com.justiceleague.justiceleaguemodule.service.JusticeLeagueMemberService;
import com.justiceleague.justiceleaguemodule.web.dto.JusticeLeagueMemberDTO;
import com.justiceleague.justiceleaguemodule.web.transformer.DTOToDomainTransformer;/*** This service class implements the {@link JusticeLeagueMemberService} to* provide the functionality required for the justice league system.* * @author dinuka**/
@Service
public class JusticeLeagueMemberServiceImpl implements JusticeLeagueMemberService {@Autowiredprivate JusticeLeagueRepository justiceLeagueRepo;/*** {@inheritDoc}*/public void addMember(JusticeLeagueMemberDTO justiceLeagueMember) {JusticeLeagueMemberDetail dbMember = justiceLeagueRepo.findBySuperHeroName(justiceLeagueMember.getName());if (dbMember != null) {throw new JusticeLeagueManagementException(ErrorMessages.MEMBER_ALREDY_EXISTS);}JusticeLeagueMemberDetail memberToPersist = DTOToDomainTransformer.transform(justiceLeagueMember);justiceLeagueRepo.insert(memberToPersist);}}

再说一遍,如果成员已经存在,我们抛出一个错误,否则我们添加该成员。 在这里您可以看到我们正在使用已经实施的
我们之前定义的spring数据存储库的insert方法。

最终,Alfred准备好使用Spring REST公开他刚刚通过REST API开发的新功能,以便Batman可以随时随地通过HTTP发送详细信息。

package com.justiceleague.justiceleaguemodule.web.rest.controller;import javax.validation.Valid;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;import com.justiceleague.justiceleaguemodule.constants.MessageConstants;
import com.justiceleague.justiceleaguemodule.service.JusticeLeagueMemberService;
import com.justiceleague.justiceleaguemodule.web.dto.JusticeLeagueMemberDTO;
import com.justiceleague.justiceleaguemodule.web.dto.ResponseDTO;/*** This class exposes the REST API for the system.* * @author dinuka**/
@RestController
@RequestMapping("/justiceleague")
public class JusticeLeagueManagementController {@Autowiredprivate JusticeLeagueMemberService memberService;/*** This method will be used to add justice league members to the system.* * @param justiceLeagueMember*            the justice league member to add.* @return an instance of {@link ResponseDTO} which will notify whether*         adding the member was successful.*/@ResponseBody@ResponseStatus(value = HttpStatus.CREATED)@RequestMapping(method = RequestMethod.POST, path = "/addMember", produces = {MediaType.APPLICATION_JSON_VALUE }, consumes = { MediaType.APPLICATION_JSON_VALUE })public ResponseDTO addJusticeLeagueMember(@Valid @RequestBody JusticeLeagueMemberDTO justiceLeagueMember) {ResponseDTO responseDTO = new ResponseDTO(ResponseDTO.Status.SUCCESS,MessageConstants.MEMBER_ADDED_SUCCESSFULLY);try {memberService.addMember(justiceLeagueMember);} catch (Exception e) {responseDTO.setStatus(ResponseDTO.Status.FAIL);responseDTO.setMessage(e.getMessage());}return responseDTO;}
}

我们将功能作为JSON负载公开,因为尽管Alfred有点老派并且有时更喜欢XML,但Batman却无法获得足够的功能。

老家伙Alfred仍然想测试他的功能,因为TDD只是他的风格。 因此,最后我们看一下Alfred编写的集成测试,以确保正义联盟管理系统的初始版本能够按预期运行。 请注意,尽管Alfred实际上涵盖了更多内容,您可以在上查看REST API测试,
GitHub存储库

package com.justiceleague.justiceleaguemodule.test.util;import java.io.IOException;
import java.net.UnknownHostException;import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;import com.fasterxml.jackson.databind.ObjectMapper;
import com.justiceleague.justiceleaguemodule.domain.JusticeLeagueMemberDetail;import de.flapdoodle.embed.mongo.MongodExecutable;
import de.flapdoodle.embed.mongo.MongodStarter;
import de.flapdoodle.embed.mongo.config.IMongodConfig;
import de.flapdoodle.embed.mongo.config.MongodConfigBuilder;
import de.flapdoodle.embed.mongo.config.Net;
import de.flapdoodle.embed.mongo.distribution.Version;/*** This class will have functionality required when running integration tests so* that invidivual classes do not need to implement the same functionality.* * @author dinuka**/
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public abstract class BaseIntegrationTest {@Autowiredprotected MockMvc mockMvc;protected ObjectMapper mapper;private static MongodExecutable mongodExecutable;@Autowiredprotected MongoTemplate mongoTemplate;@Beforepublic void setUp() {mapper = new ObjectMapper();}@Afterpublic void after() {mongoTemplate.dropCollection(JusticeLeagueMemberDetail.class);}/*** Here we are setting up an embedded mongodb instance to run with our* integration tests.* * @throws UnknownHostException* @throws IOException*/@BeforeClasspublic static void beforeClass() throws UnknownHostException, IOException {MongodStarter starter = MongodStarter.getDefaultInstance();IMongodConfig mongoConfig = new MongodConfigBuilder().version(Version.Main.PRODUCTION).net(new Net(27017, false)).build();mongodExecutable = starter.prepare(mongoConfig);try {mongodExecutable.start();} catch (Exception e) {closeMongoExecutable();}}@AfterClasspublic static void afterClass() {closeMongoExecutable();}private static void closeMongoExecutable() {if (mongodExecutable != null) {mongodExecutable.stop();}}}
package com.justiceleague.justiceleaguemodule.web.rest.controller;import org.hamcrest.beans.SamePropertyValuesAs;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;import com.justiceleague.justiceleaguemodule.constants.MessageConstants;
import com.justiceleague.justiceleaguemodule.constants.MessageConstants.ErrorMessages;
import com.justiceleague.justiceleaguemodule.domain.JusticeLeagueMemberDetail;
import com.justiceleague.justiceleaguemodule.test.util.BaseIntegrationTest;
import com.justiceleague.justiceleaguemodule.web.dto.JusticeLeagueMemberDTO;
import com.justiceleague.justiceleaguemodule.web.dto.ResponseDTO;
import com.justiceleague.justiceleaguemodule.web.dto.ResponseDTO.Status;/*** This class will test out the REST controller layer implemented by* {@link JusticeLeagueManagementController}* * @author dinuka**/
public class JusticeLeagueManagementControllerTest extends BaseIntegrationTest {/*** This method will test if the justice league member is added successfully* when valid details are passed in.* * @throws Exception*/@Testpublic void testAddJusticeLeagueMember() throws Exception {JusticeLeagueMemberDTO flash = new JusticeLeagueMemberDTO("Barry Allen", "super speed", "Central City");String jsonContent = mapper.writeValueAsString(flash);String response = mockMvc.perform(MockMvcRequestBuilders.post("/justiceleague/addMember").accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON).content(jsonContent)).andExpect(MockMvcResultMatchers.status().isCreated()).andReturn().getResponse().getContentAsString();ResponseDTO expected = new ResponseDTO(Status.SUCCESS, MessageConstants.MEMBER_ADDED_SUCCESSFULLY);ResponseDTO receivedResponse = mapper.readValue(response, ResponseDTO.class);Assert.assertThat(receivedResponse, SamePropertyValuesAs.samePropertyValuesAs(expected));}/*** This method will test if an appropriate failure response is given when* the member being added already exists within the system.* * @throws Exception*/@Testpublic void testAddJusticeLeagueMemberWhenMemberAlreadyExists() throws Exception {JusticeLeagueMemberDetail flashDetail = new JusticeLeagueMemberDetail("Barry Allen", "super speed","Central City");mongoTemplate.save(flashDetail);JusticeLeagueMemberDTO flash = new JusticeLeagueMemberDTO("Barry Allen", "super speed", "Central City");String jsonContent = mapper.writeValueAsString(flash);String response = mockMvc.perform(MockMvcRequestBuilders.post("/justiceleague/addMember").accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON).content(jsonContent)).andExpect(MockMvcResultMatchers.status().isCreated()).andReturn().getResponse().getContentAsString();ResponseDTO expected = new ResponseDTO(Status.FAIL, ErrorMessages.MEMBER_ALREDY_EXISTS);ResponseDTO receivedResponse = mapper.readValue(response, ResponseDTO.class);Assert.assertThat(receivedResponse, SamePropertyValuesAs.samePropertyValuesAs(expected));}/*** This method will test if a valid client error is given if the data* required are not passed within the JSON request payload which in this* case is the super hero name.* * @throws Exception*/@Testpublic void testAddJusticeLeagueMemberWhenNameNotPassedIn() throws Exception {// The super hero name is passed in as null here to see whether the// validation error handling kicks in.JusticeLeagueMemberDTO flash = new JusticeLeagueMemberDTO(null, "super speed", "Central City");String jsonContent = mapper.writeValueAsString(flash);mockMvc.perform(MockMvcRequestBuilders.post("/justiceleague/addMember").accept(MediaType.APPLICATION_JSON).contentType(MediaType.APPLICATION_JSON).content(jsonContent)).andExpect(MockMvcResultMatchers.status().is4xxClientError());}}

就是这样。 借助Spring Boot的强大功能,Alfred能够通过公开的REST API获得最低限度的正义联盟管理系统。 我们将在接下来的时间基于该应用程序构建,并查看Alfred如何提出将这个应用程序通过docker部署到由Kubernetes管理的Amazon AWS实例上。 激动人心的时代即将来临。

翻译自: https://www.javacodegeeks.com/2017/07/spring-boot-justice-league.html

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

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

相关文章

Fetch

fetch是一种HTTP数据请求的方式&#xff0c;是XMLHttpRequest的一种替代方案。fetch不是ajax的进一步封装&#xff0c;而是原生js。Fetch函数就是原生js&#xff0c;没有使用XMLHttpRequest对象。 ajax 使用步骤1.创建XmlHttpRequest对象2.调用open方法设置基本请求信息3.设置发…

boost安装_Centos安装MySQL

安装MySQLMySQL 各版本介绍视频观看:https://www.bilibili.com/video/BV1ap4y1i75jMySQL 官网:https://www.mysql.com/cn/MySQL Community Server社区版本&#xff0c;开源免费&#xff0c;但不提供官方技术支持。MySQL Enterprise Edition 企业版本&#xff0c;需付费&#xf…

选择Java加密算法第3部分–公钥/私钥非对称加密

抽象 这是涵盖Java加密算法的三部分博客系列的第3部分。 本系列介绍如何实现以下目标&#xff1a; 使用SHA–512散列 使用AES–256的单密钥对称加密 RSA–4096 这第三篇文章详细介绍了如何实现非对称的RSA-4096公/私钥加密。 让我们开始吧。 免责声明 这篇文章仅供参考。 …

Error: Cannot find module '@babel/core'

官方默认babel-loader需要搭配最新版本babel 更新到最高版本: npm install -D babel-loader babel/core babel/preset-env webpack 转载于:https://www.cnblogs.com/nocry/p/11493363.html

javabeans_膨胀的JavaBeans –不要在您的API中添加“ Getters”

javabeans我已经最近在博客的想法的JavaBeans™如何可以扩展以减少在Java世界中&#xff0c;这被广泛接受的公约设立的膨胀。 该文章在DZone上重新发布&#xff0c;并在这里获得了颇具争议的反馈&#xff08;例如&#xff0c;大多数试图将一些新想法带入Java世界的想法&#xf…

uniapp 子组件 props拿不到数据_来吧!一文彻底搞定Vue组件!

点击蓝色 “达达前端小酒馆” 关注我哦!加个 “星标” &#xff0c;每天一篇文章&#xff0c;一起学编程作者 | Jeskson来源 | 达达前端小酒馆Vue组件的概述组件是什么呢&#xff0c;了解组件对象的分析&#xff0c;Vue组件中的data属性&#xff0c;props传递数据的原理到底是…

csp-s模拟测试41「夜莺与玫瑰·玫瑰花精·影子」

夜莺与玫瑰 题解 联赛$T1$莫比乌斯$\%\%\%$ $dead$ $line$是直线 首先横竖就是$nm$这比较显然 枚举方向向量 首先我们枚举方向向量时只枚举右下方向,显然贡献$*2$就是所有斜着的直线 $i,j$表示当自己向右$i$个单位长度,向下$j$单位长度 我们相同斜率下只算最短的线贡献,(因为其…

春天重试,因为冬天来了

好的&#xff0c;这实际上与冬天无关&#xff0c;众所周知&#xff0c;冬天已经到了 。 它是关于Spring Retry的&#xff0c;Spring是一个小的Spring框架库&#xff0c;它使我们可以将重试功能添加到应可重试的任何任务中。 这里有一个很好的教程 &#xff0c;解释了如何设置简…

python做些什么项目_Python 的练手项目有哪些值得推荐

1 Web方向的练手项目 这个其实是肯定不用多少的了。Python的练手项目就是可以做一个网站了。我们可以做一个属于自己的博客。在做博客的时候&#xff0c;我们可以巩固的知识点是 HtmlCSSJS的基础知识&#xff0c;以及熟练的运用Python的Web开发框架&#xff08;例如Django或者F…

删除某个时间段之前的文件

/* * 删除文件夹下$n分钟前创建的文件 * param $dir 要处理的目录&#xff0c;物理路径&#xff0c;结尾不加\ * param $n 过期时间&#xff0c;单位为分钟 * return void */function z_del_file_by_ctime($dir,$n){ if(is_dir($dir)){ if($dhopendir($dir)){ …

技术管理规划-路径跟资源

背景 评估团队的投入和产出或者给上级做汇报&#xff0c;都需要弄清楚需要投入多少资源&#xff0c;而资源主要跟两个因素息息相关&#xff0c;即团队目标&#xff0c;此外还有路径和手段&#xff1b; 增加人力前的三个问题&#xff1f; 1.资源的丰富性&#xff1f; 人&#xf…

python保存代码_python入门(5)使用文件编辑器编写代码并保存执行

原博文 2017-04-21 17:21 − python入门&#xff08;5&#xff09;使用文件编辑器编写代码并保存执行 两款文本编辑器&#xff1a; 一个是Sublime Text&#xff0c;免费使用&#xff0c;但是不付费会弹出提示框&#xff1a; 一个是Notepad&#xff0c;免费使用&#xff0c;有中…

lucene索引搜索_Lucene –快速添加索引和搜索功能

lucene索引搜索什么是Lucene&#xff1f; Apache LuceneTM是完全用Java编写的高性能&#xff0c;功能齐全的文本搜索引擎库。 它是一项适用于几乎所有需要全文本搜索的应用程序的技术&#xff0c;尤其是跨平台。 Lucene可以纯文本&#xff0c;整数&#xff0c;索引PDF&#xf…

从graphql endpoint获取schema文件

graphql server端有更新&#xff0c;client端需要重新获取schema文件用于创建新的api request&#xff0c;下面简要记录如何从graphql endpoint获取schema文件 You can simply install the CLI using npm or yarn by running the following command. This will add the graphql…

pythonclass全局变量_python的局部变量,全局变量,类变量,实例变量

定义&#xff1a; a、全局变量&#xff1a;在模块内、在所有函数外面、在class外面&#xff0c;这就是全局变量。 b、局部变量&#xff1a;在函数内、在class的方法内&#xff08;未加self修饰的&#xff09;&#xff0c;这就是局部变量。 c、 静态变量&#xff1a;在class内的…

使用JUnit 5测试异常

JUnit 5带来了令人敬畏的改进&#xff0c;它与以前的版本有很大的不同。 JUnit 5在运行时需要Java 8&#xff0c;因此Lambda表达式可以在测试中使用&#xff0c;尤其是在断言中。 这些断言之一非常适合测试异常。 设置项目 为了演示JUnit 5的用法&#xff0c;我使用了我的长期…

pytorch list转tensor_点赞收藏:PyTorch常用代码段整理合集

机器之心转载来源&#xff1a;知乎作者&#xff1a;张皓众所周知&#xff0c;程序猿在写代码时通常会在网上搜索大量资料&#xff0c;其中大部分是代码段。然而&#xff0c;这项工作常常令人心累身疲&#xff0c;耗费大量时间。所以&#xff0c;今天小编转载了知乎上的一篇文章…

csp-s模拟测试42「世界线·时间机器·密码」

$t3$不会 世界线 题解 题目让求的就是每个点能到点的数量$-$出度 设每个点能到的点为$f[x]$ 则$f[x]x \sum\limits_{y}^{y\in son[x]} U f[y]$ 用$bitset$优化一下即可,但单纯这样会炸内存,随意$yy$一下,时间换空间,像平衡树一样开个垃圾桶都行 代码 #include<bits/stdc.h&g…

python中的命名空间_深入理解Python中的命名空间和范围

Python中的命名空间和范围 在Python中&#xff0c;每个包、模块、类、函数和方法函数都拥有一个“名称空间”&#xff0c;其中解析了变量名称。下面本篇文章就来带大家认识一下Python中的命名空间和范围&#xff0c;希望对大家有所帮助。什么是命名空间&#xff1a; 命名空间是…

ubuntu16.04安装MATLAB R2017b步骤详解(附完整破解文件包)

https://blog.csdn.net/qq_32892383/article/details/79670871 转载于:https://www.cnblogs.com/BambooEatPanda/p/11523727.html