springboot中swagger、異步/定時(shí)/郵件任務(wù)的問(wèn)題
學(xué)習(xí)目標(biāo):
了解Swagger的概念及作用 掌握在項(xiàng)目中集成Swagger自動(dòng)生成API文檔1.1、Swagger簡(jiǎn)介前后端分離
前端 -> 前端控制層、視圖層 后端 -> 后端控制層、服務(wù)層、數(shù)據(jù)訪問(wèn)層 前后端通過(guò)API進(jìn)行交互 前后端相對(duì)獨(dú)立且松耦合產(chǎn)生的問(wèn)題
前后端集成,前端或者后端無(wú)法做到“及時(shí)協(xié)商,盡早解決”,最終導(dǎo)致問(wèn)題集中爆發(fā)解決方案
首先定義schema [ 計(jì)劃的提綱 ],并實(shí)時(shí)跟蹤最新的API,降低集成風(fēng)險(xiǎn)Swagger
號(hào)稱(chēng)世界上最流行的API框架 Restful Api 文檔在線自動(dòng)生成器 => API 文檔 與API 定義同步更新 直接運(yùn)行,在線測(cè)試API 支持多種語(yǔ)言 (如:Java,PHP等) 官網(wǎng):https://swagger.io/1.2、SpringBoot集成SwaggerSpringBoot集成Swagger => springfox,兩個(gè)jar包
Springfox-swagger2 swagger-springmvc使用Swagger
要求:jdk 1.8 + 否則swagger2無(wú)法運(yùn)行
步驟:
1、新建一個(gè)SpringBoot-web項(xiàng)目
2、添加Maven依賴
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --><dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>3.0.0</version></dependency><!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --><dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>3.0.0</version></dependency>
3、編寫(xiě)HelloController,測(cè)試確保運(yùn)行成功!
4、要使用Swagger,我們需要編寫(xiě)一個(gè)配置類(lèi)-SwaggerConfig來(lái)配置 Swagger
@Configuration //配置類(lèi)@EnableSwagger2// 開(kāi)啟Swagger2的自動(dòng)配置public class SwaggerConfig { }
5、訪問(wèn)測(cè)試 :http://localhost:8080/swagger-ui.html ,可以看到swagger的界面;
重要在于寫(xiě) 文檔名和描述,即ApiInfo有參構(gòu)造的前2個(gè)參數(shù)。
1.3、配置Swagger1、Swagger實(shí)例Bean是Docket,所以通過(guò)配置Docket實(shí)例來(lái)配置Swaggger。
//配置了swagger的docket的bean實(shí)例 @Bean public Docket getDocket(){return new Docket(DocumentationType.SWAGGER_2); }
2、可以通過(guò)apiInfo()屬性配置文檔信息
//配置文檔信息private ApiInfo apiInfo() { Contact contact = new Contact('聯(lián)系人名字', 'http://xxx.xxx.com/聯(lián)系人訪問(wèn)鏈接', '聯(lián)系人郵箱'); return new ApiInfo( 'Swagger學(xué)習(xí)', // 標(biāo)題 '學(xué)習(xí)演示如何配置Swagger', // 描述 'v1.0', // 版本 'http://terms.service.url/組織鏈接', // 組織鏈接 contact, // 聯(lián)系人信息 'Apach 2.0 許可', // 許可 '許可鏈接', // 許可連接 new ArrayList<>()// 擴(kuò)展 );}
3、Docket 實(shí)例關(guān)聯(lián)上 apiInfo()
@Beanpublic Docket docket() { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo());}
4、重啟項(xiàng)目,訪問(wèn)測(cè)試 http://localhost:8080/swagger-ui.html 看下效果;
1、構(gòu)建Docket時(shí)通過(guò)select()方法配置怎么掃描接口。
@Beanpublic Docket docket() { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()// 通過(guò).select()方法,去配置掃描接口,RequestHandlerSelectors配置如何掃描接口.apis(RequestHandlerSelectors.basePackage('com.wei.swagger.controller')).build();}
2、重啟項(xiàng)目測(cè)試,由于我們配置根據(jù)包的路徑掃描接口,所以我們只能看到一個(gè)類(lèi)
3、除了通過(guò)包路徑配置掃描接口外,還可以通過(guò)配置其他方式掃描接口,這里注釋一下所有的配置方式:
any() // 掃描所有,項(xiàng)目中的所有接口都會(huì)被掃描到none() // 不掃描接口// 通過(guò)方法上的注解掃描,如withMethodAnnotation(GetMapping.class)只掃描get請(qǐng)求withMethodAnnotation(final Class<? extends Annotation> annotation)// 通過(guò)類(lèi)上的注解掃描,如.withClassAnnotation(Controller.class)只掃描有controller注解的類(lèi)中的接口withClassAnnotation(final Class<? extends Annotation> annotation)basePackage(final String basePackage) // 根據(jù)包路徑掃描接口
4、除此之外,我們還可以配置接口掃描過(guò)濾 paths :
//配置了swagger的docket的bean實(shí)例 @Bean public Docket getDocket(Environment environment){return new Docket(DocumentationType.SWAGGER_2).apiInfo(getApiInfo()).select()//RequestHandlerSelectors配置要掃描接口的方式、//basePackage 指定要讓swagger掃描的包//RequestHandlerSelectors 還有any 和none方法//withClassAnnotation 只掃描類(lèi)上有XX注解//withMethodAnnotation 只掃描方法上有XX注解.apis(RequestHandlerSelectors.basePackage('com.wei.swagger.controller'))//paths 過(guò)濾路徑.paths(PathSelectors.ant('/wei/**')).build(); }
5、這里的可選值還有
any() // 任何請(qǐng)求都掃描none() // 任何請(qǐng)求都不掃描regex(final String pathRegex) // 通過(guò)正則表達(dá)式控制ant(final String antPattern) // 通過(guò)ant()控制1.5、配置Swagger開(kāi)關(guān)
1、通過(guò)enable()方法配置是否啟用swagger,如果是false,swagger將不能在瀏覽器中訪問(wèn)了
enable 鏈?zhǔn)骄幊?/p>
@Bean public Docket getDocket(Environment environment){return new Docket(DocumentationType.SWAGGER_2).enable(false)// 關(guān)閉swagger : false。 默認(rèn)ture 開(kāi)啟.apiInfo(getApiInfo()).select()//RequestHandlerSelectors配置要掃描接口的方式、//basePackage 指定要讓swagger掃描的包//RequestHandlerSelectors 還有any 和none方法//withClassAnnotation 只掃描類(lèi)上有XX注解//withMethodAnnotation 只掃描方法上有XX注解.apis(RequestHandlerSelectors.basePackage('com.wei.swagger.controller'))//paths 過(guò)濾路徑.paths(PathSelectors.ant('/wei/**')).build(); }
2、如何動(dòng)態(tài)配置當(dāng)項(xiàng)目處于test、dev環(huán)境時(shí)顯示swagger,處于prod時(shí)不顯示?
@Bean public Docket getDocket(Environment environment){Profiles profiles = Profiles.of('dev','test'); //dev or testSystem.out.println(profiles);//通過(guò)environment.acceptsProfiles(profiles) 判斷是否處在自己設(shè)定的環(huán)境當(dāng)中boolean b = environment.acceptsProfiles(profiles);return new Docket(DocumentationType.SWAGGER_2).enable(b)// 關(guān)閉swagger : false。 默認(rèn)ture 開(kāi)啟.apiInfo(getApiInfo()).select()//RequestHandlerSelectors配置要掃描接口的方式、//basePackage 指定要讓swagger掃描的包//RequestHandlerSelectors 還有any 和none方法//withClassAnnotation 只掃描類(lèi)上有XX注解//withMethodAnnotation 只掃描方法上有XX注解.apis(RequestHandlerSelectors.basePackage('com.wei.swagger.controller'))//paths 過(guò)濾路徑.paths(PathSelectors.ant('/wei/**')).build(); }
3、可以在項(xiàng)目中增加一個(gè)dev的配置文件查看效果!
4、也可以通過(guò)配置文件實(shí)現(xiàn),只是界面顯示不友好。application.properties
spring.profiles.active=prod
application-dev.properties
springfox.documentation.swagger-ui.enabled=true
application-prod.properties
springfox.documentation.swagger-ui.enabled=false
1、如果沒(méi)有配置分組,默認(rèn)是default。通過(guò)groupName()方法即可配置分組:
@Beanpublic Docket docket(Environment environment) { return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()) .groupName('group1') // 配置分組 // 省略配置....}
2、重啟項(xiàng)目查看分組
3、如何配置多個(gè)分組?配置多個(gè)分組只需要配置多個(gè)docket即可:
@Bean public Docket getDocket2(){return new Docket(DocumentationType.SWAGGER_2).groupName('group2'); } @Bean public Docket getDocket3(){return new Docket(DocumentationType.SWAGGER_2).groupName('group3'); }
4、重啟項(xiàng)目查看即可
1.7、實(shí)體配置1、新建一個(gè)實(shí)體類(lèi)
package com.wei.swagger.pojo;import io.swagger.annotations.ApiModel;import io.swagger.annotations.ApiModelProperty;import lombok.Data;@ApiModel('user實(shí)體類(lèi)')@Datapublic class User { @ApiModelProperty('用戶名') private String username; @ApiModelProperty('密碼') private String password;}
2、只要這個(gè)實(shí)體在請(qǐng)求接口的返回值上(即使是泛型),都能映射到實(shí)體項(xiàng)中:
@RequestMapping(value = '/user' , method = RequestMethod.POST) public User user(){return new User(); }
3、重啟查看測(cè)試
注:并不是因?yàn)锧ApiModel這個(gè)注解讓實(shí)體顯示在這里了,而是只要出現(xiàn)在接口方法的返回值上的實(shí)體都會(huì)顯示在這里,而@ApiModel和@ApiModelProperty這兩個(gè)注解只是為實(shí)體添加注釋的。
@ApiModel為類(lèi)添加注釋
@ApiModelProperty為類(lèi)屬性添加注釋
1.8、常用注解Swagger的所有注解定義在io.swagger.annotations包下
下面列一些經(jīng)常用到的,未列舉出來(lái)的可以另行查閱說(shuō)明:
Swagger注解 簡(jiǎn)單說(shuō)明 @Api(tags = “xxx模塊說(shuō)明”) 作用在模塊類(lèi)上 @ApiOperation(“xxx接口說(shuō)明”) 作用在接口方法上 @ApiModel(“xxxPOJO說(shuō)明”) 作用在模型類(lèi)上:如VO、BO @ApiModelProperty(value = “xxx屬性說(shuō)明”,hidden = true) 作用在類(lèi)方法和屬性上,hidden設(shè)置為true可以隱藏該屬性 @ApiParam(“xxx參數(shù)說(shuō)明”) 作用在參數(shù)、方法和字段上,類(lèi)似@ApiModelProperty我們也可以給請(qǐng)求的接口配置一些注釋
@ApiOperation('test請(qǐng)求') @RequestMapping(value = '/test' , method = RequestMethod.GET) public String test(@ApiParam('名字') String name){return 'test '+name; }
測(cè)試結(jié)果如下
給controller添加注釋
@Api(tags = 'hello 控制器')public class HelloController {}
這樣的話,可以給一些比較難理解的屬性或者接口,增加一些配置信息,讓人更容易閱讀!
相較于傳統(tǒng)的Postman或Curl方式測(cè)試接口,使用swagger簡(jiǎn)直就是傻瓜式操作,不需要額外說(shuō)明文檔(寫(xiě)得好本身就是文檔)而且更不容易出錯(cuò),只需要錄入數(shù)據(jù)然后點(diǎn)擊Execute,如果再配合自動(dòng)化框架,可以說(shuō)基本就不需要人為操作了。
Swagger是個(gè)優(yōu)秀的工具,現(xiàn)在國(guó)內(nèi)已經(jīng)有很多的中小型互聯(lián)網(wǎng)公司都在使用它,相較于傳統(tǒng)的要先出Word接口文檔再測(cè)試的方式,顯然這樣也更符合現(xiàn)在的快速迭代開(kāi)發(fā)行情。當(dāng)然了,提醒下大家在正式環(huán)境要記得關(guān)閉Swagger,一來(lái)出于安全考慮二來(lái)也可以節(jié)省運(yùn)行時(shí)內(nèi)存。
總結(jié):1、我們可以通過(guò)swagger給一些比較難理解的屬性或者接口,增加注釋信息2、接口文檔實(shí)時(shí)更新3、可以在線測(cè)試
1.9、拓展:其他皮膚我們可以導(dǎo)入不同的包實(shí)現(xiàn)不同的皮膚定義:
1、默認(rèn)的 訪問(wèn) http://localhost:8080/swagger-ui/
<dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version></dependency>
2、bootstrap-ui 訪問(wèn) http://localhost:8080/doc.html
<!-- 引入swagger-bootstrap-ui包 /doc.html--><dependency> <groupId>com.github.xiaoymin</groupId> <artifactId>swagger-bootstrap-ui</artifactId> <version>1.9.1</version></dependency>
3、Layui-ui 訪問(wèn) http://localhost:8080/docs.html
<!-- 引入swagger-ui-layer包 /docs.html--><dependency> <groupId>com.github.caspar-chen</groupId> <artifactId>swagger-ui-layer</artifactId> <version>1.1.3</version></dependency>
4、mg-ui 訪問(wèn) http://localhost:8080/document.html
<!-- 引入swagger-ui-layer包 /document.html--><dependency> <groupId>com.zyplayer</groupId> <artifactId>swagger-mg-ui</artifactId> <version>1.0.6</version></dependency>
編寫(xiě)方法,假裝正在處理數(shù)據(jù),使用線程設(shè)置一些延時(shí),模擬同步等待的情況;
@Servicepublic class AsyncService { public void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println('業(yè)務(wù)進(jìn)行中....'); }}
3、編寫(xiě)controller包
4、編寫(xiě)AsyncController類(lèi)
我們?nèi)?xiě)一個(gè)Controller測(cè)試一下
@RestControllerpublic class AsyncController { @Autowired AsyncService asyncService; @GetMapping('/hello') public String hello(){ asyncService.hello(); return 'hello!!!ok!!!'; }}
5、訪問(wèn)http://localhost:8080/hello進(jìn)行測(cè)試,3秒后出現(xiàn)hello!!!ok!!!,這是同步等待的情況。
問(wèn)題:我們?nèi)绻胱層脩糁苯拥玫较ⅲ驮诤笈_(tái)使用多線程的方式進(jìn)行處理即可,但是每次都需要自己手動(dòng)去編寫(xiě)多線程的實(shí)現(xiàn)的話,太麻煩了,我們只需要用一個(gè)簡(jiǎn)單的辦法,在我們的方法上加一個(gè)簡(jiǎn)單的注解即可,如下:
6、給hello方法添加@Async注解;
//告訴Spring這是一個(gè)異步方法@Asyncpublic void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.println('業(yè)務(wù)進(jìn)行中....');}
SpringBoot就會(huì)自己開(kāi)一個(gè)線程池,進(jìn)行調(diào)用!但是要讓這個(gè)注解生效,我們還需要在主程序上添加一個(gè)注解@EnableAsync ,開(kāi)啟異步注解功能;
@EnableAsync //開(kāi)啟異步注解功能@SpringBootApplicationpublic class SpringbootTaskApplication { public static void main(String[] args) { SpringApplication.run(SpringbootTaskApplication.class, args); }}
7、重啟測(cè)試,網(wǎng)頁(yè)瞬間響應(yīng),后臺(tái)代碼依舊執(zhí)行!無(wú)需等待AsyncService 的hello 方法走完,可以繼續(xù)執(zhí)行下面的語(yǔ)句。
2.2、郵件任務(wù)郵件發(fā)送,在我們的日常開(kāi)發(fā)中,也非常的多,Springboot也幫我們做了支持郵件發(fā)送需要引入spring-boot-start-mailSpringBoot 自動(dòng)配置MailSenderAutoConfiguration定義MailProperties內(nèi)容,配置在application.yml中自動(dòng)裝配JavaMailSender(實(shí)現(xiàn)類(lèi):JavaMailSenderImpl 來(lái)寫(xiě)代碼)測(cè)試郵件發(fā)送
測(cè)試:
1、引入pom依賴
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-mail</artifactId> </dependency>
2、查看自動(dòng)配置類(lèi):MailSenderAutoConfiguration
這個(gè)類(lèi)中存在bean,JavaMailSenderImpl
然后我們?nèi)タ聪屡渲梦募?/p>
@ConfigurationProperties( prefix = 'spring.mail')public class MailProperties { private static final Charset DEFAULT_CHARSET; private String host; private Integer port; private String username; private String password; private String protocol = 'smtp'; private Charset defaultEncoding; private Map<String, String> properties; private String jndiName;}
3、配置文件:
spring.mail.username=xxx@163.comspring.mail.password=你的163授權(quán)碼spring.mail.host=smtp.163.com# 如果使用qq,需要配置sslspring.mail.properties.mail.smtp.ssl.enable=true
4、Spring單元測(cè)試
package com.wei;import org.junit.jupiter.api.Test;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.mail.SimpleMailMessage;import org.springframework.mail.javamail.JavaMailSenderImpl;import org.springframework.mail.javamail.MimeMessageHelper;import javax.mail.MessagingException;import javax.mail.internet.MimeMessage;import java.io.File;import java.io.IOException;@SpringBootTestclass Springboot09TestApplicationTests { @Autowired JavaMailSenderImpl javaMailSender; @Test void contextLoads() {// 發(fā)送郵件SimpleMailMessage mailMessage = new SimpleMailMessage();mailMessage.setFrom('xxx@163.com');mailMessage.setTo('xxx@163.com');mailMessage.setSubject('subject2..');mailMessage.setText('text2...');javaMailSender.send(mailMessage); } @Test void contextLoads2() throws MessagingException, IOException {// 發(fā)送復(fù)雜的郵件MimeMessage mimeMessage = javaMailSender.createMimeMessage();// 組裝MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true); // true ,支持多組件 multiparthelper.setSubject('subject');helper.setText('<h1 style=’color:red’>test 復(fù)雜郵件</h1>',true); // true ,支持html//附件String fileName = this.getClass().getClassLoader().getResource('1.jpg').getPath(); // 獲取resources下的絕對(duì)路徑helper.addAttachment('1.jpg', new File(fileName));helper.addAttachment('2.jpg', new File(fileName));helper.setFrom('xxx@163.com'); //發(fā)送helper.setTo('xxx@163.com'); //接收javaMailSender.send(mimeMessage); }}
contextLoads 結(jié)果
contextLoads2 結(jié)果
查看郵箱,郵件接收成功!
我們只需要使用Thymeleaf進(jìn)行前后端結(jié)合即可開(kāi)發(fā)自己網(wǎng)站郵件收發(fā)功能了!
2.3、定時(shí)任務(wù)項(xiàng)目開(kāi)發(fā)中經(jīng)常需要執(zhí)行一些定時(shí)任務(wù),比如需要在每天凌晨的時(shí)候,分析一次前一天的日志信息,Spring為我們提供了異步執(zhí)行任務(wù)調(diào)度的方式,提供了兩個(gè)接口。
TaskExecutor接口 TaskScheduler接口兩個(gè)注解:
@EnableScheduling @Scheduledcron表達(dá)式參考:https://www.cnblogs.com/javahr/p/8318728.html
測(cè)試步驟:
1、創(chuàng)建一個(gè)ScheduledService
我們里面存在一個(gè)hello方法,他需要定時(shí)執(zhí)行,怎么處理呢?
import org.springframework.scheduling.annotation.Scheduled;import org.springframework.stereotype.Service;@Servicepublic class ScheduledService { //在一個(gè)特定的時(shí)間執(zhí)行這個(gè)方法 @Scheduled(cron = '秒 分 時(shí) * * ?') public void hello(){System.out.println('hello 執(zhí)行了'); }}
2、這里寫(xiě)完定時(shí)任務(wù)之后,我們需要在主程序上增加@EnableScheduling 開(kāi)啟定時(shí)任務(wù)功能
@EnableAsync //開(kāi)啟異步注解功能@EnableScheduling //開(kāi)啟基于注解的定時(shí)任務(wù)@SpringBootApplicationpublic class SpringbootTaskApplication { public static void main(String[] args) { SpringApplication.run(SpringbootTaskApplication.class, args); }}
3、表達(dá)式生成器
http://www.bejson.com/othertools/cron/
4、常用的表達(dá)式
(1)0/2 * * * * ? 表示每2秒 執(zhí)行任務(wù)(1)0 0/2 * * * ? 表示每2分鐘 執(zhí)行任務(wù)(1)0 0 2 1 * ? 表示在每月的1日的凌晨2點(diǎn)調(diào)整任務(wù)(2)0 15 10 ? * MON-FRI 表示周一到周五每天上午10:15執(zhí)行作業(yè)(3)0 15 10 ? 6L 2002-2006 表示2002-2006年的每個(gè)月的最后一個(gè)星期五上午10:15執(zhí)行作(4)0 0 10,14,16 * * ? 每天上午10點(diǎn),下午2點(diǎn),4點(diǎn)(5)0 0/30 9-17 * * ? 朝九晚五工作時(shí)間內(nèi)每半小時(shí)(6)0 0 12 ? * WED 表示每個(gè)星期三中午12點(diǎn)(7)0 0 12 * * ? 每天中午12點(diǎn)觸發(fā)(8)0 15 10 ? * * 每天上午10:15觸發(fā)(9)0 15 10 * * ? 每天上午10:15觸發(fā)(10)0 15 10 * * ? 每天上午10:15觸發(fā)(11)0 15 10 * * ? 2005 2005年的每天上午10:15觸發(fā)(12)0 * 14 * * ? 在每天下午2點(diǎn)到下午2:59期間的每1分鐘觸發(fā)(13)0 0/5 14 * * ? 在每天下午2點(diǎn)到下午2:55期間的每5分鐘觸發(fā)(14)0 0/5 14,18 * * ? 在每天下午2點(diǎn)到2:55期間和下午6點(diǎn)到6:55期間的每5分鐘觸發(fā)(15)0 0-5 14 * * ? 在每天下午2點(diǎn)到下午2:05期間的每1分鐘觸發(fā)(16)0 10,44 14 ? 3 WED 每年三月的星期三的下午2:10和2:44觸發(fā)(17)0 15 10 ? * MON-FRI 周一至周五的上午10:15觸發(fā)(18)0 15 10 15 * ? 每月15日上午10:15觸發(fā)(19)0 15 10 L * ? 每月最后一日的上午10:15觸發(fā)(20)0 15 10 ? * 6L 每月的最后一個(gè)星期五上午10:15觸發(fā)(21)0 15 10 ? * 6L 2002-2005 2002年至2005年的每月的最后一個(gè)星期五上午10:15觸發(fā)(22)0 15 10 ? * 6#3 每月的第三個(gè)星期五上午10:15觸發(fā)
到此這篇關(guān)于springboot中swagger、異步/定時(shí)/郵件任務(wù)的問(wèn)題的文章就介紹到這了,更多相關(guān)springboot swagger內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. css進(jìn)階學(xué)習(xí) 選擇符2. python實(shí)現(xiàn)自動(dòng)化辦公郵件合并功能3. Python 如何將integer轉(zhuǎn)化為羅馬數(shù)(3999以內(nèi))4. python爬蟲(chóng)beautifulsoup解析html方法5. python web框架的總結(jié)6. 以PHP代碼為實(shí)例詳解RabbitMQ消息隊(duì)列中間件的6種模式7. 解決python logging遇到的坑 日志重復(fù)打印問(wèn)題8. html小技巧之td,div標(biāo)簽里內(nèi)容不換行9. Python基礎(chǔ)之numpy庫(kù)的使用10. 詳解Python模塊化編程與裝飾器
