修复升级.net 9后webapi controller参数为空

This commit is contained in:
wintel 2024-12-02 20:52:35 +08:00
parent b17be2c2a0
commit beaf0e5200
23 changed files with 56 additions and 56 deletions

View File

@ -30,7 +30,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Assign(AssignReq request)
public Response Assign([FromBody] AssignReq request)
{
var result = new Response();
try
@ -49,7 +49,7 @@ namespace OpenAuth.WebApi.Controllers
/// 取消关联
/// </summary>
[HttpPost]
public Response UnAssign(AssignReq request)
public Response UnAssign([FromBody] AssignReq request)
{
var result = new Response();
try
@ -70,7 +70,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response AssignDataProperty(AssignDataReq request)
public Response AssignDataProperty([FromBody] AssignDataReq request)
{
var result = new Response();
try
@ -94,7 +94,7 @@ namespace OpenAuth.WebApi.Controllers
/// <returns></returns>
private static string lockobj = "lock";
[HttpPost]
public Response UnAssignDataProperty(AssignDataReq request)
public Response UnAssignDataProperty([FromBody] AssignDataReq request)
{
var result = new Response();
try
@ -118,7 +118,7 @@ namespace OpenAuth.WebApi.Controllers
/// 角色分配用户,整体提交,会覆盖之前的配置
/// </summary>
[HttpPost]
public Response AssignRoleUsers(AssignRoleUsers request)
public Response AssignRoleUsers([FromBody] AssignRoleUsers request)
{
var result = new Response();
try
@ -138,7 +138,7 @@ namespace OpenAuth.WebApi.Controllers
/// 部门分配用户,整体提交,会覆盖之前的配置
/// </summary>
[HttpPost]
public Response AssignOrgUsers(AssignOrgUsers request)
public Response AssignOrgUsers([FromBody] AssignOrgUsers request)
{
var result = new Response();
try

View File

@ -40,7 +40,7 @@ namespace OpenAuth.WebApi.Controllers
//修改
[HttpPost]
public Response Update(AddOrUpdateBuilderTableColumnReq obj)
public Response Update([FromBody] AddOrUpdateBuilderTableColumnReq obj)
{
var result = new Response();
try
@ -62,7 +62,7 @@ namespace OpenAuth.WebApi.Controllers
/// <para>读取数据库结构与当前结构的差异,如果数据库有新增的字段,则自动加入</para>
/// </summary>
[HttpPost]
public Response Sync(SyncStructureReq obj)
public Response Sync([FromBody] SyncStructureReq obj)
{
var result = new Response();
try

View File

@ -25,7 +25,7 @@ namespace OpenAuth.WebApi.Controllers
/// <returns>返回添加的模版ID</returns>
/// </summary>
[HttpPost]
public Response<string> Add(AddOrUpdateBuilderTableReq obj)
public Response<string> Add([FromBody] AddOrUpdateBuilderTableReq obj)
{
var result = new Response<string>();
try
@ -48,7 +48,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Update(AddOrUpdateBuilderTableReq obj)
public Response Update([FromBody] AddOrUpdateBuilderTableReq obj)
{
var result = new Response();
try
@ -110,7 +110,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response CreateEntity(CreateEntityReq obj)
public Response CreateEntity([FromBody] CreateEntityReq obj)
{
var result = new Response();
try
@ -133,7 +133,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response CreateBusiness(CreateBusiReq obj)
public Response CreateBusiness([FromBody] CreateBusiReq obj)
{
var result = new Response();
try
@ -156,7 +156,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response CreateVue(CreateVueReq obj)
public Response CreateVue([FromBody] CreateVueReq obj)
{
var result = new Response();
try

View File

@ -20,7 +20,7 @@ using OpenAuth.App.Response;
//添加
[HttpPost]
public Response Add(AddOrUpdateCategoryTypeReq obj)
public Response Add([FromBody] AddOrUpdateCategoryTypeReq obj)
{
var result = new Response();
try
@ -39,7 +39,7 @@ using OpenAuth.App.Response;
//修改
[HttpPost]
public Response Update(AddOrUpdateCategoryTypeReq obj)
public Response Update([FromBody] AddOrUpdateCategoryTypeReq obj)
{
var result = new Response();
try

View File

@ -46,7 +46,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Add(AddOrUpdateCategoryReq obj)
public Response Add([FromBody] AddOrUpdateCategoryReq obj)
{
var result = new Response();
try
@ -68,7 +68,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Update(AddOrUpdateCategoryReq obj)
public Response Update([FromBody] AddOrUpdateCategoryReq obj)
{
var result = new Response();
try

View File

@ -337,7 +337,7 @@ namespace OpenAuth.WebApi.Controllers
/// <returns></returns>
[HttpPost]
[AllowAnonymous]
public LoginResult Login(PassportLoginRequest request)
public LoginResult Login([FromBody] PassportLoginRequest request)
{
var result = new LoginResult();
try

View File

@ -45,7 +45,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Add(AddOrUpdateDataPriviReq obj)
public Response Add([FromBody] AddOrUpdateDataPriviReq obj)
{
var result = new Response();
try
@ -67,7 +67,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Update(AddOrUpdateDataPriviReq obj)
public Response Update([FromBody] AddOrUpdateDataPriviReq obj)
{
var result = new Response();
try

View File

@ -69,7 +69,7 @@ namespace OpenAuth.WebApi.Controllers
/// <returns>服务器存储的文件信息</returns>
[HttpPost]
[AllowAnonymous]
public Response<IList<UploadFile>> Upload(IFormFileCollection files)
public Response<IList<UploadFile>> Upload([FromForm] IFormFileCollection files)
{
var result = new Response<IList<UploadFile>>();
try
@ -93,7 +93,7 @@ namespace OpenAuth.WebApi.Controllers
/// <returns>服务器存储的文件信息</returns>
[HttpPost]
[AllowAnonymous]
public Response<IList<UploadFile>> UploadWithFormData(IFormCollection formdata)
public Response<IList<UploadFile>> UploadWithFormData([FromForm] IFormCollection formdata)
{
var result = new Response<IList<UploadFile>>();
try

View File

@ -21,7 +21,7 @@ namespace OpenAuth.WebApi.Controllers
//添加
[HttpPost]
public Response Add(AddApproverReq obj)
public Response Add([FromBody] AddApproverReq obj)
{
var result = new Response();
try
@ -39,7 +39,7 @@ namespace OpenAuth.WebApi.Controllers
//修改
[HttpPost]
public Response Update(AddApproverReq obj)
public Response Update([FromBody] AddApproverReq obj)
{
var result = new Response();
try

View File

@ -87,7 +87,7 @@ namespace OpenAuth.WebApi.Controllers
/// <summary>召回流程</summary>
/// <remarks> 召回后流程状态为【草稿】状态,可以再次发起流程。所有的流程节点状态还原,但保留审批记录 </remarks>
[HttpPost]
public Response ReCall(RecallFlowInstanceReq obj)
public Response ReCall([FromBody] RecallFlowInstanceReq obj)
{
var result = new Response();
try
@ -106,7 +106,7 @@ namespace OpenAuth.WebApi.Controllers
/// <summary>启动流程</summary>
/// <remarks> 通常是对状态为【草稿】的流程进行操作,进入运行状态 </remarks>
[HttpPost]
public Response Start(StartFlowInstanceReq obj)
public Response Start([FromBody] StartFlowInstanceReq obj)
{
var result = new Response();
try
@ -128,7 +128,7 @@ namespace OpenAuth.WebApi.Controllers
/// <para>更新时可以修改表单内容,可以修改流程基本信息,但不能更换表单模版</para>
/// <returns></returns>
[HttpPost]
public Response Update(UpdateFlowInstanceReq obj)
public Response Update([FromBody] UpdateFlowInstanceReq obj)
{
var result = new Response();
try
@ -150,7 +150,7 @@ namespace OpenAuth.WebApi.Controllers
/// </summary>
/// <returns></returns>
[HttpPost]
public Response Verification(VerificationReq request)
public Response Verification([FromBody] VerificationReq request)
{
var response = new Response();
try

View File

@ -38,7 +38,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Add(FlowScheme obj)
public Response Add([FromBody] FlowScheme obj)
{
var result = new Response();
try
@ -57,7 +57,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Update(FlowScheme obj)
public Response Update([FromBody] FlowScheme obj)
{
var result = new Response();
try

View File

@ -49,7 +49,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Add(Form obj)
public Response Add([FromBody] Form obj)
{
var result = new Response();
try
@ -68,7 +68,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Update(Form obj)
public Response Update([FromBody] Form obj)
{
var result = new Response();
try

View File

@ -132,7 +132,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response<Module> Add(Module obj)
public Response<Module> Add([FromBody] Module obj)
{
var result = new Response<Module>();
try
@ -151,7 +151,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Update(Module obj)
public Response Update([FromBody] Module obj)
{
var result = new Response();
try
@ -192,7 +192,7 @@ namespace OpenAuth.WebApi.Controllers
/// <para>当前登录用户的所有角色会自动分配菜单</para>
/// </summary>
[HttpPost]
public Response<ModuleElement> AddMenu(ModuleElement obj)
public Response<ModuleElement> AddMenu([FromBody] ModuleElement obj)
{
var result = new Response<ModuleElement>();
try
@ -213,7 +213,7 @@ namespace OpenAuth.WebApi.Controllers
/// 修改菜单属性
/// </summary>
[HttpPost]
public Response UpdateMenu(ModuleElement obj)
public Response UpdateMenu([FromBody] ModuleElement obj)
{
var result = new Response();
try

View File

@ -45,7 +45,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Add(AddOrUpdateOpenJobReq obj)
public Response Add([FromBody] AddOrUpdateOpenJobReq obj)
{
var result = new Response();
try
@ -139,7 +139,7 @@ namespace OpenAuth.WebApi.Controllers
/// 改变任务状态,启动/停止
/// </summary>
[HttpPost]
public Response ChangeStatus(ChangeJobStatusReq req)
public Response ChangeStatus([FromBody] ChangeJobStatusReq req)
{
var result = new Response();
try

View File

@ -43,7 +43,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response<SysOrg> Add(SysOrg obj)
public Response<SysOrg> Add([FromBody] SysOrg obj)
{
var result = new Response<SysOrg>();
try
@ -62,7 +62,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response Update(SysOrg obj)
public Response Update([FromBody] SysOrg obj)
{
var result = new Response();
try

View File

@ -49,7 +49,7 @@ namespace OpenAuth.WebApi.Controllers
}
[HttpPost]
public Response<string> Add(AddOrUpdateResReq obj)
public Response<string> Add([FromBody] AddOrUpdateResReq obj)
{
var resp = new Response<string>();
try
@ -66,7 +66,7 @@ namespace OpenAuth.WebApi.Controllers
}
[HttpPost]
public Response Update(AddOrUpdateResReq obj)
public Response Update([FromBody] AddOrUpdateResReq obj)
{
Response resp = new Response();
try

View File

@ -47,7 +47,7 @@ namespace OpenAuth.WebApi.Controllers
/// 添加角色如果当前登录用户不是System则直接把新角色分配给当前登录用户
/// </summary>
[HttpPost]
public Response<RoleView> Add(RoleView obj)
public Response<RoleView> Add([FromBody] RoleView obj)
{
var result = new Response<RoleView>();
try
@ -71,7 +71,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Update(RoleView obj)
public Response Update([FromBody] RoleView obj)
{
var result = new Response();
try

View File

@ -41,7 +41,7 @@ namespace OpenAuth.WebApi.Controllers
/// 添加
/// </summary>
[HttpPost]
public Response Add(SysLog obj)
public Response Add([FromBody] SysLog obj)
{
var result = new Response();
try
@ -62,7 +62,7 @@ namespace OpenAuth.WebApi.Controllers
/// 修改日志(建议废弃)
/// </summary>
[HttpPost]
public Response Update(SysLog obj)
public Response Update([FromBody] SysLog obj)
{
var result = new Response();
try

View File

@ -47,7 +47,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Read(ReadMsgReq obj)
public Response Read([FromBody] ReadMsgReq obj)
{
var result = new Response();
try

View File

@ -41,7 +41,7 @@ namespace OpenAuth.WebApi.Controllers
//添加
[HttpPost]
public Response<string> Add(AddOrUpdateSysPrinterPlanReq obj)
public Response<string> Add([FromBody] AddOrUpdateSysPrinterPlanReq obj)
{
var result = new Response<string>();
try
@ -103,7 +103,7 @@ namespace OpenAuth.WebApi.Controllers
//修改
[HttpPost]
public Response Update(AddOrUpdateSysPrinterPlanReq obj)
public Response Update([FromBody] AddOrUpdateSysPrinterPlanReq obj)
{
var result = new Response();
try

View File

@ -41,7 +41,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public Response ChangeProfile(ChangeProfileReq request)
public Response ChangeProfile([FromBody] ChangeProfileReq request)
{
var result = new Response();
@ -65,7 +65,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost]
public Response ChangePassword(ChangePasswordReq request)
public Response ChangePassword([FromBody] ChangePasswordReq request)
{
var result = new Response();
try
@ -83,7 +83,7 @@ namespace OpenAuth.WebApi.Controllers
//添加或修改
[HttpPost]
public Response<string> AddOrUpdate(UpdateUserReq obj)
public Response<string> AddOrUpdate([FromBody] UpdateUserReq obj)
{
var result = new Response<string>();
try

View File

@ -40,7 +40,7 @@ namespace OpenAuth.WebApi.Controllers
//添加
[HttpPost]
public Response<string> Add(AddOrUpdateWmsInboundOrderDtblReq obj)
public Response<string> Add([FromBody] AddOrUpdateWmsInboundOrderDtblReq obj)
{
var result = new Response<string>();
try
@ -63,7 +63,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Update(AddOrUpdateWmsInboundOrderDtblReq obj)
public Response Update([FromBody] AddOrUpdateWmsInboundOrderDtblReq obj)
{
var result = new Response();
try

View File

@ -43,7 +43,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Add(AddOrUpdateWmsInboundOrderTblReq obj)
public Response Add([FromBody] AddOrUpdateWmsInboundOrderTblReq obj)
{
var result = new Response();
try
@ -69,7 +69,7 @@ namespace OpenAuth.WebApi.Controllers
/// <param name="obj"></param>
/// <returns></returns>
[HttpPost]
public Response Update(AddOrUpdateWmsInboundOrderTblReq obj)
public Response Update([FromBody] AddOrUpdateWmsInboundOrderTblReq obj)
{
var result = new Response();
try