美文网首页
3、proto使用

3、proto使用

作者: 懒羊羊3号 | 来源:发表于2018-11-10 16:00 被阅读0次

一、原版
1、PBInterfaceChangeLog(interfaceId,content required) --> void
有id,content不能为空

export function interfaceChangeLogAdd (interfaceId, content) {
  const pbReq = proto.create('fw.PBInterfaceChangeLog', { interfaceId: +interfaceId, content })
  return request('apiDocumentInterfaceChangeLogAdd', pbReq)
}
        interfaceChangeLogAdd(this.selectedId, this.form.content)
          .then((res) => {
            console.log(res)
          }).catch((err) => {
            console.log(err)
          })

2、只传id,PBIntValue(interfaceId) --> void

export function interfaceDeprecated (interfaceId) {
  const pbReq = proto.create('framework.PBIntValue', { value: +interfaceId })
  return request('apiDocumentInterfaceDeprecated', pbReq)
}
        interfaceDeprecated(id)
          .then(() => {
            console.log('成功弃用')
          }).catch((err) => {
            console.log(err)
          })

二、新版
1、PBRenewalSendNotifyReq(renewalId,contacts required) --> void

customerApi.sendNotifyReq = (id, contacts) => {
  const pbReq = proto.create('fw.PBRenewalSendNotifyReq', { renewalId: Number(id), contacts })
  return request('renewalSendNotify', pbReq)
}
        return customerApi.getCustomerContactList(this.selectedRow.customer.user.id).then((res) => {
          this.contacts = res.contacts
        }).catch(this.errorHandler)

相关文章

网友评论

      本文标题:3、proto使用

      本文链接:https://www.haomeiwen.com/subject/amvmiftx.html