save<T extends IModel> static method
Directly save json data.
T
The type of a model, which should implement IModel to implement the toJson method.
formId
The formId of the bill or basedata.
model
Data.
isDeleteEntry
Before saving, it is wheter delete the entry.
isAutoSubmitAndAudit
Whehter to automatic audit.
@return A response result by parsing json.
Implementation
static Future<ResponseStatus> save<T extends IModel>(
String formId, T model,
{
bool isDeleteEntry=true,
bool isAutoSubmitAndAudit=false,
List<String>? needUpDateFields,
List<String>? needReturnFields,
}) async {
var resp = await K3Client.getInstance().operate(
SaveParam.builder()
.formId(formId)
.isDeleteEntry(isDeleteEntry)
.isAutoSubmitAndAudit(isAutoSubmitAndAudit)
.needUpDateFields(needUpDateFields)
.needReturnFields(needReturnFields)
.model(model.toJson())
.build()
);
return ResponseStatus.fromJson(resp);
}