     }
 }
 
-struct AccessUser: IUser {
+struct AccessUser: UserProtocol {
     func insert(_ user: User) {
         print("\(#function) user")
     }

struct User {}

// 协议
protocol IUser {
    func insert(_ user: User)
    func get(_ id: Int) -> User
}

struct SQLServerUser: IUser {
    func insert(_ user: User) {
        print("\(#function) user")
    }

}

// 工厂协议
protocol FactoryProtocol {
    func createUser() -> UserProtocol
    func createDepartment() -> DepartmentProtocol
}

struct SqlServerFactory: FactoryProtocol {
    func createUser() -> UserProtocol {
        return SQLServerUser()
    }
    
    func createDepartment() -> DepartmentProtocol {
        return SQLServerDepartment()
    }
}

struct AccessFactory: FactoryProtocol {
    func createUser() -> UserProtocol {
        return AccessUser()
    }
    
    func createDepartment() -> DepartmentProtocol {
        return AccessDepartment()
    }
}
