public IActionResult Get(string id) { if (!string.IsNullOrEmpty(id)) { return(toResponse(_powerService.GetId(id))); } return(toResponse(_powerService.GetAll())); }
public IActionResult GetPowersGroup() { var powers = (_powerService.GetAll()).OrderBy(m => m.CreateTime); var response = powers.GroupBy(m => m.Page).Select(m => new { Page = m.Key, Powers = powers.Where(p => p.Page == m.Key).OrderBy(m => m.CreateTime).Select(m => new { m.ID, m.Name, m.Description, Checked = false }), }); return(toResponse(response)); }