生活随笔
收集整理的這篇文章主要介紹了
SSH开发注意
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
今日筆記
idea提交注意事項 有可視化界面 快速操作 去除無用的引用、格式化代碼…
代碼盡量不要格式化,手寫規范代碼格式,養成良好習慣
后端不要直接傳實體類對象給前端
通過 map 把對象轉換成DTO
@GetMapping({"/group/details"})public ResponseEntity
findAllByPage(@RequestParam(defaultValue
= "0") Integer page
,@RequestParam(defaultValue
= "10") Integer size
,@RequestParam(defaultValue
= "") String title
) {Pageable pageable
= PageRequest
.of(page
- 1, size
, Sort
.by(Sort
.Order
.desc("createTime")));Page
< GroupDetails> data
= service
.findAllByPage("%" + title
+ "%", pageable
);return ResponseEntity
.ok(data
.map( groupDetails
-> new GroupDetailsDTO(groupDetails
.getPid(),groupDetails
.getOrgPid(),groupDetails
.getGroupName(),groupDetails
.getGroupDesc())));}
Java中 不要用 == 去比較數字
總結
以上是生活随笔為你收集整理的SSH开发注意的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。