public async Task <object> GetPreference(int id)
        {
            var preference = await _preferenceService.GetPreference(id);

            if (preference == null)
            {
                return(JsonResults.Error(errorNum: 404, errorMessage: "It`s preference not found"));
            }

            var model = GetPreferenceModel(preference);

            return(JsonResults.Success(model));
        }
 /// <summary>
 /// 获取首选项
 /// </summary>
 /// <returns></returns>
 public Preference GetPreference()
 {
     return(preferService.GetPreference());
 }