| | |
| | | return vmList; |
| | | } |
| | | |
| | | #endregion Query |
| | | #endregion |
| | | |
| | | #region Insert |
| | | |
| | |
| | | } |
| | | } |
| | | var model = input.Adapt<AddXhsProjectInput, Model.XhsProject>(); |
| | | model.SortCode = _service.GetMaxSortCode() + 1; |
| | | model.SortCode = _service.GetMaxSortCode(0) + 1; |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | } |
| | | |
| | | /* /// <summary> |
| | | /// 插入拓展 |
| | | /// </summary> |
| | | [Route("InsertEx@V1.0")] |
| | | [HttpPost] |
| | | public long InsertsEx(ProjectInputs text) |
| | | { |
| | | var id = _service.InsertsEx(project, Item, Model, Map); |
| | | return id; |
| | | }*/ |
| | | |
| | | #endregion Insert |
| | | #endregion |
| | | |
| | | #region Update |
| | | |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新 UseStatus |
| | | /// 发布 |
| | | /// </summary> |
| | | [Route("UpdateUseStatus@V1.0")] |
| | | [Route("Publish@V1.0")] |
| | | [HttpPut] |
| | | public bool UpdateUseStatus([Required] UpdateUseStatusInput input) |
| | | public bool Publish([Required] IDInput input) |
| | | { |
| | | var bol = _service.UpdateUseStatus(input.ID, (Yw.Model.eUseStatus)input.UseStatus); |
| | | var bol = _service.Publish(input.ID, out string Msg); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, Msg); |
| | | } |
| | | return bol; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 弃用(谨慎操作) |
| | | /// </summary> |
| | | [Route("Deprecate@V1.0")] |
| | | [HttpPut] |
| | | public bool Deprecate([Required] IDInput input) |
| | | { |
| | | var bol = _service.Deprecate(input.ID, out string Msg); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, Msg); |
| | | } |
| | | return bol; |
| | | } |
| | | |