/// <summary> /// 创建映射 /// </summary> /// <param name="mapping">映射实体</param> /// <returns>如果映射已经存在,则返回已经存在的映射(用户ID和映射类型);如果不存在则创建后返回</returns> public Mapping CreateMapping(Mapping mapping) { var mp = GetMappingByLocalUserId(mapping.LocalUserId, mapping.MappingType); if (mp != null) { return(mp); } mappingRepository.Create(mapping); return(mapping); }