public async Task <ActionResult <bool> > UpdateIndexVideoOrImageConfig(IndexVideoConfigDTO data) { var filepath = Path.Combine(Directory.GetCurrentDirectory(), "config/indexVideo.json"); bool flag = await JsonFileHelper.SetConfig(filepath, data); return(Ok(flag)); }
public async Task <ActionResult <IndexVideoConfigDTO> > GetIndexVideoOrImageConfig() { var filepath = Path.Combine(Directory.GetCurrentDirectory(), "config/indexVideo.json"); JObject jObject = await JsonFileHelper.GetConfig <JObject>(filepath); string data = jObject.GetValue("data").ToString(); IndexVideoConfigDTO baseConfigs = JsonConvert.DeserializeObject <IndexVideoConfigDTO>(data); return(Ok(baseConfigs)); }