# 引入方式

```java
import com.weaver.ebuilder.form.client.service.button.ButtonDubboService;

@RpcReference(group = "ebuilderform")
private ButtonDubboService buttonDubboService;
```

## 1.新增或更新方法

```java
public Button saveOrUpdateButton(Button button, List<ButtonAction> actionDatas, List<ButtonPermission> permissionDatas, User user)
```

请求入参示例：（根据button.id是否有值来判断是新增还是修改），根据json示例封装java入参

```javascript

{
  "button":{
    "name":"自定义按钮",
    "showPosition":"{\"add_form\":[\"rightTop\"],\"791020267489353733_table\":[\"rightTop\"]}",
    "conditionEnable":0,
    "iconPath":"{\"path\":\"#icon-1-o\",\"style\":{\"color\":\"#999\",\"bgColor\":\"\"}}",
    "onlyIcon":1,
    "enable":1,
    "operateType":"1",
    "showPositionSpan":{
      "str":{
        "table":["选项模板测试"],
        "form":["add"]
      },
      "obj":{
        "table":[
          {
            "id":"791020267489353733",
            "content":"选项模板测试"
          }
        ],
        "form":[
          {
            "id":"add",
            "content":"add"
          }
        ]
      }
    },
    "objId":"791020263269883904"
  },
  "actionDatas":[
    {
      "name":"",
      "conditionTxt":"",
      "id":"-1667896273920",
      "enable":1,
      "actionType":"openpage",
      "buttonId":"",
      "windowSize":60,
      "url":"{\"openMode\":\"0\",\"name\":\"新建布局(选项模板测试)\",\"page\":{\"pageId\":\"1/791020263269883904\",\"openMode\":\"0\",\"pageName\":\"新建布局(选项模板测试)\",\"pageType\":\"LAYOUT\",\"appid\":\"765346043919056897\",\"pageViewType\":\"1\"},\"params\":[]}",
      "openType":"1",
      "index":0,
      "interfacePath":"",
      "desc":"",
      "urlType":"0",
      "urlFieldId":"",
      "interfaceType":"",
      "scene":"[]"
    }
  ],
  "permissionDatas":[
    {
      "id":"",
      "permissionType":"resource",
      "contentSpan":"曾浩",
      "content":"5112805398549849402",
      "levelScope":{
        "minShowlevel":"",
        "maxShowlevel":""
      },
      "relation":"0",
      "jobLevel":"",
      "jobLevelText":"",
      "jobLevelTextSpan":"",
      "condition":{
        "conditionsql":""
      }
    }
  ]
}
```

## 2.删除方法

```java
public void deleteButton(Long buttonId, User user)
```

## 3.根据表单id获取所有按钮信息

```java
public List<Button> getAllButtonByObjId(Long objId, User user)
```
