多表格合并一起
989
2022-05-30
看到一個spring-boot開源項目,感覺寫得不錯,打算花一些時間分析分析,首先從使用到的注解角度初步的看看;
## Swagger
https://github.com/swagger-api/swagger-core/wiki/annotations
@Api 標記一個類為Swagger資源
@ApiParam 為操作參數添加額外的meta數據
@ApiModelProperty 添加和操作model屬性數據
@ApiOperation 描述一個操作,典型的是一個特定路徑的http請求
@ApiResponse 描述操作可能的響應
@ApiIgnore
## spring/spring-boot
https://www.baeldung.com/spring-core-annotations? https://www.javatpoint.com/spring-boot-annotations
@Autowired ?標記一個spring會去查找和注入的依賴
@Bean 標記一個組裝spring bean的工廠方法
@Qualifier 和@Autowired一起提供一個bean的id或者name
https://www.baeldung.com/spring-annotations-resource-inject-autowire? https://stackoverflow.com/questions/4093504/resource-vs-autowired
@Resource 來自JSR標準 @Value 注入屬性到beans中,可以在構造,設置和段注入
@Primary 當我們需要定義多個同一種類型的beans時,注入會因為不知道需要那個bean而失敗,我們已經看到一個可選的方法:使用@Qualifier標記所有注入點,指定給bean特定的名稱;然而,大多數時候我們只需要一個特定的bean而不是別的。我們可以用@Primary去簡化這種場景。
@ImportResource 我們可以導入xml配置通過這個注解
@Component 這是個類級別的注解。它用來標記一個類為bean
https://www.baeldung.com/spring-postconstruct-predestroy
@PostConstruct spring只會調用@PostConstruct一次,在初始化bean的屬性之后。可以是任意的訪控屬性,但不能是靜態的。
@Transactional
@DateTimeFormat 用于在請求層級轉換日期參數格式 - https://www.baeldung.com/spring-date-parameters
@Controller 這是個類級別的注解。它是一種特殊化的@Component。它標記一個類為網絡請求處理器。通常和@RequestMapping一同使用
@ControllerAdvice
@Service 這是個類級別的注解。它告訴Spring這個類包含業務邏輯。
## spring Mvc and Rest Annotation
@RequestMapping 它用來映射網絡請求。它有許多可選元素consumes, header, method, name, params, path, produces, and value
@GetMapping 它映射一個HTTP GET請求到一個特定的處理方法。它取代了@RequestMapping(method = RequestMethod.GET)
@PostMapping 它映射一個HTTP POST請求一個特定的處理方法。他取代了@RequestMapping(method = RequestMethod.POST)
@RequestBody 它用來綁定一個對象到方法形參給HTTP請求。內部使用HTTP消息轉換器轉換一個請求的消息體。
@ResponseBody ?它綁定了一個返回值到相應體。它告訴spring boot框架去序列化一個返回對象到JSON和XML格式。
@RequestParam 它用來從URL中解析出query參數。
@RestController 它可以被認為是@Controller 和 @ResponseBody的組合。
## springboot anno
@Configuration
@SpringBootApplication 它是@EnableAutoConfiguration, @ComponentScan, 和 @Configuration的組合。
@ComponentScan
@ComponentScan.Filter
@EnableDiscoveryClient
@ConditionalOnMissingBean
@ConditionalOnProperty
## spring aop
@Aspect 作用是把當前類標識為一個切面供容器讀取
@After final增強,不管是拋出異常或者正常退出都會執行
@Before 標識一個前置增強方法,相當于BeforeAdvice的功能,相似功能的還有
@Pointcut Pointcut是植入Advice的觸發條件。
https://www.baeldung.com/java-default-annotations
@Retention
@Target
https://stackoverflow.com/questions/49624930/how-to-enable-requirespermissions-in-spring-mvc-project ? https://blog.csdn.net/qi923701/article/details/75224554 ? https://zhuanlan.zhihu.com/p/37870725
@RequiresPermissions
## JPA
https://www.cnblogs.com/xuwenjin/p/8830850.html https://stackoverflow.com/questions/37729770/what-is-the-use-of-table-annotation-in-jpa ? https://www.baeldung.com/jpa-entity-table-names
@Table
@Id
@Column
@GeneratedValue
@Transient
## poiji - excel 解析
@ExcelCell
@ExcelCellName
@ExcelRow
@ExcelTable
@ExcelWidths
https://github.com/ozlerhakan/poiji ?? https://www.wanaright.com/2020/04/10/annotation-poi-excel/? https://stackoverflow.com/questions/58981017/java-excel-pojo-mapping-in-poi
## spring kafka
@EnableKafka
@KafkaListener
https://www.baeldung.com/spring-kafka
## Jackson
@JsonFormat
@JsonIgnore
@JsonProperty
@JsonSerialize
@JacksonAnnotationsInside
@JsonIgnoreProperties
https://dzone.com/articles/jackson-annotations-for-json-part-4-general https://www.baeldung.com/jackson-jsonformat
## javax anno
@Max ?被注釋的元素必須是一個數字,其值必須大于等于指定的最小值
@Min 被注釋的元素必須是一個數字,其值必須小于等于指定的最大值
@NotNull 注釋的元素不能為null,可以為空字符串
@Nonnull
@Nullable
@Valid
@Pattern 被注釋的元素必須符合指定的正則表達式。
@CheckForNull
https://blog.csdn.net/weixin_30439067/article/details/98076558 https://www.jianshu.com/p/32327ca2365f
## feign 一個java httpclient綁定
@EnableFeignClients
@Param
@RequestLine
@Headers
@HeaderMap
https://github.com/OpenFeign/feign? https://stackoverflow.com/questions/43868680/feign-client-does-not-resolve-query-parameter
##?JUnit
@DisplayName
@Test
https://www.journaldev.com/21674/junit-display-name-displayname
## 其他技術棧分析
swagger整合spring mvc教程
https://blog.csdn.net/wangjun5159/article/details/47283125
spring后端國際化
https://www.logicbig.com/tutorials/spring-framework/spring-core/message-sources.html https://stackoverflow.com/questions/2952196/ant-path-style-patterns/22636142#22636142
在 Spring Boot 項目中使用 Swagger 文檔
https://developer.ibm.com/zh/articles/j-using-swagger-in-a-spring-boot-project/ https://github.com/swagger-api/swagger-codegen
spring 過濾器、-
jedisLock
https://redis.io/topics/distlock https://github.com/kaidul/jedis-lock/blob/master/src/main/java/com/github/jedis/lock/JedisLock.java
MyBatis Redis Extension
https://github.com/mybatis/redis-cache http://mybatis.org/mybatis-3/sqlmap-xml.html#cache https://redis.io/commands#hash https://spring.io/projects/spring-data-redis
MyBatis 通用 Mapper4 https://github.com/abel533/Mapper
Spring Boot API Project Seed、根據數據表名稱生成對應的Model、Mapper、Service、Controller
https://blog.csdn.net/qq_36857572/article/details/81143014 https://www.jianshu.com/p/9962be89e2cf https://juejin.cn/post/6844903598422245383 https://github.com/lihengming/spring-boot-api-project-seed MyBatis Pagination - PageHelper https://github.com/pagehelper/Mybatis-PageHelper
mybatis 二級緩存
https://blog.csdn.net/xiaolyuh123/article/details/73912617 https://stackoverflow.com/questions/31760648/get-all-keys-from-spring-reloadableresourcebundlemessagesource/31761884#31761884
通過User-Agent判斷瀏覽器環境版本
https://blog.csdn.net/fzy629442466/article/details/84784940 http://www.useragentstring.com/pages/useragentstring.php?name=Internet+Explorer https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox
elasticsearch 基于luence的非結構化索引庫
https://www.elastic.co/guide/en/elasticsearch/reference/6.5/search-template.html
權重
https://www.elastic.co/guide/en/elasticsearch/guide/current/scoring-theory.html https://www.quora.com/What-is-inverted-index-It-is-a-well-known-fact-that-you-need-to-build-indexes-to-implement-efficient-searches-What-is-the-difference-between-index-and-inverted-index-and-how-does-one-build-inverted-index
IK分詞
https://github.com/medcl/elasticsearch-analysis-ik
Prefix與keyword分詞器
Ngram與edge-Ngram分詞器
Excel生成
https://spreadsheet.dsl.builders/
Excel sheets 轉換 Java classes
https://github.com/ozlerhakan/poiji
Feign一款基于注解與動態代理的HTTP Client。
https://github.com/OpenFeign/feign
Jackson Annotations for JSON (Part 4): General Annotations
https://dzone.com/articles/jackson-annotations-for-json-part-4-general https://github.com/thymeleaf/thymeleaf/issues/623 http://www.scienjus.com/get-field-annotation-property-by-jackson-contextualserializer/
Intro to Apache Kafka with Spring
https://www.baeldung.com/spring-kafka
Service(Mybatis/Eureka)
Eureka: 一款命名服務平臺,輸入是名稱,返回是IP列表
https://spring.io/guides/gs/service-registration-and-discovery/ https://medium.com/swlh/spring-cloud-service-discovery-with-eureka-16f32068e5c7
Ribbon:客戶端負載均衡
https://www.baeldung.com/spring-cloud-rest-client-with-netflix-ribbon https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-ribbon.html https://howtodoinjava.com/spring-cloud/spring-boot-ribbon-eureka/
Swagger/SwaggerGenerator
java項目代碼風格
https://github.com/google/google-java-format intellij-java-google-style.xml
sonarqube代碼檢查
https://github.com/SonarSource/sonarqube
敏捷團隊jira/rally
https://www.atlassian.com/zh/software/jira/comparison/jira-vs-rally
closure壓縮,其實感覺現在很多前端框架已經采用webpack、gulp壓縮打包,這個似乎沒必要了、
https://github.com/google/closure-compiler/
Java 軟件開發
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。