非rest传参
load () {
this.loading = true
transferList({ accountType: this.type, symbol: this.symbol }).then(data => {
this.order = data
this.loading = false
})
}
Rest传参[Get]
java代码
@GetMapping("/getFixedById/{id}")
@Inner(false)
public FixedInvestmentVO getFixedById(@PathVariable Integer id) {
return fixedInvestmentService.getFixedById(id);
}
vue代码
export function getFixedById (id) {
let url = '/matrix/api/fixedinvestment/getFixedById/' + id;
return request ({
url: url,
method: 'GET'
})
}
Rest传参[Post],参数为实体,实体类中包含List属性
java
/**
* 查询交易明细
* @param dto
* @return
*/
@PostMapping("findTradeInfo")
public R<List<MixDualRecordVO>> findTradeInfo(@RequestBody SimpleTradeInfoDTO dto) {
List<MixDualRecordVO> records=service.search(dto);
return R.ok(records);
}
/**
* @author: leo
* @date: 2022/6/16
*/
@Data
public class SimpleTradeInfoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private List<Integer> status;
private String keyWord;
private Long uid;
}
vue-data
simpleTradeInfoDTO: {
status: [],
keyWord: ''
},