| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | |
| | | public Task_HtyController(ITask_HtyService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å 餿§çåå²ä»»å¡æ°æ® |
| | | /// </summary> |
| | | /// <param name="keepMonths">ä¿ççææ°ï¼é»è®¤ä¸º3个æï¼æ¬æ+å两个æï¼</param> |
| | | /// <returns>å é¤çè®°å½æ°</returns> |
| | | [HttpGet, Route("DeleteOldHistory")] |
| | | [AllowAnonymous] |
| | | public IActionResult DeleteOldHistory(int keepMonths = 3) |
| | | { |
| | | try |
| | | { |
| | | int result = Service.DeleteOldTaskHistory(keepMonths); |
| | | return Ok(new { Success = true, Message = "åå²ä»»å¡å 餿å", DeletedCount = result }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return Ok(new { Success = false, Message = "åå²ä»»å¡å é¤å¤±è´¥: " + ex.Message }); |
| | | } |
| | | } |
| | | } |
| | | } |