add interface: create, delete field and create datasheet#22
Merged
shawndenggh merged 15 commits intovikadata:masterfrom May 24, 2022
y-t99:master
Merged
add interface: create, delete field and create datasheet#22shawndenggh merged 15 commits intovikadata:masterfrom y-t99:master
shawndenggh merged 15 commits intovikadata:masterfrom
y-t99:master
Conversation
yort-feng
suggested changes
May 23, 2022
README.md
Outdated
| // add description to datasheet | ||
| request.setDescription("description"); | ||
| // specify the folder where the datasheet is stored | ||
| request.setFolderId("fod_id"); |
|
|
||
| private void checkDeleteFieldPathArgs(String spaceId, String datasheetId, String fieldId) { | ||
| if (!StringUtil.hasText(spaceId)) { | ||
| throw new ApiException("space id must be not null"); |
There was a problem hiding this comment.
must be not null——> must not be null
README.md
Outdated
| .withProperty(singleTextFieldProperty) | ||
| .build(); | ||
| // request to create a field | ||
| CreateFieldResponse response = vikaApiClient.getFieldApi().addField("space_id", "datasheet_id", request); |
There was a problem hiding this comment.
request object参数保持跟其他示例统一名字:xxxxRequest,比如createFieldRequest。
README.md
Outdated
| request.setFields(fields); | ||
|
|
||
| // request to create a datasheet | ||
| CreateDatasheetResponse response = vikaApiClient.getDatasheetApi().addDatasheet("space_id", request); |
There was a problem hiding this comment.
request object参数保持跟其他示例统一名字:xxxxRequest,比如createDatasheetRequest。
| public class MagicLinkFieldProperty extends BaseFieldProperty { | ||
|
|
||
| private String foreignDatasheetId; | ||
|
|
| * Format about Currency | ||
| * @see cn.vika.client.api.model.field.property.option.CurrencyFormat | ||
| */ | ||
| Currency("Currency"), |
| /** | ||
| * @author tao | ||
| */ | ||
| public abstract class TypeFormat { |
| /** | ||
| * @author tao | ||
| */ | ||
| public enum TimeFormatEnum { |
| @@ -49,6 +49,10 @@ public class VikaApiClient { | |||
|
|
|||
| private NodeApi nodeApi; | |||
There was a problem hiding this comment.
赞!双重检查锁定模式需要需要使用 volatile,之前用到双重锁的地方也加上volatile吧。解决两个问题:
保证可见性。使用 volatile 定义的变量,将会保证对所有线程的可见性
禁止指令重排序优化
README.md
Outdated
| > more detail about field type and property of field see official [API manual#create-field](https://vika.cn/developers/api/reference/#operation/create-fields) | ||
|
|
||
| ```java | ||
| // Example 1: create SingleText field |
There was a problem hiding this comment.
两个Example拆分成两个代码块,参考update record的两个Example
yort-feng
suggested changes
May 24, 2022
| */ | ||
| public enum FieldTypeEnum { | ||
| /** | ||
| * |
yort-feng
approved these changes
May 24, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add
field.create,field.deleteanddatasheet.createinterface and test example.