文件上传功能添加,注意使用Path.Combine处理通用路径问题(windows||docker)
This commit is contained in:
1 parent
7817c5374c
commit
244b59a3fb
135 files changed
+16937
-75
No files matched your search
+195
@@ -0,0 +1,195 @@
|
||||
|
||||
using CloudBuilder.Core.DatabaseAccessor;
|
||||
using CloudBuilder.Core.Policy;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Transactions;
|
||||
using CloudBuilder.Core.Service;
|
||||
using CloudBuilder.Master.Service;
|
||||
using CloudBuilder.Core.DatabaseAccessor.Entity;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using CloudBuilder.Master.Entity;
|
||||
using System;
|
||||
using CloudBuilder.Master.Data;
|
||||
using CloudBuilder.Master.SearchCriteria;
|
||||
|
||||
namespace CloudBuilder.Web.Entry.Controllers.Master
|
||||
{
|
||||
[Authorize(AuthorizePolicy.PERMISSION)]
|
||||
[ApiController]
|
||||
[Route("[controller]/[action]")]
|
||||
public class PublishVideoController : ControllerBase
|
||||
{
|
||||
private readonly IApplicationService service;
|
||||
private readonly IPublishVideoService publishVideoService;
|
||||
|
||||
public PublishVideoController(IApplicationService service, IPublishVideoService publishVideoService)
|
||||
{
|
||||
this.service = service;
|
||||
this.publishVideoService= publishVideoService;
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindByKey(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.FindByKey(key);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindBySearchCriteria(PublishVideoSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.FindBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Find")]
|
||||
[HttpPost]
|
||||
public dynamic FindPublishVideoDefault()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.FindPublishVideoDefault();
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Print")]
|
||||
[HttpPost]
|
||||
public dynamic PrintBySearchCriteria(PublishVideoSearchCriteria criteria)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.PrintBySearchCriteria(criteria);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Insert")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Insert(PublishVideoData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.Insert(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Update")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Update(PublishVideoData data)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var result = publishVideoService.Update(data);
|
||||
return result;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Delete")]
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
public dynamic Delete(string key){
|
||||
try
|
||||
{
|
||||
publishVideoService.Delete(key);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
[PermissionOperate(name: "PublishVideo", operate: "Insert")]
|
||||
[HttpPost]
|
||||
public dynamic InsertPublishVideoDetail(PublishData publishData){
|
||||
try
|
||||
{
|
||||
publishVideoService.InsertPublishVideoDetail(publishData);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
catch (ValidatedException vex)
|
||||
{
|
||||
return vex;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ServiceErrorException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user