| | |
| | | public class BimfaceFileRelation_Controller : IDynamicApiController |
| | | { |
| | | |
| | | private readonly Service.BimfaceFileRelation _service = new(); |
| | | private readonly Yw.Service.BimfaceFileRelation _service = new(); |
| | | |
| | | |
| | | #region Query |
| | |
| | | var list = _service.GetByObjectTypeAndObjectID(input.ObjectType, input.ObjectID); |
| | | var vmList = list?.Select(x => new BimfaceFileRelationDto(x)).ToList(); |
| | | return vmList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通过 ObjectType 和 ObjectID 获取特定目的的列表 |
| | | /// </summary> |
| | | [Route("GetByObjectTypeAndObjectIDOfPurpose@V1.0")] |
| | | [HttpGet] |
| | | public List<BimfaceFileRelationDto> GetByObjectTypeAndObjectIDOfPurpose([FromQuery][Required] ObjectOfPurposeInput input) |
| | | { |
| | | var list = _service.GetByObjectTypeAndObjectIDOfPurpose(input.ObjectType, input.ObjectID, input.Purpose); |
| | | var vmList = list?.Select(x => new BimfaceFileRelationDto(x)).ToList(); |
| | | return vmList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 通过 ObjectType 和 ObjectID 获取特定目的的默认数据 |
| | | /// </summary> |
| | | [Route("GetDefaultByObjectTypeAndObjectIDOfPurpose@V1.0")] |
| | | [HttpGet] |
| | | public BimfaceFileRelationDto GetDefaultByObjectTypeAndObjectIDOfPurpose([FromQuery][Required] ObjectOfPurposeInput input) |
| | | { |
| | | var model = _service.GetDefaultByObjectTypeAndObjectIDOfPurpose(input.ObjectType, input.ObjectID, input.Purpose); |
| | | return model == null ? null : new BimfaceFileRelationDto(model); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region Exist |
| | | |
| | | /// <summary> |
| | | /// 通过 BimfaceFileID 判断是否存在 |
| | | /// </summary> |
| | | [Route("IsExistByBimfaceFileID@V1.0")] |
| | | [HttpDelete] |
| | | public bool IsExistByBimfaceFileID([FromQuery][Required] BimfaceFileIDInput input) |
| | | { |
| | | var bol = _service.IsExistByBimfaceFileID(input.BimfaceFileID); |
| | | return bol; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Delete |
| | | |
| | | /// <summary> |
| | |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除所有 |
| | | /// </summary> |
| | | [Route("DeleteAllByID@V1.0")] |
| | | [HttpDelete] |
| | | public bool DeleteAllByID([FromQuery][Required] IDInput input) |
| | | { |
| | | var bol = _service.DeleteAllByID(input.ID, out string Msg); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D001, Msg); |
| | | } |
| | | return bol; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |