@@ -77,7 +77,7 @@ namespace YhCore.WebApi.Controllers.Api.Common
|
||||
|
||||
/// <summary>添加字典。</summary>
|
||||
[HttpPost("AddDic")]
|
||||
public async Task AddDic([FromForm] Common_Dictionary model)
|
||||
public async Task AddDic([FromBody] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数错误!");
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace YhCore.WebApi.Controllers.Api.Common
|
||||
|
||||
/// <summary>更新字典。</summary>
|
||||
[HttpPost("UpdateDic")]
|
||||
public async Task UpdateDic([FromForm] Common_Dictionary model)
|
||||
public async Task UpdateDic([FromBody] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数有误!");
|
||||
model.Schserid = SchSerID();
|
||||
@@ -103,7 +103,7 @@ namespace YhCore.WebApi.Controllers.Api.Common
|
||||
|
||||
/// <summary>编辑字典名称。</summary>
|
||||
[HttpPost("EditDic")]
|
||||
public async Task EditDic([FromForm] Common_Dictionary model)
|
||||
public async Task EditDic([FromBody] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数有误!");
|
||||
model.Schserid = SchSerID();
|
||||
@@ -112,7 +112,7 @@ namespace YhCore.WebApi.Controllers.Api.Common
|
||||
|
||||
/// <summary>添加发文部门。</summary>
|
||||
[HttpPost("AddDeptDic")]
|
||||
public async Task AddDeptDic([FromForm] Common_Dictionary model)
|
||||
public async Task AddDeptDic([FromBody] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数有误!");
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace YhCore.WebApi.Controllers.Api.Common
|
||||
|
||||
/// <summary>更新发文部门。</summary>
|
||||
[HttpPost("UpdateDeptDic")]
|
||||
public async Task UpdateDeptDic([FromForm] Common_Dictionary model)
|
||||
public async Task UpdateDeptDic([FromBody] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数有误!");
|
||||
model.Schserid = SchSerID();
|
||||
|
||||
@@ -86,7 +86,11 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[HttpPost("AddDictionaryType")]
|
||||
public async Task AddDictionaryType([FromForm] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数错误!");
|
||||
// 表单绑定实例不会为 null,但字段名拼错(如 TypelD≠TypeId)时必填列会为 null,
|
||||
// SaveChanges 才抛"不能将 NULL 插入列"(code:6 无从排查)——在入口显式校验给出可读错误。
|
||||
if (model == null || string.IsNullOrWhiteSpace(model.typeID)
|
||||
|| string.IsNullOrWhiteSpace(model.typeName) || string.IsNullOrWhiteSpace(model.Name))
|
||||
throw new DException("参数错误:typeID、typeName、Name 均不能为空(注意表单字段名拼写,TypeId≠TypelD)");
|
||||
model.Schserid = SchSerID();
|
||||
await _dict.AddDicAsync(model);
|
||||
}
|
||||
@@ -95,7 +99,9 @@ namespace YhCore.WebApi.Controllers.Api.DocPrint
|
||||
[HttpPost("EditDictionaryType")]
|
||||
public async Task EditDictionaryType([FromForm] Common_Dictionary model)
|
||||
{
|
||||
if (model == null) throw new DException("参数有误!");
|
||||
if (model == null || model.SerID <= 0 || string.IsNullOrWhiteSpace(model.typeID)
|
||||
|| string.IsNullOrWhiteSpace(model.typeName) || string.IsNullOrWhiteSpace(model.Name))
|
||||
throw new DException("参数错误:SerID、typeID、typeName、Name 均不能为空(注意表单字段名拼写,TypeId≠TypelD)");
|
||||
model.Schserid = SchSerID();
|
||||
await _dict.EditDicAsync(model);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"Enabled": true,
|
||||
"BaseHost": "http://base.yunhaixingtong.com",
|
||||
"BasePath": "/userbase",
|
||||
"SchClassPath": "/bschclass",
|
||||
"SchClassPath": "/userclass",
|
||||
"AppKey": "100002",
|
||||
"AppSecret": "2314a3b158b24a838b2b9b69fd3db118"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user