工作內容
- 熟悉ifish后臺springboot框架
- 后端新增通過user_id獲取vendor的接口
- ifish后臺頁面新增顯示vendor信息功能
參照RESTful API來定義接口地址
@RequestMapping(value = "/vendors", method = RequestMethod.GET)
public ResponseEntity getVendorByUserId(@RequestParam("userId") Long userId, HttpServletRequest request) {
return new ResponseEntity<>(vendorService.findByUserId(userId), HttpStatus.OK);
}
通過判斷role來決定是否獲取vendor數(shù)據(jù)
handleViewUser(row) {
this.dialogUserInfoVisible = true;
if (row.role === 'VENDOR' || row.role === '供應商') {
axios.get(`${API.ifish_vendors}?userId=${row.id}`)
.then((res) => {
this.userInfo.company = res.data.company;
this.userInfo.companyAddress = res.data.companyAddress;
});
}
this.userInfo.email = row.email;
this.userInfo.mobile = row.mobile;
this.userInfo.role = this.formatRole(row); // 格式化角色名
},
總結
- 進展
- 熟悉了下springboot框架,能新增一些api接口
- 完成了ifish后臺頁面供應商公司顯示的需求