using Furion; using YBDevice.Entity; namespace YBDevice.CommonService { public class DefaultService { public static string APICDNURL = App.Configuration["APICDNURL"];//API图片CDN地址 public DefaultService() { if (string.IsNullOrEmpty(APICDNURL)) { APICDNURL = App.Configuration["CustomSetting:CDNURL"]; } } /// /// 加载默认头像 /// /// 性别,1-男,2-女 /// 类型,1-成人,2-儿童 /// public static string HeadImg(GenderType sex, FamilyType type) => (sex, type) switch { _ when sex == GenderType.Male && type == FamilyType.Adult => $"{APICDNURL}/img/adult_male.png", _ when sex == GenderType.FeMale && type == FamilyType.Adult => $"{APICDNURL}/img/adult_female.png", _ when sex == GenderType.Male && type == FamilyType.Children => $"{APICDNURL}/img/child_male.png", _ when sex == GenderType.FeMale && type == FamilyType.Children => $"{APICDNURL}/img/child_female.png", _ when sex == GenderType.UnKnow && type == FamilyType.Adult=> $"{APICDNURL}/img/adult_male.png", _ => $"{APICDNURL}/img/child_male.png" }; } }