2017-3-29_工作报告

工作内容

  • 熟悉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数据

 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);  // 格式化角色名
},
2017-3-29_工作报告_第1张图片
QQ20170329-195453.png

总结

  • 进展
  • 熟悉了下springboot框架,能新增一些api接口
  • 完成了ifish后台页面供应商公司显示的需求

你可能感兴趣的:(2017-3-29_工作报告)